© National Instruments Corp.
7-1
GPIB-232CT User Manual
Chapter 7
Programming in G Mode
This chapter shows how to program the GPIB-232CT in G mode using
programming messages. It describes programming messages, their format,
and how they are processed, along with the functions and function
arguments that make up the programming messages.
This chapter also explains how to communicate with your serial device
through the GPIB-232CT.
Programming Messages
You program the GPIB-232CT by sending it programming messages
(which are ASCII strings) by way of its GPIB port.
Programming Message Format
The programming message consists of a function name, one or more
arguments (optional), followed by a carriage return (<CR>), or a linefeed
(<LF>), or a carriage return followed by a linefeed <CR><LF>. Carriage
return and linefeed can be expressed in BASIC as
CHR$(13)
and
CHR$(10)
, respectively.
Example of a Programming Message
In the following lines of BASIC code:
WRT$ ="eos x,10"+CHR$(13)
CALL
IBWRT(GPIB232%,WRT$)
WRT$
contains the programming message in which
eos
is the function
name,
x
and
10
are the arguments, and
CHR$(13)
is the terminating
carriage return. This programming message tells the GPIB-232CT to assert
the EOI line when it sends the end-of-string character linefeed. The second
line of the example is a GPIB-PC function call provided as part of a
National Instruments product that allows a personal computer to control the
GPIB from Microsoft BASIC. This function outputs the string in
WRT$
to
the device GPIB-232CT.