Appendix A API Commands
ChartScan User’s Manual A-3

Fixed Formats

Any Query (?)command or 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. They are not, however, required when
entering the command.

Conflict Errors

Some combinations of commands and parameters can be sent to the unit that are out of range for a
particular configuration or inconsistent with other commands. For instance, specifying a Scan Interval
(I) command to 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 the ERROR indicator LED on the scanning unit and returns an E4 when queried
with the Error Query (E?) command. Some conflict errors result in a default value for a conflicted
command. For instance, in the example above, the scan interval 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

The immediate and deferred commands applicable to ChartScan/1400 are listed in a table on the
following page.
An example of an immediate command is Set Digital Outputs (On), which immediately chooses the
digital output line which is being referred to.
An example of a deferred command is Set Data Format (F), which determines the input and output
format used for channel data when X 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
X is interpreted, the temporary registers are examined in the execution order described below. 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 described below. 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 X. For example, if F1,1 F1,3X is sent, the data output format will
be as specified by the F1,3X command. The F1,1 command is overridden and never takes effect.
If an error is detected during command processing, co mmands are ignored up through and including the
next execute command. Thus, any immediate commands after the error, (and all deferred commands)
are ignored. For example, the command line T1,1,0,0O216,0,25, 255AAT3,7 K20 X containing
the error AA only executes the O0, 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.