beautypg.com

Programming the datalogger, 1 serialopen(), Used with the sdm-sio1 – Campbell Scientific SDM-SIO1 Serial Input/Output Module User Manual

Page 20: Serialopen()

background image

SDM-SIO1 Serial Input/Output Module

sends data one-way to the datalogger, run the SDM-SIO1 in “receive only
mode” as this does not turn on the output drivers.

If using RS-232 mode avoid connecting handshaking lines that are not
required. This eliminates 2 mA drain per line for unused lines.

4. Programming the Datalogger

The normal serial port instructions such as SerialOpen() and SerialIn() are
used with the SDM-SIO1. A program written for a standard serial port will
usually work with the SDM-SIO1, as long as the timing of the measurements is
not very critical.

4.1 Special Information about the Serial I/O() CRBasic

Instructions when used with the SDM-SIO1

The following section gives more information about the CRBasic programming
language and how the serial instructions are to be used with the SDM-SIO1.
This section assumes the user has knowledge of the CRBasic programming
language. If not then please contact Campbell Scientific for further assistance.
Only the parameters that need special explanation or where their functionality
has changed are listed below. Other parameters don’t need changing.. Please
refer to the datalogger manual and/or the CRBasic help system for more
guidance.

4.1.1 SerialOpen()

All internal buffers in the SDM-SIO1 will be flushed when this command is
called resulting in the loss of any data that might have been in them at that
point in time.

COMPort parameter

The COMPort numbers are defined in the Address configuration section (see
TABLE 3-1). Comport numbers in the range of 32 to 47 are reserved for use
with the SDM-SIO1.

BaudRate parameter

Baud rate is used to set the SDM-SIO1s baud rate for the RS-232 interface.
The SDM-SIO1 does not support automatic baud rate recognition.

Setting the rate to a negative number sets the automatic flow control system
(RTS/CTS). This system is discussed in greater detail elsewhere in the
document.

SerialOpenFormat parameter

This parameter defines data format, normal RS-232, listen only RS-232, full or
half-duplex, and RS-485 modes as defined in the tables below.

14