Table of contents
S7-200 SMART
10 System Manual, 09/2015, A5E03822230-AC
8.6 RS485 .................................................................................................................................. 395
8.6.1 PPI protocol .......................................................................................................................... 395
8.6.2 Baud rate and network address ........................................................................................... 396
8.6.2.1 Definition of baud rate and network address ....................................................................... 396
8.6.2.2 Setting the baud rate and network address for the S7-200 SMART CPU ........................... 397
8.6.3 Sample RS485 network configurations ................................................................................ 399
8.6.3.1 Single-master PPI networks ................................................................................................. 399
8.6.3.2 Multi-master and multi-slave PPI networks .......................................................................... 399
8.6.4 Building your network ........................................................................................................... 400
8.6.4.1 General guidelines ............................................................................................................... 400
8.6.4.2 Determining the distances, transmission rates, and cable lengths for your network ........... 401
8.6.4.3 Repeaters on the network .................................................................................................... 401
8.6.4.4 Selection of the network cable ............................................................................................. 402
8.6.4.5 Connector pin assignments ................................................................................................. 402
8.6.4.6 Biasing and terminating the network cable .......................................................................... 403
8.6.4.7 Biasing and terminating the CM01 signal board .................................................................. 405
8.6.4.8 Using HMI devices on your RS485 network ........................................................................ 405
8.6.5 Freeport mode ...................................................................................................................... 406
8.6.5.1 Creating user-defined protocols with Freeport mode ........................................................... 406
8.6.5.2 Using the RS232/PPI Multi-Master cable and Freeport mode with RS232 devices ............ 409
8.7 RS232 .................................................................................................................................. 410
9 Libraries ................................................................................................................................................. 411
9.1 Creating a user-defined library of instructions ..................................................................... 411
9.2 USS library instructions ........................................................................................................ 413
9.2.1 USS communication overview ............................................................................................. 413
9.2.1.1 USS protocol overview ......................................................................................................... 413
9.2.1.2 Requirements for using the USS protocol ........................................................................... 414
9.2.1.3 Calculating the time required for communicating with the drive .......................................... 415
9.2.2 USS program instructions .................................................................................................... 416
9.2.2.1 Using the USS protocol instructions .................................................................................... 416
9.2.2.2 USS_INIT instruction ............................................................................................................ 417
9.2.2.3 USS_CTRL instruction ......................................................................................................... 419
9.2.2.4 USS_RPM_x instruction ....................................................................................................... 422
9.2.2.5 USS_WPM_x instruction ...................................................................................................... 425
9.2.2.6 USS protocol execution error codes .................................................................................... 428
9.2.2.7 USS protocol example program ........................................................................................... 429
9.3 Modbus library instructions .................................................................................................. 431
9.3.1 Modbus communication overview ........................................................................................ 431
9.3.1.1 Modbus library features ....................................................................................................... 431
9.3.1.2 Initialization and execution time for Modbus protocol .......................................................... 433
9.3.1.3 Modbus addressing .............................................................................................................. 434
9.3.2 Modbus RTU master ............................................................................................................ 436
9.3.2.1 Using the Modbus master instructions ................................................................................. 436
9.3.2.2 MBUS_CTRL instruction (initialize master) .......................................................................... 437
9.3.2.3 MBUS_MSG instruction ....................................................................................................... 438
9.3.2.4 Modbus master execution error codes ................................................................................ 442
9.3.3 Modbus RTU slave .............................................................................................................. 443
9.3.3.1 Using the Modbus slave instructions ................................................................................... 443
9.3.3.2 MBUS_INIT instruction (initialize slave) ............................................................................... 445
9.3.3.3 MBUS_SLAVE instruction .................................................................................................... 446