UM-0085-B09 DT80 Range User Manual Page 353
RG
Control String – Input Actions
The table below lists the commands available to interpret the information coming back into the Serial Channel from the
serial device. Input actions are not enclosed by
{} in the control string.
Characters
text
For each character in the input action string, the DT80 will
read and discard all incoming characters from the serial
device until that particular character is seen. It then discards
the matching character and starts looking for the next
character in the input action text.
For example, if the input action string is abc and the input
data from the serial device is 3c3aabaAAc123 then all
characters up to and including the second "c" will match, i.e.
they will be read and discarded.
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 ASCII-
Decimal Table (P389).
To include a literal %, { or } character, use \% or \{ or \}
Control signal
state
wait up to n or nCV milliseconds for CTS input to be set
(high) – RS232 only
wait up to n or nCV milliseconds for CTS input to be cleared
(low) – RS232 only
(Wait)
or
Delay for n or nCV milliseconds. Actual delay time will be
approximately 2ms or 2 character times, whichever is longer.
\e
Clear all previously received characters from the receive
buffer
Fixed text string
\m[text] or
n
Read and discard incoming characters until the exact string
text (or the text in n$) is seen, then discard the matching
Numeric data
%{width}type{[nCV]}
e.g. %d[2CV], %9f
Interpret the received data according to the specified numeric
format and store the result into nCV. If the [nCV] is not
specified, the result will be returned as the return value of the
channel. Note that { } signifies "optional"
String data
%{width}type[n$]
e.g. %6s[5$]
Interpret the received data according to the specified string
format and store the result into n$
Data to skip
%*{width}type
e.g.
,
Interpret the received data according to the specified
numeric/string format but do not store the result. In other
words, skip over this data value.
One of a set of
strings
%{width}type['str1','str2',...,nCV{=m}]
e.g. %9s['goose','moose',23CV=2]
If the incoming string matches str1 then set nCV=0
If the incoming string matches str2 then set nCV=1
If the incoming string matches str3 then set nCV=2 (etc.)
If a default value (=m) is specified and the incoming string
matches none of the strings then set nCV=m
Numeric and String Formats
These tables describe the possible values for type – that is, the different ways in which the incoming string of characters
can be interpreted.
Example, assumes input data string is 123.456
→
1CV = 123.456 (nothing left in receive buffer)
→
1CV = 123 (.456 left in receive buffer)
hexadecimal integer
→ 1CV = 291 (
left in receive buffer)
→
1CV = 73 (.456 left in receive buffer)
decimal/hex/octal integer
→ 1CV = 123 (
left in receive buffer)
→
1CV = 49 (23.456 left in receive buffer)
→
1CV = 49 (23.456 left in receive buffer)
Example, assumes input data string is aaba cxyab↵
↵
→ 1$ = "aaba cxyab" (nothing left in receive buffer)
S
string (whitespace
1SERIAL("%S[1$]") → 1$ = "aaba" (cxyab↵ left in receive buffer)
[chars]
string containing only
specified chars
1SERIAL("%[abc ][1$]") → 1$ = "aaba c" (xyab↵ left in receive buffer)
string not containing
specified chars
→ 1$ = "aa" (ba cxyab↵ left in receive buffer)