Chapter 6
Programming in G Mode
©
National Instruments Corporation
6-3
second line of the example is a NI-488.2 function call that allows a personal
computer to control the GPIB from Microsoft BASIC. This function
outputs the string in
WRT$
to the GPIB-232/485CT-A.
Programming Message Example 2
To send more than one programming message with one GPIB write
operation, embed a <CR> or an <LF> in the data string you send. For
example, to send the two programming messages "change serial port
parameters" and "change serial port XON/XOFF protocol", you could use
either of the two following sequences.
•
You can send two separate strings to the GPIB in two separate GPIB
writes as in the following example:
WRT$="SPSET 1200,n,8"+CHR$(13)
CALL IBWRT(GPIB232%,WRT$)
WRT2$="XON 1,1"+CHR$(13)
CALL IBWRT(GPIB232%,WRT$)
•
You could also put both messages in one string and send it to the
GPIB-232/485CT-A in one GPIB write as in the following example:
WRT$="SPSET 1200,n,8"+CHR$(13)+"XON 1,1"+CHR$(13)
CALL IBWRT(GPIB232%,WRT$)
How Messages are Processed
The GPIB-232/485CT-A processes each programming message on a
line-by-line basis. When the GPIB-232/485CT-A receives a message,
it buffers the message, interprets the function name and arguments,
then executes the message.
Function Arguments
When you type in a function, separate the first argument from the function
name with at least one space. Separate each additional argument with at
least one space or comma.
In the syntax portions of the function descriptions in Chapter 7,
, the square brackets (
[]
) that enclose some arguments indicate
that those arguments are optional. Do not enter the brackets as part of your
arguments.