Your application program will not include the power module symbolic name and GPIB address. These must be specified during configuration (when you run IBCONF.EXE). Note that the primary address range is from 0 to 30 but any secondary address must be specified in the address range of 96 to 126. The power supply expects a message termination on EOI or line feed, so set EOI w/last byte of Write. It is also recommended that you set Disable Auto Serial Polling.
All function calls return the status word IBSTA%, which contains a bit (ERR) that is set if the call results in an error. When ERR is set, an appropriate code is placed in variable IBERR %. Be sure to check IBSTA %, after every function call. If it is not equal to zero, branch to an error handler that reads IBERR% to extract the specific error.
Error Handling
If there is no
Important Use error detection after every call to a subroutine.
Agilent BASIC Controllers
The Agilent BASIC Programming Language provides access to GPIB functions at the operating system level. This makes it unnecessary to have the header files required in front of DOS applications programs. Also, you do not have to be concerned about controller "hangups" as long as your program includes a timeout statement. Because the power module can be programmed to generate SRQ on errors, your program can use an SRQ service routine for decoding detected errors. The detectable errors are listed in "Chapter 5 - Error Messages".
TRANSLATION AMONG LANGUAGES
This section explains how to translate between Agilent BASIC and several other popular programming environments. For explicit information on initializing interface cards or syntax of language, see the documentation that accompanies your GPIB interface product.
General Setup Information for GWBASIC
Using the Agilent 82335A/82990A/61062B GPIB Command Library
∙When CALLs are made to the GPIB Command Library, all parameters are passed as variables.
∙The address of a module is a real number, determined in the same manner as in Agilent BASIC. For example, the address 70501 means 7 is the select code of the GPIB interface, 05 is the GPIB address of the mainframe, 01 is the slot number (secondary address) of the module.
∙The module expects each command to be terminated by line feed (character 10) and/or EOI. The default configuration of the GPIB Command Library is carriage return + line feed for
∙The GPIB Command Library supports strings, numeric and array data formats. However, multiple data types cannot be sent in a single command. To send both string and numeric data in one command, convert all numeric data to strings, concatenate with the string data and send the combined string to the module. To read multiple data types, read the data into a string, and then manipulate the string by converting each piece into the appropriate data format.
∙Error handling is accomplished by checking the variable PCIB.ERR. If it is nonzero, an error has occurred. See the command library documentation for trapping and interpreting this error variable.
Introduction To Programming 17