Table of contents
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
13
12
Communication processor ..................................................................................................................... 529
12.1
Using the RS232 and RS485 communication interfaces...........................................................529
12.2
Biasing and terminating an RS485 network connector..............................................................530
12.3
Point-to-Point (PtP) communication...........................................................................................531
12.3.1 Point-to-Point instructions..........................................................................................................532
12.3.1.1 Common parameters for Point-to-Point instructions..................................................................532
12.3.1.2 PORT_CFG instruction ..............................................................................................................534
12.3.1.3 SEND_CFG instruction ..............................................................................................................535
12.3.1.4 RCV_CFG instruction.................................................................................................................537
12.3.1.5 SEND_PTP instruction...............................................................................................................541
12.3.1.6 RCV_PTP instruction .................................................................................................................544
12.3.1.7 RCV_RST instruction .................................................................................................................546
12.3.1.8 SGN_GET instruction.................................................................................................................547
12.3.1.9 SGN_SET instruction .................................................................................................................548
12.3.2 Configuring the communication ports ........................................................................................549
12.3.2.1 Managing flow control ................................................................................................................550
12.3.3 Configuring the transmit (send) and receive parameters ..........................................................552
12.3.3.1 Configuring transmit (send) parameters ....................................................................................552
12.3.3.2 Configuring receive parameters.................................................................................................553
12.3.4 Programming the PtP communications .....................................................................................560
12.3.4.1 Polling architecture ....................................................................................................................561
12.3.5 Example: Point-to-Point communication....................................................................................562
12.3.5.1 Configuring the communication module ....................................................................................563
12.3.5.2 Programming the STEP 7 program ...........................................................................................565
12.3.5.3 Configuring the terminal emulator..............................................................................................566
12.3.5.4 Running the example program...................................................................................................567
12.4
Universal serial interface (USS) communication .......................................................................567
12.4.1 Requirements for using the USS protocol .................................................................................568
12.4.2 USS_DRV instruction.................................................................................................................570
12.4.3 USS_PORT instruction ..............................................................................................................573
12.4.4 USS_RPM instruction ................................................................................................................574
12.4.5 USS_WPM instruction................................................................................................................575
12.4.6 USS status codes ......................................................................................................................576
12.4.7 General drive setup information.................................................................................................578
12.5
Modbus communication .............................................................................................................581
12.5.1 Overview of Modbus RTU and TCP communication .................................................................581
12.5.2 Modbus TCP ..............................................................................................................................584
12.5.2.1 MB_CLIENT (Modbus TCP).......................................................................................................584
12.5.2.2 MB_SERVER (Modbus TCP).....................................................................................................590
12.5.2.3 MB_SERVER example: Multiple TCP connections ...................................................................595
12.5.2.4 MB_CLIENT example 1: Multiple requests with common TCP connection...............................596
12.5.2.5 MB_CLIENT example 2: Multiple requests with different TCP connections..............................597
12.5.2.6 MB_CLIENT example 3: Output image write request................................................................598
12.5.2.7 MB_CLIENT example 4: Coordinating multiple requests ..........................................................598
12.5.3 Modbus RTU..............................................................................................................................599
12.5.3.1 MB_COMM_LOAD.....................................................................................................................600
12.5.3.2 MB_MASTER.............................................................................................................................603
12.5.3.3 MB_SLAVE ................................................................................................................................608
12.5.3.4 Modbus RTU master example program.....................................................................................615
12.5.3.5 Modbus RTU slave example program .......................................................................................617