|
Question:
Do you have any 3852 examples that use more than one 44702A talking to a Hyper Viper card? Answer: Example program for the 3852A testing CDA speed of 44702A connected via GPIO to a Measurement Coprocessor (HyperViper) card.
60 ! 70 !########################################################## 80 ! This program demonstrates the use of a 3852A mainframe, 90 ! two 44702B DVMs, and a PC with a high performance 100 ! measurement coprocessor (hyper viper) performing 110 ! continuous data acquisition. 120 ! 130 ! The PC, an HP QS/20 had a hyper viper and two GP-IO cards 140 ! installed. In addition, the hyper viper card needs one 150 ! megabyte of memory and DMA. Data is TRANSFER from the 160 ! 44702B via GP-IO ports to a hard disk. I tested both 170 ! the internal PC hard disc and an external disc. The 180 ! external disc was LIF formatted, for maximum speed. 190 ! 200 ! The 3852A is configured with two 44702Bs (B version needed 210 ! for increased on-board reading memory). The cards were 220 ! installed as follows: 230 ! slot module 240 ! 000 44711A High speed fet mux 250 ! 100-200 44702B High speed DVM 260 ! 500 44711A High speed fet mux 270 ! 600-700 44702B High speed DVM 280 ! 290 ! This program configure the voltmeters, then triggers the 300 ! 44702s to start continuous operation and transfers the 310 ! readings first to a buffer in the hyper viper and finally 320 ! to hard disc. The data is stored in PACKED format and the 330 ! process can be terminated by pressing the SRQ button on the 340 ! front panel of the 3852A. By varying the value of SPER 350 ! (the scanning rate of the voltmeters), you can determine 360 ! the overall throughput of this configuration. This is due 370 ! to the fact the 44702 will stop taking readings when its 380 ! data buffer fills and the transfers will "hang" at that 390 ! point. 400 ! 410 ! Achieved the following results: 420 ! Internal PC hard disk: 40,000 rdgs/sec * 430 ! External hard disk, 440 ! an HP 7212, LIF FORMATTED: 124,000 rdgs/sec * 450 ! 460 ! * Note: These are cumulative results for the two DVMs 470 ! The DVMs were sampling at half this rate. 480 ! 490 !########################################################## 500 DISP "VARIABLE DECLARATIONS" 510 ! 520 OPTION BASE 1 530 INTEGER Eof_rec,Eof_rec_nbytes,Rec,Byt,Gpio1,Gpio2 540 REAL Real_1,Real_2,Real_3 550 ! 560 Buff_size=65536 570 Stop_rec=20000 ! After this rec is stored on disc, exit 580 ! loop gracefully and create report 590 !########################################################### 600 ! 610 !########################################################### 620 DISP "CREATING FILES" 630 ! 640 ! The two files the data will be sent to are defined below. 650 ! 660 MASS STORAGE IS ":DOS,D" ! This is the only line that 670 ! needs to be modified 680 File1$="H1_DATA" ! for external disc 690 File2$="H2_DATA" 700 ON ERROR GOTO Cont1 ! Try and purge old files 710 PURGE File1$ ! continue program if files 720 Cont1: ON ERROR GOTO Cont2 ! don't exist 730 PURGE File2$ 740 Cont2: ! 750 CREATE BDAT "H1_DATA",20000,256 760 CREATE BDAT "H2_DATA",20000,256 770 !########################################################### 780 ! 790 !########################################################### 800 DISP "ASSIGN PATHS" 810 ! 820 Gpio1=10 ! GPIO interface select code 10 830 Gpio2=11 ! A second GPIO interface at select 840 ! code 11 850 ASSIGN @Dac TO 709 860 ASSIGN @Gpio1 TO Gpio1 870 ASSIGN @Gtran1 TO Gpio1;WORD 880 ASSIGN @Buf1 TO BUFFER [Buff_size];FORMAT OFF 890 ASSIGN @Buf2 TO BUFFER [Buff_size];FORMAT OFF 900 ASSIGN @Gpio2 TO Gpio2 910 ASSIGN @Gtran2 TO Gpio2;WORD 920 ASSIGN @File1 TO File1$;FORMAT OFF 930 ASSIGN @File2 TO File2$;FORMAT OFF 940 !########################################################### 950 ! 960 !########################################################### 970 DISP "SET UP EOF" 980 ! Set EOF (End Of File) pointers to the last byte of the last 990 ! record [transfer will not update EOF pointer as it runs] 1000 ! 1010 Eof_rec=20000 1020 Eof_rec_nbytes=256 1030 CONTROL @File1,7;Eof_rec 1040 CONTROL @File1,8;Eof_rec_nbytes 1050 CONTROL @File2,7;Eof_rec 1060 CONTROL @File2,8;Eof_rec_nbytes 1070 !########################################################### 1080 ! 1090 !########################################################### 1100 DISP "SETTING UP DVM @100" 1110 ! 1120 ! Set sample rate below. Rdgs/sec for each voltmeter. 1130 ! 1140 Freq=20000 1150 ! 1160 ! 1170 ! The following code will setup the two 44702's 1180 ! The first 702 is in slot 100 connected to the GPIO 1190 ! interface 10 1200 ! The second 702 is in slot 600 connected to GPIO 1210 ! interface 11 1220 ! 1230 CLEAR @Dac 1240 OUTPUT @Dac;"RESET" 1250 WAIT .5 1260 ! 1270 OUTPUT @Dac;"OUTBUF ON; INBUF ON;DISABLE LABELS; DISP OFF" 1280 ! 1290 ! Configure the voltmeter in slot 100: 1300 OUTPUT @Dac;"USE 100" 1310 OUTPUT @Dac;"RESET 100" 1320 OUTPUT @Dac;"SCANMODE ON" 1330 OUTPUT @Dac;"SCTRIG HOLD" 1340 OUTPUT @Dac;"FUNC DCV" 1350 OUTPUT @Dac;"RANGE 10" 1360 OUTPUT @Dac;"TERM RIBBON" 1370 OUTPUT @Dac;"RDGS GPIO" 1380 OUTPUT @Dac;"NRDGS 1" 1390 OUTPUT @Dac;"SPER";1/Freq ! Varies the scanning rate 1400 OUTPUT @Dac;"SCDELAY .005" 1410 OUTPUT @Dac;"ASCAN ON" 1420 OUTPUT @Dac;"CLWRITE SENSE 000" 1430 OUTPUT @Dac;"STTRIG HOLD" 1440 !----------------------------------------- 1450 CONTROL Gpio1,2;5 ! Setup voltmeter to send readings 1460 OUTPUT Gpio1 USING "#,W";4 ! to GPIO interface 1470 CONTROL Gpio1,2;4 1480 !----------------------------------------- 1490 !----------------------------------------- 1500 ! Configure the voltmeter in slot 600: 1510 DISP "SETTING UP DVM @600" 1520 OUTPUT @Dac;"USE 600" 1530 OUTPUT @Dac;"RESET 600" 1540 OUTPUT @Dac;"SCANMODE ON" 1550 OUTPUT @Dac;"SCTRIG HOLD" 1560 OUTPUT @Dac;"FUNC DCV" 1570 OUTPUT @Dac;"RANGE 10" 1580 OUTPUT @Dac;"TERM RIBBON" 1590 OUTPUT @Dac;"RDGS GPIO" 1600 OUTPUT @Dac;"NRDGS 1" 1610 OUTPUT @Dac;"SPER";1/Freq ! Scanning rate for second 1620 ! 44702B 1630 OUTPUT @Dac;"SCDELAY .005" 1640 OUTPUT @Dac;"ASCAN ON" 1650 OUTPUT @Dac;"CLWRITE SENSE 500" 1660 OUTPUT @Dac;"STTRIG HOLD" 1670 !---------------------------------------- 1680 CONTROL Gpio2,2;5 ! Setup second voltmeter for GPIO 1690 OUTPUT Gpio2 USING "#,W";4 ! reading destination 1700 CONTROL Gpio2,2;4 1710 !---------------------------------------- 1720 !########################################################### 1730 ! 1740 !########################################################### 1750 !INTERRUPT SETUP 1760 ! Allow for termination by pressing SRQ key 1770 ! Could also add an End of File terminator at this point to 1780 ! enable termination of the program when hard disc volume is 1790 ! filled. 1800 ! 1810 ON INTR 7 GOSUB Terminate 1820 Mask=2 1830 ENABLE INTR 7;Mask 1840 OUTPUT @Dac;"ENABLE INTR SYS" 1850 OUTPUT @Dac;"RQS FPS;RQS ON" ! Stop transfer by 1860 ! Pressing SRQ key 1870 !############################################################ 1880 ! 1890 !############################################################ 1900 DISP "TRIGGER DVMS" 1910 ! 1920 OUTPUT @Dac;"SCTRIG SGL USE 100" ! Trigger voltmeter to 1930 ! begin taking readings 1940 OUTPUT @Dac;"SCTRIG SGL USE 600" 1950 ! 1960 !############################################################ 1970 ! 1980 !############################################################ 1990 CLEAR SCREEN 2000 DISP "BEGIN LOOP: SAMPLE RATE";Freq 2010 ! 2020 PRINTER IS CRT 2030 T0=TIMEDATE 2040 T1=TIMEDATE 2050 REPEAT 2060 TRANSFER @Gtran1 TO @Buf1;WAIT !Transfer data from 44702 2070 ! to Series 300 buffer. 2080 ! Wait is done to allow transfer to complete before 2090 ! sending to disc (due to limitation of DMA in computer 2100 ! - two channels). 2110 ! 2120 TRANSFER @Buf1 TO @File1 2130 STATUS @File1,5;Rec,Byt 2140 PRINT TABXY(10,5);"FILL RECORD AND BYTE =";Rec;", ";Byt 2150 TRANSFER @Gtran2 TO @Buf2;WAIT 2160 TRANSFER @Buf2 TO @File2 2170 STATUS @File2,5;Rec,Byt 2180 PRINT TABXY(10,8);"FILL RECORD AND BYTE =";Rec;", ";Byt 2190 UNTIL Rec>Stop_rec 2200 T2=TIMEDATE 2210 !############################################################ 2220 ! 2230 !############################################################ 2240 DISP "Loop complete generate report time is";TIMEDATE 2250 GOSUB Close_paths 2260 CLEAR SCREEN 2270 PRINTER IS 701 2280 Real_1=Rec 2290 Real_2=Eof_rec_nbytes 2300 Real_3=Real_1*Real_2 2310 PRINT 2320 PRINT "IT TOOK";T2-T1-(T1-T0);"SECONDS TO" 2330 PRINT "TRANSFER";Real_3;"BYTES OF DATA" 2340 PRINT " THAT IS";Real_3/(T2-T1-(T1-T0));"BYTES/SEC" 2350 PRINT "THE DVMS SAMPLE RATE IS";Freq;"RDGS/SEC" 2360 STOP 2370 ! 2380 ! 2390 Xfer_done: ! Could be used to reset file pointers to starting 2400 ! positions if you wanted to overwrite the data 2410 ! (circular hard disc file) 2420 CONTROL @File1,5;1,1 2430 CONTROL @File2,5;1,1 2440 RETURN 2450 ! 2460 ! 2470 Terminate: ! 2480 DISP "TERMINATING" 2490 WAIT .05 2500 GOSUB Close_paths 2510 PRINT TABXY(10,10);"TRANSFER HAS BEEN ABORTED BY SRQ !!!" 2520 FOR I=1 TO 2 2530 BEEP 2540 WAIT .1 2550 NEXT I 2560 STOP 2570 ! 2580 ! 2590 Close_paths: ! 2600 ABORTIO @Gtran1 2610 ABORTIO @Gtran2 2620 ASSIGN @Gran1 TO * 2630 ASSIGN @Gran2 TO * 2640 ABORTIO @File1 2650 ABORTIO @File2 2660 ASSIGN @File1 TO * 2670 ASSIGN @File2 TO * 2680 RETURN 2690 ! 2700 ! 2710 END |