INST_CLOSE()
NAME
INST_CLOSE − Compiled SCPI Commands
SYNOPSIS
INST_CLOSE (id);
DESCRIPTION
This is an HP Compiled SCPI macro command. The instrument close command closes the I/O channel of communication with a device and releases memory used by the instrument driver.
PARAMETERS
id
The user variable name for the instrument. This is the variable name that you assign to the instrument in the INST_DECL or INST_EXTERN command. For example,
INST_DECL (vm, "E1411B", REGISTER);
assigns vm as an instrument data pointer to the E1411B. Now when you use vm as the id in INST_CLOSE, the I/O channel will be closed to the HP E1411B.
COMMENTS
An INST_OPEN must be executed earlier in the program to open the I/O channel of communication and initialize the instrument driver.
If you do not use an instrument close command the I/O channel will automatically be closed when the program terminates. This is done by the underlying HP SICL I/O Library.
Typical reasons for using the INST_CLOSE command include the following:
To open another I/O channel for the same type of instrument.
To use an instrument in a different configuration. For example, you want to change a switch card configured as a scanning voltmeter to a switchbox configuration.
For MESSAGE configurations, C-SCPI uses the HP SICL iclose() function. See the HP SICL documentation for more information.
See also INST_OPEN.
EXAMPLE
This example opens an I/O channel for a voltmeter and a switch. The I/O channels are then closed and an I/O channel is opened for a scanning voltmeter (with the switch configured as one of the voltmeter’s cards). See the HP E1326B/E1411B Multimeter User’s Manual for information on these configurations.
INST_DECL (vm, "E1411B", REGISTER);
INST_DECL (sw, "E1460A", REGISTER);
main()
{
INST_STARTUP();
INST_OPEN (vm, "VXI,24");
INST_OPEN (sw, "VXI,(25,26)");
.
INST_CLOSE (vm);
INST_CLOSE (sw);
.
INST_OPEN (vm, "VXI,(24,25,26)");
.
}
— December 04, 1992