HP (Hewlett-Packard) 132A Water Dispenser User Manual


 
Chapter 3 Programming Your Universal Counter for Remote Operation
Elements of SCPI Commands
Programming Guide 3-61
Easiest Way to Make a Measurement (HP BASIC) (Continued)
540 ! The following commands will measure the frequency on channel 1.
550 ! The MEAS? query can be broken down into CONF and READ? commands.
560 ! The CONF and READ? allow more flexibility than the MEAS? query.
570 ! CONF can be used to configure a measurement. Additional commands
580 ! can then be issued to fine tune the measurement setup. The READ?
590 ! command than reads the result. In the following example, a frequency
600 ! measurement is configured, then, as an example for changing the setup
610 ! created by the CONF command, the counter is programmed for a trigger
620 ! level of 50 mV. (The CONF command tells the counter to use the AUTO
630 ! trigger level mode) Finally, the data is read using the READ? command.
640 PRINT
650 PRINT "Frequency measured using CONF:FREQ (@1) and READ?"
660 OUTPUT @Count;"CONF:FREQ (@1)" ! Configure for frequency measurement
670 OUTPUT @Count;":EVENT1:LEVEL .05" ! Set trigger level to 50 mV
680 OUTPUT @Count;"READ?" ! Ask for data
690 ENTER @Count;Freq$
700 PRINT
710 PRINT "Frequency = ";Freq$
720 PRINT
730 RETURN
740 !
750 !
760 Init_fetc:! Use INIT and FETCH to read frequency and period
770 ! The READ? command can be broken down into INIT and FETCH?, providing
780 ! even more measurement flexibility. By using FETCH?, you can retrieve
790 ! results based on already acquired data. For example, period can be
800 ! derived from a frequency measurement, without a new acquisition.
810 ! The following example uses CONF to set up a frequency measurement.
820 ! The trigger level is then changed to -50 millivolts and an INIT is
830 ! performed, starting the measurement process. The data is read using
840 ! the FETCH:FREQUENCY? command. The period can then be read by sending
850 ! FETCH:PERIOD?, this time asking for the period.
860 PRINT
870 PRINT "Frequency and Period measured using CONF:FREQ (@1), INIT, FETCH?"
880 OUTPUT @Count;"CONF:FREQ (@1)" ! Configure for frequency measurement
890 OUTPUT @Count;":EVENT1:LEVEL -.05"! Change trigger level
900 OUTPUT @Count;"INIT" ! Start a measurement
910 OUTPUT @Count;"FETCH:FREQUENCY?" ! Ask for frequency result
920 ENTER 703;Freq$
930 PRINT
940 PRINT "Frequency = ";Freq$
950 OUTPUT @Count;"FETCH:PERIOD?" ! Ask for period result derived from
960 ! frequency measurement. Note that
970 ! another measurement was not made.
980 ENTER @Count;Period$
990 PRINT
1000 PRINT "Period = ";Period$
1010 PRINT
1020 RETURN
1030 END