beautypg.com

Close, Close devclear enablelocal, Syntax – Measurement Computing GPIB-488.2 User Manual

Page 24

background image

3-6

IOtech to Associated MCC APIs

986992

GPIB 488.2 Porting Guide

IOtech GPIB Command

Associated MCC GPIB 488.2 Command(s)

Close DevClear

EnableLocal

Syntax

Close

INT WINAPI Close(DevHandleT devHandle);

DevClear DevClear(int board, short address)
EnableLocal
EnableLocal(int board, short addresslist[])


Usage Notes

Close, no longer to be used, commanded to wait for I/O to complete, then flush any buffers
associated with the device being closed. It then made the device handle invalid.
DevClear

is used to clear one device. This routine sends the GPIB Selected Device Clear

(SDC) message to the specified device. To clear multiple devices, use the DevClearList
routine. If address is set to NOADDR, then all connected devices on the GPIB, are cleared
through the Universal Device Clear (UDC) message.
To clear the device at GPIB primary address 4, secondary address 30, and connected to GPIB
board 0, we would follow the example.

Example
:

DevClear(0, MakeAddr (4,30));

/* Use MakeAddr macro (in GPIB.H) to pack

primary and secondary address *

EnableLocal

is used to place specified devices in local mode, meaning that they can be

programmed from their local, on-device, controls. When this routine is executed, the Controller
addresses the specified GPIB devices as listeners and then sends the GPIB Go To Local (GTL)
command. To put all devices in local mode, use an array containing only the NOADDR value.
This unasserts the GPIB Remote Enable (REN) line, thereby placing all GPIB devices in local
mode.
The following example shows instruction to put the GPIB devices, at addresses 6 and 7
(connected to board 0), in local mode.
Example:

short addresslist[3] = {6,7,NOADDR};

EnableLocal(0, addresslist);