6.2.2.3 RS-485 half-duplex wiring example 6.2.2.4 RS-232 wiring example with handshaking 6.2.2.5 RS-232 basic 3-wire example 6.2.2.6 Connecting a 9-way socket to the SDM-SIO2R for RS-232 devices 6.2.3 RS-232 and RS-485 with switched power example 6.3 Programming 6.3.1 CRBasic instructions...
Page 3
6.3.1.1 SerialOpen() 6.3.1.2 SerialClose() 6.3.1.3 SerialIn() 6.3.1.4 SerialOut() 6.3.1.5 SerialInBlock() 6.3.1.6 SerialOutBlock() 6.3.1.7 SerialInChk() 6.3.1.8 SerialInRecord() 6.3.1.9 SerialFlush() 7. Operation 7.1 Configuring handshaking and receive-only modes 7.1.1 Using RTS/CTS and automatic handshaking 7.1.2 RS-485 half-duplex mode 7.1.3 Using the RS-232 link in receive-only mode 7.2 Power conservation 7.3 Schematic 8.
1. Introduction The SDM-SIO2R Serial Input/Output Module is designed to allow expansion of the number of serial ports available on a data logger for communicating with intelligent sensors or driving external displays. It also has built-in power pass-through capabilities. Each SDM-SIO2R provides two separate communication channels and four different switched voltages.
There is a current limiting resistor fitted in the RG line in the SDM-SIO2R, but this will not be adequate in the event of a serious ground fault, for example, the ground references being 240 V apart due to faulty AC wiring.
Page 6
A din rail bus system is used to distribute the pass-through power and communication to the other devices. The SDM-SIO2R can also be used in “talk-through” mode to allow a user to talk, via a terminal program, to a sensor connected to the SDM-SIO2R for test and diagnostic purposes. Please refer to the data logger manual for further details.
This does not affect any other configuration and does not affect transmissions out of the SDM-SIO2R. Miscellaneous information: The SDM-SIO2R does not support auto baud rate detection or use of the serial port for general PakBus® communications. Modbus and DNP3 communications are supported.
Idle current (receive only) 63.5 mA 65.5 mA in receive-only mode Active current (RS-232) 65.5 mA 67.4 mA Active RS-232 command Active RS-485 command (no termination Active current (RS-485) 65.9 mA 67.9 mA resistors) SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
0.7 V Voltage values are DC. It is NOT recommended that the user run their SDM-SIO2R at maximum ratings for extended periods of time. Assuming a worst case 3 kΩ load. It is not recommended that the user allows such low input voltages as there will be an increased chance that external noise may cause errors in the incoming data.
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.
(p. 9)) that is then attached to the backplate of a Campbell Scientific enclosure. Figure 6-1. DIN rail mounting A SDM-SIO2R can be removed from the DIN rail by using a screwdriver to pry on the din rail release bar. See DIN rail release bar (p.
Page 13
Figure 6-2. DIN rail release bar All SDM-SIO2Rs that are connected on the DIN rail will share a common bus. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Page 14
Figure 6-3. Multiple SDM-SIO2Rs sharing a common bus Keep SDM-SIO2Rs apart to maintain separate buses. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Page 15
There can be up to 8 SDM-SIO2Rs on a single SDM bus. Each SDM-SIO2R will need to be set to a unique address before they are powered. The SDM-SIO2R has a single address switch. This sets the address of the first serial port of the module (sensor 1).
Rotary switch position SDM address COMPort number Address F is not available as it is the broadcast address. Setting this address will result in the SDM-SIO2R having an address of 0 rather than F. 6.2 Connection and wiring SDM-SIO2R connections to the data logger are made via the Input connector. Strip wires 7 to 9 mm and twist.
Page 17
Figure 6-5. Input connections SDM-SIO2R connections to serial devices are made via the terminals arranged along the top of the unit. The terminals are spring loaded providing an easy and reliable method of connection. Strip wires 7 to 9 mm and twist. Open the clamp by pushing the orange tab down with the tip of a small flat-blade screwdriver and insert the wire into the round hole.
Page 18
(p. 15). Figure 6-7. Connector release slide bar NOTE: The 12V power ground for the SDM-SIO2R must be common ground with the data logger in order for the C1/C2/C3 communications to work. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Page 19
NOTE: The sensor with the highest current draw should be connected to the SDM-SIO2R that is plugged into power and communications on the Input connector. It is recommended that this is the center SDM-SIO2R in the system. Table 6-2 (p. 16) shows all the input connections on the SDM-SIO2R.
Page 20
Table 6-4 (p. 17) shows all the power pass-through connections on the SDM-SIO2R. Note that there are two power pass-through connectors. One for Sensor 1 and one for Sensor 2. Table 6-4: SDM-SIO2R power pass-through terminal labels and functions Power pass-through...
Page 21
Table 6-6: SDM-SIO2R functional description of sensor connections Case text RS-485 Connection to Description (RS-232 Function Function) RG – RS-485 ground. Connected to G via 100 Ω 1 W resistor. GND - ground for RS- 232 communications RS-232 RTS. RS-485 half duplex non-inverting.
RS-232 for long cables), synchronization of data collection, etc. NOTE: If possible, use screened cable for connecting the SDM-SIO2R to remote sensors or devices. Check the manual of the device for details on where to connect the screen for maximum effectiveness.
6.2.2 Wiring examples for connecting the SDM-SIO2R The exact method of wiring the SDM-SIO2R varies with the type of device it is going to exchange data with. The variables include the type of interface used (RS-232, RS-485, or RS-422), whether handshaking is used, whether the connection is full or half duplex, and whether termination resistors are used (RS-485 and RS-422 only).
Typical wiring for the most common configurations are given as examples in the following subsections. 6.2.2.1 RS-485/RS-422 full-duplex, one-to-one connection example 6.2.2.2 RS-485 full-duplex, multi-drop example SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
As with all RS-485 configurations, the use of termination resistors is optional. They tend not to be required with shorter cable runs and with modern slew-rate-limited driver technology (as used in the SDM-SIO2R). SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
6.2.2.4 RS-232 wiring example with handshaking 6.2.2.5 RS-232 basic 3-wire example 6.2.2.6 Connecting a 9-way socket to the SDM-SIO2R for RS-232 devices This configuration may be used if the device is fitted with a standard 9-way D connector as was commonly fitted to computers for their RS-232 port.
CTS/RD– and RTS/TD+ cannot be used as separate input and output when in RS-485 mode. 6.2.3 RS-232 and RS-485 with switched power example This image shows an example system with one RS-232 sensor and one RS-485 sensor, both using switched power. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
The left digit controls V+; the right digit controls 12V. Sending a 1 for a digit turns the Relay and LED on; sending a 2 for a digit turns the relay and LED off; sending a 0 will not change the relay/LED value. For example: SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
SerialOpenFormat parameter, a program written for a standard serial port will usually work with the SDM-SIO2R. The main difference to be aware of, when trying to write fast running programs, is the extra delay needed to transfer data from the SDM-SIO2R to the data logger (roughly equivalent to transferring data over a serial link at 38 kilobaud).
Page 31
32 to 47 are reserved for use with the SDM-SIO2R. BaudRate BaudRate is used to set up the SDM-SIO2R baud rate as you would with any RS-232 interface. The SDM-SIO2R does not support automatic baud rate recognition. Instead, setting the rate to a negative number sets the automatic flow control system (RTS/CTS).
Page 32
Table 6-7: Communications port parameters RS-232 SerialOpenFormat Parity No. stop bits No. data bits Even None This mode is only supported if there is at least a one-bit delay between characters received by the SDM-SIO2R. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Page 33
None Not used Even None Not used Even None Not used Even None This mode is only supported if there is at least a one-bit delay between characters received by the SDM-SIO2R. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Page 34
None Not used Even None Not used Even None Not used Even None This mode is only supported if there is at least a one-bit delay between characters received by the SDM-SIO2R. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Not used Even None This mode is only supported if there is at least a one-bit delay between characters received by the SDM-SIO2R. 6.3.1.2 SerialClose() This will place the SDM-SIO2R unit into shutdown mode where only SDM communications will operate. This means any data coming into the SDM-SIO2R on the RS-232/RS-485 interface will be lost.
SDM-SIO2R to the data logger in approximately 2.7 ms. Time (in microseconds) = (10 + 1) × (8 × 30) Note that 30 µs per bit is the default data rate for most Campbell Scientific data loggers. It is SDMSpeed() possible to reduce this time and the transfer time by using the instruction.
6.3.1.7 SerialInChk() This returns the number of characters that have been received by the SDM-SIO2R 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 data logger and SDM-SIO2R transmit and receive buffers.
SerialOpen() 27) for more detailed information about these settings. In receive-only mode, the SDM-SIO2R will consume less current than normal but still can receive new information on its RS-232 port. The following example will set the SDM-SIO2R with address 0 into receive-only mode. All normal baud rates and buffer sizes are supported.
If using RS-232 mode, also avoid connecting handshaking lines that are not required to avoid an unnecessary 2 mA drain per line. The SDM-SIO2R will start up with its last set of baud rate and protocol settings. This feature is to protect against brownout conditions where the SDM-SIO2R has reset but the data logger has not.
8.1 Troubleshooting If correctly connected, the SDM-SIO2R normally operates seamlessly. However, there are some common issues people encounter during setup or sometimes after a period of operation. During the setup phase, either no data or corrupt data may be received by the data logger. When receiving data, the character “?”...
Page 41
Where you see some serial activity which is invalid, check the documentation and configuration of both the device the SDM-SIO2R is connected to and the data logger. Also, check the wiring carefully. In the case of RS-485/RS-422, there is also a big risk of confusion being caused by there being several different ways of labeling the transmit and receive lines.
8.2.1 Upgrading the operating system In the unlikely event that the operating system of the SDM-SIO2R needs to be upgraded, this can be achieved by connecting it to a computer and using the Campbell Scientific Device Configuration Utility to load the operating system. (This program can be downloaded free of charge from www.campbellsci.com/downloads...
If this error is seen, contact Campbell Scientific to obtain a copy of the latest operating system and load it into the SDM-SIO2R using the preceding procedure. If this does not correct the fault, the unit may be faulty and will need to be returned to the factory for repair.
Page 44
SDMSpeed (30) 'Fix the speed Ver_Value = "" Sig_Value = "" Scan(1,Sec,0,0) 'Use the generic SDM instruction to get extra info from the SDM-SIO2R 'Ask for the operating system version Src = CHR(1) SDMGeneric(Ver_Value,SDM_Address,cmd,bytes_out,Src,Ver_values_in,bytes_val, _ big_endian,delay_usec) 'Read signature Src = CHR(2) SDMGeneric(Sig_Value,SDM_Address,cmd,bytes_out,Src,Sig_values_in, _ bytes_val,big_endian,delay_usec)
Bit 16 of a value returned to the data logger using the instruction reports whether the input is logic high or low. The following example shows how to call the instruction with the required parameters. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
To set the output pin (RTS) you must use the SerialOutBlock() instruction. The spare I/O lines are RS-232 lines, NOT logic lines. This means that the output line voltage is –12V and +12V (approximately), not 0 and 5V. SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Page 47
SerialOutBlock(32, 0, 0) 'This will set the spare output pin low The preceding two example lines of code will set the output pin on the SDM-SIO2R high then low respectively on the SDM-SIO2R device set to address 0 on its rotary switch.
There follows two simple examples of how to write programs in CRBasic to send and receive data using the SDM-SIO2R. These programs are not extensive and are fundamentally no different to those written for use when reading data from a standard data logger serial port.
'----------------------------------------------------------------------- ' Example use of the SDM-SIO2R. ' This example shows how to open a serial port using an SDM-SIO2R. ' A prompt is sent from the data logger to the sensor and it then waits for a ' response before reading the data.
'This example shows how to open the RS-485 serial port using an SDM-SIO2R. 'Data is sent from the data logger to the sensor. 'The program then sits in a loop until the SDM-SIO2R reports it has data 'available 'The data logger then retrieves the data and places it into a string...
EndProg B.3 Example using switched relay power CRBasic Example 5: Switched relay mode example 'CR1000X Program showing how to use SDM-SIO2R. This program will transmit/receive serial data and 'This program will also control the switched relay power using SDM-Generic SequentialMode...
Page 52
SDMGeneric(dest, SDM_addr1, cmd_byte, num_vals_out, hexVar1, num_vals_in, bytes_per_value, big_endian, delay_byte) ElseIf counter Then hexVar1 &H10 'Sensor2: V+ ON SDMGeneric(dest, SDM_addr1, cmd_byte, num_vals_out, hexVar1, num_vals_in, bytes_per_value, big_endian, delay_byte) ElseIf counter Then hexVar1 &H20 'Sensor2: V+ OFF SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Page 53
'Sensor1: 12V ON, Sensor1: V+ ON hexVar1 &H11 'Sensor2: 12V ON, Sensor2: V+ ON SDMGeneric(dest, SDM_addr0, cmd_byte, num_vals_out, hexVar0, num_vals_in, bytes_per_value, big_endian, delay_byte) SDMGeneric(dest, SDM_addr1, cmd_byte, num_vals_out, hexVar1, num_vals_in, bytes_per_value, big_endian, delay_byte) counter EndIf counter NextScan EndProg SDM-SIO2R Serial Input/Output Module with Switched Sensor Power...
Page 54
See Product Details on the Ordering Information pages at www.campbellsci.com . Other manufacturer's products, that are resold by Campbell Scientific, are warranted only to the limits extended by the original manufacturer. Refer to www.campbellsci.com/terms#warranty for more information.
Page 55
To obtain a Returned Materials Authorization or Repair Reference number, contact your CAMPBELL SCIENTIFIC regional office. Please write the issued number clearly on the outside of the shipping container and ship as directed. For all returns, the customer must provide a “Statement of Product Cleanliness and Decontamination”...
Page 56
Do not recharge, disassemble, heat above 100 °C (212 °F), solder directly to the cell, incinerate, or expose contents to water. Dispose of spent batteries properly. WHILE EVERY ATTEMPT IS MADE TO EMBODY THE HIGHEST DEGREE OF SAFETY IN ALL CAMPBELL SCIENTIFIC PRODUCTS, THE CUSTOMER ASSUMES ALL RISK FROM ANY INJURY RESULTING FROM IMPROPER INSTALLATION, USE, OR MAINTENANCE OF TRIPODS, TOWERS, OR...
Page 57
Campbell Scientific Regional Offices Australia France Thailand Location: Garbutt, QLD Australia Location: Vincennes, France Location: Bangkok, Thailand Phone: 61.7.4401.7700 Phone: 0033.0.1.56.45.15.20 Phone: 66.2.719.3399 Email: info@campbellsci.com.au Email: info@campbellsci.fr Email: info@campbellsci.asia Website: www.campbellsci.com.au Website: www.campbellsci.fr Website: www.campbellsci.asia Brazil Germany Location: São Paulo, SP Brazil...
Need help?
Do you have a question about the SDM-SIO2R and is the answer not in the manual?
Questions and answers