Chapter 7
Programming in G Mode
© National Instruments Corp.
7-5
GPIB-232CT User Manual
The GPIB-232CT and Serial Device as Talker
When the GPIB-232CT receives its own talk address, it sends out status
information.
When the GPIB-232CT receives the serial device talk address, it sends all
data received from the serial device to the GPIB.
For example, let's say your serial device is programmed to perform some
calculations and you want it to return data to you.
First, address the serial device to talk by sending to the GPIB-232CT the
serial device talk address. Next, perform a GPIB read of 100 bytes. The
GPIB-232CT retrieves 100 bytes from its serial port receive buffer and
sends them to you.
Now, find out if the serial device has sent more bytes to the GPIB-232CT
by asking the GPIB-232CT to send you status information. Do this by
sending the GPIB-232CT its listen address and the programming message
stat n
. Then, send the GPIB-232CT its talk address and perform a GPIB
read of 20 bytes. The GPIB-232CT sends you its status information,
terminated by the GPIB END message.
This status information contains the number of bytes remaining in the serial
port receive buffer. This information will help you decide how much data
to continue to collect from the serial device.
If the GPIB-232CT receives its talk address but has nothing to send, it will
respond to GPIB reads with a carriage return and a linefeed, accompanied
by END. If the GPIB-232CT receives the serial device talk address but has
no data in its serial port receive buffer to send, it will wait for data from the
serial device to fill the request.
The
TALK
LED on the GPIB-232CT's front panel is lit when either the
GPIB-232CT is addressed to talk or the serial device is addressed to talk.