TempScan / MultiScan User's Manual Chapter 16: API Command Reference 277
Fixed Formats
Any command with the Query (
?
) command extension or any User Status (
U
) command returns a fixed
format. For instance, any option that can range up to 65,535 always returns five digits, so zero would
be returned as
00000
. In the following command descriptions, leading zeros are included. However,
they are not required when entering the command.
Conflict Errors
Some combinations of commands and parameters can be sent to the TempScan/1100 or
MultiScan/1200 unit that are out of range for a particular configuration or inconsistent with other
commands. For instance, specifying a Set Scan Interval (
I
) command with less time than the unit can
acquire scans results in a conflict error:
PRINT#1,"OUTPUT07;C1-992,I00:00:00.0,00:00:00.0X"
A conflict error lights up the ERROR LED indicator on the TempScan/1100 or MultiScan/1200 front
panel and returns an E4 when queried with the Query Error Status (
E?
) command. Some conflict
errors result in a default value for a conflicted command. For instance, in the example above, the
specified Set Scan Interval (
I) command defaults to the fastest possible scan interval for the number of
defined channels.
Command Interpretation
As commands are received by the unit, they are interpreted in the order in which they are received.
Some commands are immediate, which means they immediately take effect. Other commands are
deferred and have no effect on device operation until the Execute (
X
) command is interpreted.
Immediate & Deferred Commands
An example of an immediate command is the Set Digital Outputs (O) command, which immediately
chooses the specified digital output line. An example of a deferred command is the Set Data Format
(
F
) command, which determines the input and output format used for channel data when the Execute
(
X
) command is interpreted.
As deferred commands are interpreted, their desired effects are recorded in internal temporary registers.
As additional deferred commands are interpreted, their effects are added to these registers, possibly
overwriting earlier effects. Finally, when the Execute (
X
) command is interpreted, the temporary
registers are examined in the execution order described later. If two deferred commands that do not
affect the same function are received before the Execute (
X
) command, they take effect in the execution
order. If a deferred command is sent multiple times within a command line, the last occurrence of the
command will take precedence. Note that a command line is terminated by the Execute (
X
) command.
For example, if the Set Data Format (
F) command line
F1,1 F1,3X
is sent, the data output format
will be as specified by the latter
F1,3X
command. The former
F1,1
command is overridden and never
takes effect.
If an error is detected during command processing, commands are ignored up through and including the
next Execute (
X
) command. Thus, any immediate commands after the error, and all deferred
commands on the same line, are ignored. For example, the command line:
T1,1,0,0 O216,0,25,255 AA T3,7,0,0 K20 X
contains the error
AA
. Only the Set Digital Outputs (O) command
O216,0,25,255
is executed,
because it is an immediate command that occurred before the error. The deferred commands
T1,1,0,0
and
T3,7,0,0
and the immediate command
K20
after the error have no effect.
Deferred commands help reduce the effects of errors and improve synchronization of command
execution. The primary advantage of deferred commands is that they are executed as a group, either all
or none. If any errors occur, deferred commands have no effect and the device is left in a consistent
state instead of a partially modified, inconsistent state.