Installation

The SDM‑SIO2R is an addressable interface; therefore, before use, its SDM address needs to be set by rotating the Address switch using a screwdriver. If there is only one SDM device, the address can be left at the default of 0. (Refer to Mounting if there is more than one SDM device.) After mounting as close to the data logger as possible (to minimize the cable runs), the interface is connected to the data logger SDM and power connections. Refer to Connection and wiring for further details.

Study the documentation of the serial device you want to connect to determine the most appropriate method of connection for the application, such as RS‑232 or RS‑485/RS‑422, half or full duplex mode. RS‑485/RS‑422 is typically recommended for cable runs over 50 ft (15 m), provided the device supports it. Once you've selected the connection type, connect the wires to the relevant SDM‑SIO2R terminals. Make sure a connection is made between the ground connections of the two devices. Use the RG terminal on the SDM‑SIO2R for RS‑485/422 connections.

Some serial sensors are supported by the Campbell Scientific Short Cut program. The SDM‑SIO2R can be used with those programs simply by selecting the relevant serial port number to match the SDM‑SIO2R (defined by the SDM address of the SDM‑SIO2R, see Mounting). Care must be taken when interpreting any wiring instructions generated by Short Cut to account for the differences in wiring a sensor to the SDM‑SIO2R rather than directly to the data logger.

For other sensors or more complex applications, a CRBasic program needs to be written to configure and enable the connection between the two devices.

To write a program, it is first necessary to determine how data will be exchanged. When using the SDM‑SIO2R to collect data from a sensor, there are two options. The data logger requests data and then picks up the data in the response from the sensor (often called polling) or the sensor transmits data “one-way” to the data logger at fixed intervals based upon its internal timer. The latter mode is more common but can lead to problems with synchronizing the sensor measurements with other measurements the data logger is making and can also lead to the occasional missed data value if the sensor clock is running slightly slower than the data logger clock.

The SDM‑SIO2R is implemented in such a way that it looks like a built-in serial port to the user when writing programs in CRBasic. The only difference in operation between the SDM‑SIO2R and a built-in port is that there will be a small delay as the data needs to be transferred from the SDM‑SIO2R to the data logger via the SDM port. That delay is usually only significant if large amounts of data are being read or the data logger program needs to run very fast.

For sending and receiving data, the SerialOpen() instruction is used to specify which serial port, the speed, and mode of operation. The speed is set by the BaudRate parameter in the instruction and the mode (bits, parity, duplex, RS-232 or RS-485) is set by the SerialOpenFormat parameter. Refer to the CRBasic Editor help system for more details of the options. With the correct parameters in the SerialOpen() instruction, the program can be written in almost exactly the same way as using any other serial port with SerialIn(), SerialOut(), and similar instructions. The Programming section of this manual gives details of some of the minor changes needed and some simple program examples.

The SDM‑SIO2R can also be used as an interface to Modbus and DNP3 sensors or networks. The interface is configured by including an extra SerialOpen() instruction at the start of the program. Normal calls to the relevant Modbus or DNP3 instructions can then be used specifying the COM port number relevant to the SDM‑SIO2R.