
Table of contents
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02 7
6.2 Extended instructions.................................................................................................................132
6.2.1 Common error parameters for extended instructions ................................................................132
6.2.2 Clock and calendar instructions.................................................................................................132
6.2.3 String and character instructions ...............................................................................................136
6.2.3.1 String data overview ..................................................................................................................136
6.2.3.2 String conversion instructions....................................................................................................136
6.2.3.3 String operation instructions ......................................................................................................144
6.2.4 Program control instructions ......................................................................................................150
6.2.4.1 Reset scan cycle watchdog instruction......................................................................................150
6.2.4.2 Stop scan cycle instruction ........................................................................................................151
6.2.4.3 Get Error instructions .................................................................................................................151
6.2.5 Communications instructions .....................................................................................................154
6.2.5.1 Open Ethernet Communication..................................................................................................154
6.2.5.2 Point-to-Point instructions..........................................................................................................167
6.2.6 Interrupt instructions ..................................................................................................................167
6.2.6.1 Attach and detach instructions...................................................................................................167
6.2.6.2 Start and cancel time delay interrupt instructions......................................................................170
6.2.6.3 Disable and Enable alarm interrupt instructions ........................................................................172
6.2.7 PID control .................................................................................................................................172
6.2.8 Motion control instructions .........................................................................................................173
6.2.9 Pulse instruction.........................................................................................................................174
6.2.9.1 CTRL_PWM instruction..............................................................................................................174
6.3 Global library instructions...........................................................................................................177
6.3.1 USS............................................................................................................................................177
6.3.1.1 Requirements for using the USS protocol .................................................................................177
6.3.1.2 USS_DRV instruction.................................................................................................................180
6.3.1.3 USS_PORT instruction ..............................................................................................................182
6.3.1.4 USS_RPM instruction ................................................................................................................183
6.3.1.5 USS_WPM instruction................................................................................................................184
6.3.1.6 USS status codes ......................................................................................................................186
6.3.2 MODBUS ...................................................................................................................................187
6.3.2.1 MB_COMM_LOAD.....................................................................................................................187
6.3.2.2 MB_MASTER.............................................................................................................................189
6.3.2.3 MB_SLAVE ................................................................................................................................199
7 PROFINET ............................................................................................................................................ 209
7.1 Communication with a programming device..............................................................................210
7.1.1 Establishing the hardware communications connection............................................................211
7.1.2 Configuring the devices .............................................................................................................211
7.1.3 Assigning Internet Protocol (IP) addresses ...............................................................................212
7.1.3.1 Assigning IP addresses to programming and network devices.................................................212
7.1.3.2 Assigning an IP address online..................................................................................................214
7.1.3.3 Configuring an IP address in your project..................................................................................217
7.1.4 Testing the PROFINET network ................................................................................................219
7.2 HMI-to-PLC communication.......................................................................................................221
7.2.1 Configuring the logical network connections between an HMI and a CPU ...............................222
7.3 PLC-to-PLC communication ......................................................................................................223
7.3.1 Configuring the logical network connections between two CPUs..............................................224
7.3.2 Configuring transmit (send) and receive parameters.................................................................225
7.3.2.1 Configuring the TSEND_C instruction transmit (send) parameters...........................................225
7.3.2.2 Configuring the TRCV_C instruction receive parameters..........................................................229