10 ! RE-STORE "704_COMP3:,702,0"

20 !

30 ! This program demonstrates the use of the 44704 in 16 bit mode and

40 ! the use of COMPEN to convert T type thermocouple voltage readings to temperature.

50 ! A packed array is used AND a channel/range scan list.

60 ! This allows for different ranges on different channels.

70 ! Special Note: it isn''t necessary to use 16 bit mode to measure

80 ! thermocouples since the accuracy really isn''t there.

90 !

100 !OPTION BASE 0

110 DIM Errstr$[222]

120 !

130 ! slot module

140 ! 500 44713A High speed fet thmc mux

150 ! 600-700 44704a High speed DVM

160 !

170 !

180 !

190 Start_ch=500 ! First scanned channel

200 Stop_ch=507 ! Last scanned channel

210 Num_chs=Stop_ch-Start_ch+1 !

220 REAL Rdgs(7) ! Readings destination

230 !

240 ASSIGN @Dac TO 709

250 !

260 ! Set up the mainframe and it''s arrays

270 !

280 CLEAR @Dac

290 OUTPUT @Dac;"RESET;scratch"

300 ! Reference value needs to be array if crossing card boundaries

310 OUTPUT @Dac;"REAL Ref_valu(";Num_chs-1;")"

320 ! Could use either packed or real mainframe array to receive 704 values

330 OUTPUT @Dac;"PACKED Pvolts(";Num_chs*2-1;")"

340 OUTPUT @Dac;"REAL Result(";Num_chs-1;")"

350 !

360 ! Configure the Channel, Range and Gain lists

370 !

380 OUTPUT @Dac;"INTEGER Chs(";Num_chs-1;")"

390 OUTPUT @Dac;"REAL Ranges(";Num_chs-1;")"

400 OUTPUT @Dac;"REAL Gains(";Num_chs-1;")"

410 !

420 ! Range values shown are approximate maximums for given range

430 ! Gain values assume a 10 volt RANGE setting, which is

440 ! the value always used by mainframe in 16 bit unpacking in COMPEN command

450 OUTPUT @Dac;"Chs(0)=";Start_ch;"; Ranges(0)=.039; Gains(0)=256."

460 OUTPUT @Dac;"Chs(1)=";Start_ch+1;"; Ranges(1)=.319; Gains(1)=32."

470 OUTPUT @Dac;"Chs(2)=";Start_ch+2;"; Ranges(2)= 2.55; Gains(2)=4."

480 OUTPUT @Dac;"Chs(3)=";Start_ch+3;"; Ranges(3)= 10.2; Gains(3)=1."

490 OUTPUT @Dac;"Chs(4)=";Start_ch+4;"; Ranges(4)=.03; Gains(4)=256."

500 OUTPUT @Dac;"Chs(5)=";Start_ch+5;"; Ranges(5)=.03; Gains(5)=256"

510 OUTPUT @Dac;"Chs(6)=";Start_ch+6;"; Ranges(6)=.03; Gains(6)=256."

520 OUTPUT @Dac;"Chs(7)=";Start_ch+7;"; Ranges(7)=.03; Gains(7)=256."

530 !

540 !

550 ! Configure the voltmeter in slot 600:

560 !

570 OUTPUT @Dac;"USE 600"

580 OUTPUT @Dac;"SCANMODE ON"

590 OUTPUT @Dac;"TERM RIBBON" ! Uses 44713 FET mux card

600 OUTPUT @Dac;"SCTRIG HOLD"

610 OUTPUT @Dac;"CONF DCV " ! Measure THMC''s w/ DCVolts, convert later

620 OUTPUT @Dac;"RANGE 10" ! Required, else RESOL 16 will errror

630 OUTPUT @Dac;"RESOL 16" ! Turn on 16 bit mode

640 OUTPUT @Dac;"NRDGS 1" ! 100 rdgs/channel averaged would be better

650 OUTPUT @Dac;"TRIG INT"

660 OUTPUT @Dac;"CLWRITE SENSE Chs RANGE Ranges"

670 !

680 ! Trigger the single scan

690 !

700 OUTPUT @Dac;"SCTRIG SGL USE 600"

710 !

720 ! Post Process readings: transfer to mainframe, measure reference, convert

730 OUTPUT @Dac;"XRDGS 600,";Num_chs;" INTO Pvolts"

740 OUTPUT @Dac;"CONFMEAS REFT ";Start_ch;"-";Stop_ch;" USE 600 INTO Ref_valu"

750 OUTPUT @Dac;"COMPEN TEMPT Pvolts REF Ref_valu GAIN Gains INTO Result"

760 !

770 ! Transfer the results to controller and print

780 !

790 PRINT "CONVERTED READINGS:"

800 OUTPUT @Dac;"VREAD Result"

810 ENTER @Dac;Rdgs(*)

820 PRINT Rdgs(*)

830 PRINT

840 END