20 Introduction To Programming
Receiving Data from the Module
The following screens show how to enter data from the module with various interfaces.
******************************************* Agilent BASIC ******************************************
2100 ENTER 70501; MEASUREMENT ! where 70501 means 7 is the select code of the GPIB interface,
2110 ! 05 is the GPIB address of the mainframe, 01 is the slot number
2120 ! (secondary address) of the module, MEASUREMENT is a real number
2130 ! sent by the module
**************** GWBASIC (Agilent 82335A/82990A/61062B GPIB Command Library) ***********************
2100 MODULE.ADDRESS=70501
2110 CALL IOENTER(MODULE.ADDRESS,MEASUREMENT)
2120 IF PCIB.ERR&< >0 THEN ERROR PCIB.BASERR ! ERROR TRAP
************************** GWBASIC (National Instruments GPIB Interface) *******************************
2100 MEASUREMENT$ - SPACE$(20) ! DRIVER CAN ONLY READ STRINGS, SO RESERVE
2110 ! SPACE IN A STRING
2120 CALL IBRD(MODULE.ADDRESS%, MEASUREMENT$)
2130 IF IBSTA% &< 0 GOTO 5000 ! TRAP ERROR WITH ERROR HANDLER AT LINE 5000
2140 MEASURED.VALUE=VAL(MEASUREMENT$)” ! CONVERT THE STRING TO A NUMBER
Receiving Module Data with BASIC