R40 MODEM EXPANDER MODULE p 5
SIOX Address Setup
When using the SIOX bus, the R40 can be used as a Master, calling other units
on the SIOX bus, or as a Slave, capable of setting up or answering to a GSM
call and linking to the bus after connection. As a Slave, R40 must have a
specified address, which is set in the internal EEPROM in the module. Slave
mode is also used for setting up the module for a specific application. At
delivery, the address is set to 01. It is best changed by connecting the R40 to
a SIOX bus and using the R40SETUP.dff program. This is loaded from the
www.siox.com.
The same program allows all other relevant settings.
A special feature is added to help recover "lost" modules, i.e. when an
unknown bit rate and/or address is selected or the PLC runs a program that
erroneously alters parameters affecting the communication. To recover such
a module, a pushbutton is available on the PCB. Carry out the following steps:
1. Press the button close to the modem and apply power. The module will now
communicate at 4800 bits/s using address 63 with the PLC, Links and any
options disabled.
2. Check and reconfigure the EEPROM of the module for proper operation.
3. Restart the module without pressing the button.
RS485 Communication
R40 features one two-wire RS485 port available at a 3-pole screw terminal in
the module. The port is opto isolated from the rest of the module, and the third
terminal is intended for the cable screen. The R40 includes a 220
Ω
termination
resistor and and two 5 k
Ω
to float an unconnected bus to an idle (1) state.
This serial port, as well as the other two below, permit asynchronous communi-
cations at 2400 to 19200 bps using 7 or 8 data bits, even/odd/no parity bit and
one or two stop bits. 19200 bps may generate problems due to the limited
length of the internal buffers and is not recommended. The format is set in
parameter 0/5 (and 0/6/0/7for the RS232 ports), as described in page 13. To
permit handling in a similar way as the RS232 ports, a virtual CTS signal is
provided for this port in the same parameter.
RS485 Soft Handshaking
To stop the receive buffer or the device at the other end of the RS485 bus from
overrunning, special characters in the text can be reserved for Soft Hand-
shaking, often the two ASCII characters DC1 and DC3, called X-ON and X-
OFF. The RS485 port handles this protocol if the reserved characters are set
in parameter 0/3. 0/0/0/0/ means no soft handshaking. When the port or the device
R40 MODEM EXPANDER MODULE p 6
face an overrun risk, an X-OFF character is sent. This is not buffered. When
more space is available, an X-ON is sent. Correspondingly, R40 will stop trans-
mitting if the X-OFF character is received and start again at an X-ON.
RS232 Communication
R40 features two standard RS232 ports for connection to a PC, a printer or
similar via one of the 5-pole screw terminals in the module. The ports are indi-
vidually opto isolated from the rest of the module. The signals are described
with R40 used as a DCE, ready for connection to a PC. Typical interface cables
are shown below:
Terminal
Function
9p socket
25p plug
to a PC
to a modem
Signal Ground
5
7
RD
Transmit from R40
2
2 (TD)
TD
Receive to R40
3
3 (RD)
CTS
Output from R40 (=buffer free)
8
4 (RTS)
RTS
Input to R40, with 10 k
Ω
pullup
7
5 (CTS)
RTS and CTS are used for hardware handshaking and can be checked in par-
ameters 0/6 and 0/7. The bit rate, parity and number of data and stop bits can
be set up in here too, see page 13.
Ports’ Multiplexing
Characters received from either port are stored in a 128 character ring buffer,
where they can be linked to the modem or fetched, either automatically by the
firmware in R40 or by an application specific PLC program. Correspondingly
there exists a 128 character buffer which empties into the transmit pin. This
buffer is filled by a link from the modem, firmware or by a PLC program.
Since the three possible serial ports use the same buffers, messages must use
the intended serial port. For this purpose, the first port to send a character to
the receive buffer will deactivate the CTS lines of the other two, preventing
them from transmitting. The yellow LED for the receiving port will light. Any data
intended for the ports is transmitted on the active port.
20 seconds after last character in either direction, the priority is cleared and all
channels are allowed to communicate. A PLC program in R40 can reactivate
the CTS lines in advance if necessary.
When text is stored in the transmit buffer without any recent priority, two bits in
parameter 0/4 are checked to define 1, 2 or 3 as the preferred port to send the
message. When such a message is received from the modem, it can be