SDM-SIO1A and SDM-SIO4A Serial Input/Output Modules
20
6.3.1.5 SerialInBlock
The
SerialInBlock()
instruction can be used as described in the datalogger
manual. However, if using the option to capture only the most recent data,
make sure the instruction is called often enough to avoid filling up the
SDM-SIO1A buffer. The SDM-SIO1A buffer operates in fill and stop mode,
and, therefore, will not include the most recent data if it gets full.
6.3.1.6 SerialOutBlock
No special information. Can also be used to set the general purpose output line.
Using the Handshaking Lines for General Input/Output
(p. A-1)
for more information.
6.3.1.7 SerialInChk
This returns the number of characters that have been received by the
SDM-SIO1A and that are currently held in its buffer (0-6143).
6.3.1.8 SerialInRecord
No special information.
6.3.1.9 SerialFlush
This instruction will purge all information in the datalogger and SDM-SIO1A
transmit and receive buffers.
6.3.2 Example Datalogger Programs
There follows two simple examples of how to write programs in CRBasic to
send and receive data using the SDM-SIO1A. These programs are not
extensive and are fundamentally no different to those written for use when
reading data from a standard datalogger serial port.
The program code is the same for all dataloggers that support the SDM-SIO1A.
The exact program to be used will vary with the serial device being used.
Unfortunately, the number of possible variations of reading different sensors is
almost infinite. If you are struggling to write code, please contact Campbell
Scientific who may already have experience with the sensor and may be able to
offer advice on how to deal with it.