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

Page 49

Advertising
background image

Section 5. Programming the Datalogger

5-17

6: End (P95)

;get two floating point numbers into locations 1 and 2.

7: SDM-SIO4 (P113)

1:

1

Reps

2:

0

Address

3:

1

Send/Receive Port 1

4:

4

Command

5:

0

1st Parameters

6:

0

2nd Parameters

7:

2

Values per Rep

8:

1

Loc [ Number ]

9:

1.0

Mult

10: 0.0

Offset

*Table 2 Program

02: 0.0000

Execution Interval (seconds)

*Table 3 Subroutines

End Program

The normal configuration would include setting the speed and serial data
format by calling the datalogger instruction with command 2049 and the
relevant parameters.

For the majority of sensor applications where data is returned in only one type
of format to the SDM-SIO4, the receive data format filters can also be defined
once only by using command 2054. Similarly, some sensors may also require
set-up strings to be sent once; these actions can also be placed in the same
configuration block.

There are two general methods of obtaining data from an intelligent RS232
device, depending on the sensor type, as indicated below:

5.3.1 Sensors Where the Datalogger Can Request Data by

Sending a Prompt or Using a Handshaking Line

For these sensors the measurement would consist of three phases:

1. For software-controlled sensors, use the datalogger instruction to send out a

command string (to request data), using commands 0320, 1024, 1025 or
2304. (Command 2304 also allows you to set up the receive filter to match
the expected data; this instruction is useful when several different types of
data are being requested from the sensor, i.e. a one-off set-up of the receive
filter with command 2054, is not appropriate.) For hardware-controlled
sensors, use command 1027 to change the state of the handshaking lines.

2. The datalogger waits for a period long enough for the SDM-SIO4 to process

the set-up data (minimum delay), plus time for the data to be transmitted out
of the serial port, plus the time for the sensor to respond and the data string
to be transmitted back to the SDM-SIO4. The delay can either be instigated

Advertising