UM-0085-B09
DT80 Range User Manual
Page 351
RG
Control String – Output Actions
The table below lists the ways in which prompts and text strings can be sent from the DT80 to the device connected to
the Serial Channel. These commands must be enclosed by
{}
in the control string.
What to output
Output Action syntax
Description
Text
text
e.g.
abc\009def\013
,
GETVAL^M^J
A sequence of characters to be
sent
.
Non-printable characters may be specified using
\
nnn
(where
nnn
is the ASCII code, 1-255).
^
char
notation may also be
used for control characters (ASCII 1-31), see
.
Break character
\b[
n
]
or
\b[
n
CV]
Transmit a "break" (set the Tx line to logic-0 state) for
n
or
n
CV
character periods
Control signal
\r1
Set
RTS
(to a value >+3.5V) – RS232 only
\r0
Clear
RTS
(to a value <–3.5V) – RS232 only
(Wait)
\w[
n
]
or
\w[
n
CV]
Delay for
n
or
n
CV milliseconds. Actual delay time will be
approximately 2ms or 2 character times, whichever is longer.
reserved
characters
\%
or
\{
or
\}
Output a
%, {
or
}
character. (
%%
may also be used to output a
single
%
character.)
CV value
%
{flag}{width}
.
{precision}
type
[
n
CV]
e.g.
%d[2CV]
or
%9.3f[7CV]
or
%06d[1CV]
Output the value of
n
CV in the specified numeric format (see
below). Note that
{ }
signifies "optional"
string value
%
{flag}{width}
.
{precision}
s[
n
$]
e.g.
%s[1$]
or
%-9.9s[2$]
Output the value of string variable
n
$
Numeric Formats
This table describes the possible values for
type
– that is, the different ways in which a CV value can be converted into a
string of characters.
Type
Description
Example, assumes
1CV = 74.36
f
floating point
1SERIAL("{%f[1CV]}")
→
74.36
e
floating point, exponential format
1SERIAL("{%e[1CV]}")
→
7.436e01
E
floating point, exponential format
1SERIAL("{%E[1CV]}")
→
7.436E01
g
f
or
e
format depending on value
1SERIAL("{%g[1CV]}")
→
74.36
G
f
or
E
format depending on value
1SERIAL("{%G[1CV]}")
→
74.36
d
integer
1SERIAL("{%d[1CV]}")
→
74
x
hexadecimal integer
1SERIAL("{%x[1CV]}")
→
4a
X
hexadecimal integer
1SERIAL("{%X[1CV]}")
→
4A
o
octal integer
1SERIAL("{%o[1CV]}")
→
112
c
single character
1SERIAL("{%c[1CV]}")
→
J
Note that
•
The
%c
conversion outputs the value of
n
CV
as a single 8-bit character. Only the lower 8 bits of the integer
portion of
n
CV
are output. So in the above example the character value 74 (ASCII "J") will be sent.
•
The
%g
and
%G
conversions select exponential notation if the exponent is less than –4, or greater than or equal
to the specified
Width, Precision and Flag
The various conversion types described above can be further qualified using the optional
width
,
precision
and
flag
specifiers. These allow you to control exactly how the transmitted data will be formatted.
Field Width
The
width
value specifies the
minimum output field width
– that is, the minimum number of characters that will be
output. If the converted value requires fewer characters than the specified field width, then space or zero characters are
used to pad the field to the specified width. If the converted value results in more characters than the specified field
width, then all characters will still be output. The
width
parameter is not applicable for the
%c
conversion type.