Controller Functions

The controller functions configure the controller or send IEEE 488 commands to which all instruments respond.

cac—Become Active Controller

cmd—Send IEEE 488 Commands

dma—Set DMA Mode or Programmed I/O Mode

gts—Go from Active Controller to Standby

ist—Set Individual Status Bit

llo—Local Lockout

loc—Place Controller in Local State

off—Take Controller Offline

ppc—Parallel Poll Configure (Enable and Disable)

ppu—Parallel Poll Unconfigure

rpp—Conduct Parallel Poll

rsc—Release or Request System Control

rsv—Request Service and/or Set the Serial Poll Status Byte

sic—Send Interface Clear

sre—Unassert or Assert Remote Enable

cac—Become Active Controller

syntax cac 0 (take control synchronously)
cac 1 (take control immediately)

cac takes control either synchronously or immediately, and in some cases asynchronously. You generally do not need to use the cac function because other functions, such as cmd and rpp, take control automatically.

If you try to take control synchronously when a data handshake is in progress, the function postpones the take control action until the handshake is complete. If a handshake is not in progress, the function executes the take control action immediately. Taking control synchronously is not guaranteed if a read or write operation completes with a timeout or other error.

You should take control asynchronously when it is impossible to gain control synchronously, for example, after a timeout error.

The ECIC error results if the GPIB controller is not CIC.

cmd—Send IEEE 488 Commands

syntax cmd string

cmd sends GPIB command messages. These command messages include device talk and listen addresses, secondary addresses, serial and parallel poll configuration messages, and device clear and trigger messages.

You do not use cmd to transmit programming instructions to devices. The GPIB Read and GPIB Write functions transmit programming instructions and other device-dependent information.

string contains the command bytes the controller sends. ASCII characters represent these bytes in cmd string. If you must send characters that cannot be displayed, you can enable backslash codes on the string control or string constant, or you can use a format function to list the commands in hexadecimal.

dma—Set DMA Mode or Programmed I/O Mode

syntax dma 0 (use programmed I/O)
dma 1 (use DMA)

dma indicates whether data transfers use DMA.

Some GPIB controllers do not have DMA capability. If you try to execute dma 1, the function returns GPIB error 11 to indicate no capability.

gts—Go from Active Controller to Standby

syntax gts 0 (no shadow handshaking)
gts 1 (shadow handshaking)

gts sets the GPIB controller to the controller standby state and unasserts the ATN signal if it is the active controller. Normally, the GPIB controller is involved in the data transfer. gts permits GPIB devices to transfer data without involving the GPIB controller.

If shadow handshaking is active, the GPIB controller participates in the GPIB transfer as a listener but does not accept any data. When it detects the END message, the GPIB controller asserts the Not Ready For Data (NRFD) to create a handshake holdoff state.

If shadow handshaking is not active, the GPIB controller performs neither shadow handshaking nor a handshake holdoff.

If you enable the shadow handshake option, the GPIB controller participates in a data handshake as a listener without actually reading the data. It monitors the transfer for the END message and stops subsequent transfers. This mechanism allows the GPIB controller to take control synchronously on subsequent operations such as cmd or rpp.

After you send the gts command, wait for END before you initiate another GPIB command. You can do this with the GPIB Wait function.

The ECIC error results if the GPIB controller is not CIC.

ist—Set Individual Status Bit

syntax ist 0 (individual status bit is cleared)
ist 1 (individual status bit is set)
ist sets the sense of the individual status (ist) bit.

Use ist when the GPIB controller is not the CIC but participates in a parallel poll conducted by a device that is the active controller. The CIC conducts a parallel poll by asserting the EOI and ATN signals, which send the Identify (IDY) message. While this message is active, each device that you configured to participate in the poll responds by asserting a predetermined GPIB data line either TRUE or FALSE, depending on the value of its local ist bit. For example, you can assign the GPIB controller to drive the DIO3 data line TRUE if ist is 1 and FALSE if ist is 0. Conversely, you can assign it to drive DIO3 TRUE if ist is 0 and FALSE if ist is 1.

The Parallel Poll Enable (PPE) message in effect for each device determines the relationship among the value of ist, the line that is driven, and the sense at which the line is driven. The GPIB controller is capable of receiving this message either locally using ppc or remotely through a command from the CIC. After the PPE message executes, ist changes the sense at which the GPIB controller drives the line during the parallel poll, and the GPIB controller can convey a one-bit, device-dependent message to the controller.

llo—Local Lockout

syntax llo

llo places all devices in local lockout state. This action usually inhibits recognition of inputs from the front panel of the device.

llo sends the Local Lockout (LLO) command.

loc—Place Controller in Local State

syntax loc

loc places the GPIB controller in a local state by sending the local message Return To Local (RTL) if it is not locked in remote mode (indicated by the LOK bit of status). You use loc to simulate a front panel RTL switch when you use a computer to simulate an instrument.

off—Take Controller Offline

syntax off

off takes the controller offline. This is only needed when sharing the controller with another application which is using the NI-488 Library.

ppc—Parallel Poll Configure (Enable and Disable)

syntax ppc byte

ppc configures the GPIB Controller to participate in a parallel poll by setting its Local Poll Enable (LPE) message to the value of byte. If the value of byte is 0, the GPIB controller unconfigures itself.

Each of the 16 Parallel Poll Enable (PPE) messages selects the GPIB data line (DIO1 through DIO8) and sense (1 or 0) that the device must use when responding to the Identify (IDY) message during a parallel poll. The device interprets the assigned message and the current value of the individual status (ist) bit to determine if the selected line is driven TRUE or FALSE. For example, if PPE=0x64, DIO5 is driven TRUE if ist is 0 and FALSE if ist is 1. If PPE=0x68, DIO1 PPE message is in effect. You must know which PPE and PPD messages are sent and determine what the responses indicate.

ppu—Parallel Poll Unconfigure

syntax ppu

ppu disables all devices from responding to parallel polls.

ppu sends the Parallel Poll Unconfigure (PPU) command.

rpp—Conduct Parallel Poll

syntax rpp

rpp conducts a parallel poll of previously configured devices by asserting the ATN and EOI signals, which sends the IDY message.

rpp places the parallel poll response in the output string as ASCII characters.

rsc—Release or Request System Control

syntax rsc 0 (release system control)
rsc 1 (request system control)

rsc releases or requests the capability of the GPIB controller to send the Interface Clear (IFC) and Remote Enable (REN) messages to GPIB devices using the sic and sre functions. For the GPIB controller to respond to IFC sent by another controller, the GPIB controller must not be the system controller.

In most applications, the GPIB controller is always the system controller. You use rsc only if the computer is not the system controller for the duration of the program execution.

rsv—Request Service and/or Set the Serial Poll Status Byte

syntax rsv byte

rsv sets the serial poll status byte of the GPIB controller to byte. If the 0x40 bit is set in byte, the GPIB controller also requests service from the controller by asserting the GPIB RQS line. For example, if you want to assert the GPIB RQS line, send the ASCII character @, in which the 0x40 bit is set.

You use rsv to request service from the controller using the Service Request (SRQ) signal and to provide a system-dependent status byte when the controller serial polls the GPIB port.

sic—Send Interface Clear

syntax sic

sic causes the controller to assert the IFC signal for at least 100 ms if the controller has system controller authority. This action initializes the GPIB and makes the Controller port CIC. You generally use sic when you want a device to become CIC or to clear a bus fault condition.

The IFC signal resets only the GPIB functions of bus devices; it does not reset internal device functions. The Device Clear (DCL) and Selected Device Clear (SDC) commands reset the device functions. Consult the instrument documentation to determine the effect of these messages.

sre—Unassert or Assert Remote Enable

syntax sre 0 (unassert Remote Enable)
sre 1 (assert Remote Enable)

sre unasserts or asserts the GPIB REN line. Devices monitor REN when they select between local and remote modes of operation. A device does not actually enter remote mode until it receives its listen address.

The ESAC error occurs if the controller is not system controller.