Campbell Scientific SDM-SIO4 4-Channel Serial I/O Interface User Manual

Page 21

Advertising
background image

Section 3. Understanding How the SDM-SIO4 Handles Data

3-5

vn[ ] Convert ‘n’ ASCII hex pairs into Campbell Scientific floating point

format until the termination character/string between [ ] is seen. ‘n’ can be
1-3. The termination character/string is removed from the buffer.

Vn Searches for hexadecimal value(s) and converts them to Campbell

Scientific floating point format. Terminates when a string between [ ] is
seen. n=1,2,3 number of hexadecimal pairs to convert into value LSByte
first.

wn[ ] Convert ‘n’-byte binary data into Campbell Scientific floating point

format until the termination character/string between [ ] is seen. ‘n’ can be
1-3. The termination character/string is removed from the buffer.

Wn Searches for binary value(s) and converts them to Campbell Scientific

floating point format. Terminates when a string between [ ] is seen. n=1,2,3
number of hexadecimal pairs to convert into value LSByte first.

x

This marks the start of a data set. A data set is a set of converted data

for the datalogger to collect. When this filter type is used the data in the
data set is only available to the datalogger when all parts of the data set
have been converted – see ‘X’, below.

X

This marks the end of a data set. This makes the data converted in the

data set available to the datalogger. This also means that data after this is
available to the datalogger as soon as the SDM-SIO4 has converted each
value. If the end of the data set is at the end of the filter string then this filter
is not required as the end of the filter string is always the end of a data set.

Yn Converts binary value(s) to Campbell Scientific floating point format.

n=1,2,3 number of bytes to convert into value LSByte first.

z

Flush the UART FIFO (serial port hardware buffer) and the Receive

buffer associated with the port that is using this filter type. This does not,
however, clear the converted data buffer.

As an example, take the following sensor output string:

battery 12.65V,current 12mA

The filter string might be:

i[b]n8Fi[c]n8F

Output to the datalogger would be 12.65 and 12 as Campbell Scientific floating
point numbers. This filter string works as follows:

1. i[b] waits for the trigger character ‘b’ of ‘battery’.

2. n8 discards everything up to 12.65V.

3. F converts the number to Campbell Scientific floating point. If a valid

number is not found -99999 is sent to the datalogger.

4. i[c] waits for the trigger character ‘c’ of ‘current’.

5. n8 discards everything up to 12mA.

6. F converts the number to Campbell Scientific floating point. If a number is

not found -99999 is sent to the datalogger.

This filter will repeat the above operations on all incoming values.

Advertising