5 serialinblock(), 6 serialoutblock(), 7 serialinchk() – Campbell Scientific SDM-SIO1 Serial Input/Output Module User Manual
Page 24: 8 serialinrecord(), 9 serialflush(), 10 serial input errors, 2 configuring handshaking and receive only modes, 1 using rts/cts and automatic handshaking, Serialinblock(), Serialoutblock()
SDM-SIO1 Serial Input/Output Module
4.1.5 SerialInBlock()
The SerialBlock() 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-
SIO1's buffer. The SDM-SIO1's buffer operates in a fill and stop mode, and
therefore will not include the most recent data if it gets full.
4.1.6 SerialOutBlock()
No special information. This can also be used to set the general purpose output
line (see Appendix A, Using the Handshaking Lines for General Input/Output).
4.1.7 SerialInChk()
This returns the number of characters that have been received by the SDM-
SIO1 and that are currently held in its buffer (0-2047). In addition it also
allows the program to determine the state of the input handshaking line by
setting bit 16 of the returned number if the port is high. If that port (pin 8) is
not connected then the instruction can be used in the same way as with a
standard port. If the port can be high or you wish to determine the state of the
handshaking line, please refer to Appendix A.1, The Input Pin (Pin 8), for
further details and program examples.
4.1.8 SerialInRecord()
No special information.
4.1.9 SerialFlush()
This command will purge all information in the logger and SDM-SIO1
transmit and receive buffers.
4.1.10 Serial Input Errors
For any of the serial input instructions above, the character ‘?’ will be returned
in place of the expected data whenever a parity, framing or overrun error is
detected. These errors are only flagged for RS-232/RS-485/RS-422 data
coming into the SDM-SIO1. A large number of such characters could indicate
an incorrectly setup protocol configuration using the SerialOpen() instruction,
or one of the wires is loose or incorrectly terminated.
4.2 Configuring Handshaking and Receive Only Modes
4.2.1 Using RTS/CTS and Automatic Handshaking
Handshaking is a method used by RS-232 to insure communications equipment
is free to receive or transmit data. This interface is often called RTS/CTS
(Hardware handshaking) or DTR/DTE.
Automatic handshaking for the SDM-SIO1 is activated through use of the
SerialOpen() instructions BaudRate setting. When the BaudRate value is set to
a negative number the SDM-SIO1 will enable automatic handshaking. It is
18