UM-0085-B09
DT80 Range User Manual
Page 349
RG
SERIAL
is actually a channel type, in the same way that
V
(voltage) is a channel type. It can appear in schedules and it
has channel options, like any other channel type. The control_string is a special channel option which applies only to the
SERIAL
channel type.
Note:
An error message will be returned if you attempt to define an n
SERIAL
channel and the selected port's function has not been set
to
SERIAL
in the DT80 profile.
Channel Options
Most of the standard channel options (
Table 5: DT80 Channel Options (P47)
) may be used with the serial channel, e.g.
W
(working channel),
=
n
CV
(assign to CV), and so on.
For the
SERIAL
channel type, the channel factor is the maximum time to wait for serial data to be received. Default is
10s. This value is a floating point number, so a value of 0.1 will set the timeout to 100ms.
If the standard
"
UserName
~
UserUnits
"
channel option is specified, it must come after the control string in the list of
serial channel options.
Channel Return Value
Depending on the control string, the return value of a
SERIAL
channel may be either:
•
a data value, interpreted from the data returned by the sensor, or
•
a status code, indicating whether the commands in the control string were performed successfully.
See
for more details.
Serial Channel Operation
The Control String
The "
control_string
" is always enclosed by quotation marks. It can be broken into two parts:
•
Output actions
— commands, prompts or text strings that are to be sent from the DT80 to the device
connected to the serial channel. The various output actions available are detailed in the section
. All output actions are enclosed by
{}
.
•
Input actions
— commands to manage the DT80’s Serial Channel and to interpret the information coming back
from the serial device into the Serial Channel. The various input actions available are detailed in the section
Control String – Input Actions (P353)
. Input actions are not enclosed by
{}
.
The general form of the "
control_string
" is
•
any combination of output actions enclosed by
{}
, and/ or
•
any combination of input actions.
There may be any number of blocks of output actions and input actions, as shown in the following example Serial
Channel commands:
1SERIAL("{
output actions
}",
options
)
1SERIAL("
input actions
",
options
)
1SERIAL("{
output actions
}
input actions
",
options
)
1SERIAL("{
output
}
input
{
output
}
input
",
options
)
The "
control_string
" is always executed in order left to right, giving you complete control over the sequence of actions.
Where a bi-directional dialog occurs between the DT80 and serial device, the output actions and input actions can be
included in the same Serial Channel command as shown above, or in separate Serial Channel commands as follows:
BEGIN
RA1M
1SERIAL("{
output actions
}",
options
)
1SERIAL("
input actions
",
options
)
END
This latter approach simplifies the appearance of the program steps for supervising the Serial Channel, particularly if
there are a number of data points to be prompted and interpreted or parsed in each access. Note however that each
instance of
SERIAL
uses up one channel table entry (see
)