Chapter 3 Programming Your Universal Counter for Remote Operation
Programming Examples
3-70 Programming Guide
To Perform a Time Interval Calibration (HP BASIC)
(Continued)
440 CLEAR @Count
450 OUTPUT @Count;"*RST" ! Reset the HP 53131A
460 OUTPUT @Count;"*CLS" ! Clear event registers and error queue
470 OUTPUT @Count;"*SRE 0" ! Clear service request enable register
480 OUTPUT @Count;"*ESE 0" ! Clear event status enable register
490 OUTPUT @Count;":STAT:PRES" ! Preset enable registers and
500 ! transition filters for operation and
510 ! questionable status structures.
520 RETURN
530 !
540 Unsecure: ! Routine UNSECURES the device
550 OUTPUT @Count;":CAL:SEC:STAT?" ! Query the current security status
560 ENTER @Count;Device_secure ! Check: SECURED=1, UNSECURED=0
570 WHILE Device_secure=1 ! If device is SECURED
580 INPUT "Enter security code to unsecure counter.",Code$
590 OUTPUT @Count;":CAL:SEC:STAT OFF,";Code$ ! UNSECURE the device
600 OUTPUT @Count;":CAL:SEC:STAT?" ! verify it is SECURED
610 ENTER @Count;Device_secure
620 IF Device_secure=1 THEN ! On operator error, loop
630 PRINT "Wrong code, try again."
640 GOSUB Read_errors
650 END IF
660 END WHILE
670 RETURN
680 !
690 Resecure: ! Routine SECURES the device
700 OUTPUT @Count;":CAL:SEC:STAT?" ! Query the current security status
710 ENTER @Count;Device_secure ! Check: SECURED=1, UNSECURED=0
720 WHILE Device_secure=0 ! If device is UNSECURED
730 INPUT "Enter security code to secure counter.",Code$
740 OUTPUT @Count;":CAL:SEC:STAT ON,";Code$ ! SECURE the device
750 OUTPUT @Count;":CAL:SEC:STAT?" ! verify it is SECURED
760 ENTER @Count;Device_secure
770 IF Device_secure=0 THEN ! On operator error, loop
780 PRINT "Wrong code, try again."
790 GOSUB Read_errors
800 END IF
810 END WHILE
820 RETURN
830 !
840 Store_cal: ! Routine collects the calibration data
850 OUTPUT @Count;":CAL:DATA?" Ask for calibration data
860 ENTER @Count USING "#,4A";Head1$ ! Collect the data. Store Head1$ and
870 ENTER @Count USING "%,K";Cal_data$ ! Cal_data$ on a disk as your backup
880 RETURN
890 !
900 !