COMMANDS AND COMMAND LINES
It is a good idea to get acquainted with the
AVS47-Serial/USB-W by using an RS232 hyperterminal program. It lets you control the bridge by writing commands/queries and reading the responses.
Although such a program is no longer included in
Windows, many free programs are available from
the Internet. For example, we have used
https://sourceforge.net/p/hypetermi-
nal/wiki/Home/
and, if you have LabView, you can try
https://decibel.ni.com/content/docs/
DOC-16284
See also page 9.
Commands to the AVS47-Serial/USB-W are not case
sensitive. You may insert blank space(s) between the
command and argument part. Commands “ran5”,
“RAN5”, “ran 5”, “RAN 5” or “ran 5” are all
equivalent.
The rst part of a command or query can contain
only alphabetic letters. The second, argument part of
a command, is made of integral numbers. The argument part of a query is a question mark “?” like in
“RAN ?” or “ran?”.
Several commands can be placed on a single
command line. The commands/queries must have
a command separator, or delimiter, between them
(comma or semicolon, which is the start-up default).
Your own computer program can terminate the com-
mand line either by carriage return (CR or \r, ASCII
13), by linefeed (LF or \n, ASCII 10) or by CRLF.
These are called line terminators and the box recognizes them all. The commands/queries are performed
in sequential order, the previous command must be
completed before the next one can be handled.
For example: “rem1;inp1;ran3;exc7” (quotation marks are not parts of the actual string) sets
the bridge in remote mode, sensor measuring input,
200Ω range and 10mV excitation. After having
waited for some seconds (settling time), one can take
the reading.
Maximum number of characters on one line,
including command separators and possible blanks,
is 255. Handling the commands starts after a line
terminator has been received. If the command line
is not terminated with CR, LF or CRLF, processing
will not start.
Do not issue further commands or queries before
all the commands/queries on the previous command
line have been executed.
Responses
The AVS47-Serial/USB-W obeys the principle, that
only a query can produce response. So your applica-
tion program needs not poll and read the serial port
after commands.
The only exception to this is the REPEAT command. If the repeated line contains queries, the
responses are sent automatically, and you must
decide how to read them. It is not necessary to read
responses, the buffer is emptied after each repeated
line.
Responses can consist of printable alphanumeric
characters, but most queries return only a number.
Some values are output as oating point numbers,
but exponential format is not supported. The re-
sponses do not have headers in order to make them
easier to read into a program.
If a command line consists of more than one
query, the responses are output in the corresponding
order and they are separated by the specied command separator (delimiter).
For example, command line
“ARN10;RES5;RES?;RAN?” instructs the bridge to
go to autorange mode, wait for 10 seconds after each
automatic change of range (if needed), then take a
mean of 5 A/D conversions, and place the result and
the range setting (which was possibly altered by autoranging) in the output queue. The result is sent via
the RS232 port to the computer, which must detect
that data has arrived into the serial buffer and then
read it from the buffer. The response could be like
“1234.5000;4” (i.e. 1234.5Ω; 2kΩ range).
You may save programming overhead by giving
commands for a measurement on one line. Respons-
es to queries may be easier to read into variables, if
queries are made separately for each item. Then one
does not need to remove the delimiters and parse the
response line.
The response ends by the line terminator specied by the TER command (default is CRLF). The
terminator can, but it must not, be the same for
both transmitting and receiving. The AVS47-Serial/
USB-W will always recognize any of the three line
terminators, CR, LF or CRLF.