Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-43
Sample Programs
Listings of the Sample Programs
2300 !
2310 !
2320 ! Subprogram name: Convert_data
2330 ! Parameters: none
2340 ! Return value: none
2350 ! Description: This routine converts the waveform data to time/voltage information
2360 ! using the values Xinc, Xref, Xorg, Yinc, Yref, and Yorg used to describe
2370 ! the raw waveform data.
2380 !
2390 !
2400 SUB Convert_data
2410 COM /Io/@Scope,@Path,Interface
2420 COM /Raw_data/ INTEGER Data(4095)
2430 COM /Converted_data/ REAL Time(4095),Volts(4095)
2440 COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg
2450 COM /Variables/ INTEGER Record_length
2460 !
2470 FOR I=0 TO Record_length-1
2480 Time(I)=(((I)-Xref)*Xinc)+Xorg
2490 Volts(I)=((Data(I)-Yref)*Yinc)+Yorg
2500 NEXT I
2510 SUBEND
2520 !
2530 !
2540 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2550 !
2560 !
2570 ! Subprogram name: Store_csv
2580 ! Parameters: none
2590 ! Return value: none
2600 ! Description: This routine stores the time and voltage information about the waveform
2610 ! as time/voltage pairs in a comma-separated variable file format.
2620 !
2630 !
2640 SUB Store_csv
2650 COM /Io/@Scope,@Path,Interface
2660 COM /Converted_data/ REAL Time(4095),Volts(4095)
2670 COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg
2680 COM /Variables/ INTEGER Record_length
2690 !Create a file to store pairs in
2700 ON ERROR GOTO Cont
2710 PURGE "Pairs.csv"
2720 Cont: OFF ERROR
2730 CREATE "Pairs.csv",Max_length
2740 ASSIGN @Path TO "Pairs.csv";FORMAT ON
2750 !Output data to file
2760 FOR I=0 TO Record_length-1
2770 OUTPUT @Path;Time(I),Volts(I)
2780 NEXT I
2790 SUBEND
2800 !
2810 !
2820 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2830 !
2840 !
2850 ! Subprogram name: Close