2 command 1: poll of available data – Campbell Scientific SDM-SIO4 4-Channel Serial I/O Interface User Manual

Page 35

Advertising
background image

Section 5. Programming the Datalogger

5-3

The delay required in the program can either be forced using
Instruction P22, or by using the time to execute other
measurement or processing instructions.

5.2.1 Understanding Parameter Options and Returned Values

In the following examples, ‘x’ indicates a single digit from 0 to 9.

When the command requires or returns values, each digit, or combination of
digits, can signify either a value, flag or setting.

Using Command 5 as an example:

Number of watch dog resets
| | Number of invalid commands executed
| | | Lithium battery level
| | | |
x x x x

The first value returned by Command 5 indicates:

• Actual number of watch dog resets (two digits 00 to 99) – a value.

• Number of invalid commands executed (single digit 0 to 9) – a value.

• Level (state) of the lithium battery (0=low, 1=good) – a flag.

If the value returned was, for example, 1281, then it would have the following
meaning:

12 watch dog resets
8 invalid commands
1 battery level good

The second value returned shows whether or not data is available from a
specific port. A non-zero digit indicates that data is available, whereas a zero
signifies that no data is available.

Command 5 is explained in detail later.

When a command parameter requires values to be entered (e.g.
Command 1026), it is a good idea to always enter all four digits.
Only trailing zeros are significant to the SDM-SIO4, and so
entering 0001 or 1 would be identical. However, if the first
parameter needs to be 1, you must enter 1000. The habit of
always entering all four values helps to minimize input errors.

5.2.2 Command 1: Poll of Available Data

This command has no additional options after the command. The SDM-SIO4
returns one Campbell Scientific floating point number to indicate if data is
available as below:

NOTE

NOTE

NOTE

Advertising