Chapter 5
ibic-Interface Bus Interactive Control Utility
© National Instruments Corp.
5-13
NI-488.2M UM for Windows NT
Common NI-488.2 Routines in ibic
Set 488.2
You must use the
set
command before you can use NI-488.2 routines in
ibic
. The
syntax for this form of the
set
command is as follows:
set 488.2
n
where
n
represents a board number (for example,
n
=0 for
gpib0
).
Send and SendList
The
Send
routine sends data to a single GPIB device. You can use the
SendList
command to send data to multiple GPIB devices. For example, suppose you want to send
the five character string
*IDN?
followed by the new line character with EOI. You want
to send the message from the computer to the devices at primary address 2 and 17. To do
this, enter the
SendList
command at the
488.2
(0)
prompt as shown in the
following example:
488.2 (0): SendList 2, 17 “*IDN?” NLend
[0128] (cmpl cic tacs)
count: 6
The returned status word contains the
cmpl
bit, which indicates a successful I/O
completion. The byte count
6
indicates that all six characters, including the added new
line, were sent from the computer and received by both devices.
Receive
The
Receive
routine causes the GPIB board to receive data from another GPIB device.
The following example acquires 10 data bytes from the device at primary address 5. It
stops receiving data when 10 characters have been received or when the END message is
received. The acquired data is then displayed in hex format along with its ASCII
equivalent. The
ibic
program also displays the status word and the count of transferred
bytes.
488.2 (0): Receive 5 10 STOPend
[2124] (end cmpl cic lacs)
count: 5
48 65 6c 6c 6f Hello