Section 5. Programming the Datalogger
5-25
*Table 2 Program
02: 0.0000
Execution Interval (seconds)
*Table 3 Subroutines
End Program
Example CR10X Program using Interrupts
Sensors with fast data output or where very close time stamping is required
would need to be read using the hardware interrupt output from the SDM-SIO4
in combination with an interrupt-driven subroutine in the datalogger (only the
CR10/10X currently support this mode). This output on the SDM-SIO4 pulses
high when there is data available from one of the serial ports.
This program will deal with sensors that send data at random intervals. It uses
the IO line to cause an interrupt to the datalogger program if data is available.
The IO line is always automatically pulsed by the SDM-SIO4 when data is
available – see ‘SDM Port’ in Section 1 for details. This should be
connected to control port 8 for this example.
A typical filter that could be used is as follows:
fltst 200 "t[data]A5xff"
This filter works as follows:
t[data]
– this filter waits for an exact string match before it starts the next filter.
In this case it is waiting for the sensor to send the string ‘data’.
A5
– this filter sets up a 250ms filter time out. This time out should be long
enough for the sensor to transmit all of its data.
x
– this filter marks the start of the data set. In this case the data set is two
floating point numbers.
f
– this filter searches for the first ASCII floating point number to convert.
f
– this filter searches for the second ASCII floating point number to convert.
*Table 1 Program
01: 2
Execution Interval (seconds)
;set control port 8 to i/p so it can be used as an interrupt
1: Set Port(s) (P20)
1:
8999
C8..C5 = input/nc/nc/nc
2:
9999
C4..C1 = nc/nc/nc/nc
;do filter setup only if flag one is clear
2: If Flag/Port (P91)
1:
21
Do if Flag 1 is Low
2:
30
Then Do
Summary of Contents for SDM-SIO4
Page 6: ...SDM SIO4 Table of Contents iv This is a blank page ...
Page 12: ...Section 1 Introduction 1 6 This is a blank page ...
Page 16: ...Section 2 Installation and Hardware Set Up 2 4 This is a blank page ...
Page 26: ...Section 3 Understanding How the SDM SIO4 Handles Data 3 10 This is a blank page ...
Page 32: ...Section 4 Programming the SDM SIO4 4 6 This is a blank page ...
Page 62: ...Section 5 Programming the Datalogger 5 30 This is a blank page ...
Page 76: ...This is a blank page ...
Page 81: ...This is a blank page ...