You are on page 1of 4

13.3.5.

2 RS422 and RS485 operating modes

Configuring the RS422


For RS422 mode, there are three operating modes depending on your network configuration.
Select one of these operating modes based on the devices in your network. The different
selections for Receive line initial state reference the cases shown below for more details.
Full duplex (RS422) four wire mode (point-to-point connection): select this option when
there are two devices on your network. In the Receive line initial state:
– Select none when you supply the bias and termination (Case 3).
– Select forward bias to use internal bias and termination (Case 2).
– Select reverse bias to use internal bias and termination, and enable cable break
detection for both devices (Case 1).
Full duplex (RS422) four wire mode (multipoint master): select this option for the master
device when you have a network with one master and multiple slaves. In the Receive line
initial state:
– Select none when you supply the bias and termination (Case 3).
– Select forward bias to use internal bias and termination (Case 2).
– Cable break detection is not possible in this mode.
Full duplex (RS422) four wire mode (multipoint slave): Select this option for all the slave
devices when you have a network with one master and multiple slaves. In the Receive
line initial state:
– Select none when you supply the bias and termination (Case 3).
– Select forward bias to use internal bias and termination (Case 2).
– Select reverse bias to use internal bias and termination, and enable cable break
detection for the slaves (Case 1).

S7-1200 Programmable controller


System Manual, 01/2015, A5E02486680-AH 905
Case 1: RS422 with cable break detection
Mode of operation: RS422
Receive line initial state: Reverse bias (biased with R(A) > R(B) > 0V)
Cable break: Cable break detection enabled (transmitter always active)

Case 2: RS422 No cable break detection, forward bias


Mode of operation: RS422
Receive line initial state: Forward bias (biased with R(B) > R(A) > 0 V)
Cable break: No cable break detection (transmitter enabled only while transmitting)

S7-1200 Programmable controller


906 System Manual, 01/2015, A5E02486680-AH
Case 3: RS422: No cable break detection, no bias
Mode of operation: RS422
Receive line initial state: no bias
Cable break: No cable break detection (transmitter enabled only while transmitting)
Bias and termination are added by the user at the end nodes of the network.

Configuring the RS485


For RS485 mode, there is only one operating mode. The different selections for Receive line
initial state reference the cases shown below for more details.
Half duplex (RS485) two wire mode. In the Receive line initial state:
– Select none when you supply the bias and termination (Case 5).
– Select forward bias to use internal bias and termination (Case 4).

Case 4: RS485: Forward bias


Mode of operation: RS485
Receive line initial state: Forward bias (biased with R(B) > R(A) > 0 V)

S7-1200 Programmable controller


System Manual, 01/2015, A5E02486680-AH 907
Case 5: RS485: No bias (external bias)
Mode of operation: RS485
Receive line initial state: No bias (external bias required)

13.3.5.3 Programming the STEP 7 program


The example program uses a global data block for the communication buffer, a RCV_PTP
instruction (Page 987) to receive data from the terminal emulator, and a SEND_PTP
instruction (Page 985) to echo the buffer back to the terminal emulator. To program the
example, add the data block configuration and Main program block OB 1 as described
below.
Global data block "Comm_Buffer": Create a global data block (DB) and name it
"Comm_Buffer". Create one value in the data block called "buffer" with a data type of "array
[0 .. 99] of byte".
Network 1: Enable the RCV_PTP instruction whenever SEND_PTP is not active. Tag_8 at
MW20.0 indicates when sending is complete in Network 4, and when the communication
module is thus ready to receive a message.

Network 2: Use the NDR value (Tag_1 at M0.0) set by the RCV_PTP instruction to make a
copy of the number of bytes received and to set a flag (Tag_8 at M20.0) to trigger the
SEND_PTP instruction.

S7-1200 Programmable controller


908 System Manual, 01/2015, A5E02486680-AH

You might also like