Table of contents
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
7
5.6.4
Assigning Internet Protocol (IP) addresses ...............................................................................123
5.6.4.1 Assigning IP addresses to programming and network devices.................................................123
5.6.4.2 Checking the IP address of your programming device..............................................................125
5.6.4.3 Assigning an IP address to a CPU online..................................................................................125
5.6.4.4 Configuring an IP address for a CPU in your project.................................................................127
5.6.5
Testing the PROFINET network ................................................................................................129
5.6.6
Locating the Ethernet (MAC) address on the CPU....................................................................130
5.6.7
Configuring Network Time Protocol synchronization.................................................................131
5.6.8
PROFINET device start-up time, naming, and address assignment.........................................132
6
Programming concepts.......................................................................................................................... 135
6.1
Guidelines for designing a PLC system.....................................................................................135
6.2
Structuring your user program ...................................................................................................136
6.3
Using blocks to structure your program .....................................................................................138
6.3.1
Organization block (OB).............................................................................................................138
6.3.2
Function (FC) .............................................................................................................................140
6.3.3
Function block (FB)....................................................................................................................140
6.3.4
Data block (DB)..........................................................................................................................141
6.4
Understanding data consistency................................................................................................143
6.5
Programming language..............................................................................................................144
6.5.1
Ladder logic (LAD) .....................................................................................................................144
6.5.2
Function Block Diagram (FBD) ..................................................................................................145
6.5.3
SCL ............................................................................................................................................145
6.5.4
EN and ENO for LAD, FBD and SCL.........................................................................................152
6.6
Protection...................................................................................................................................153
6.6.1
Access protection for the CPU...................................................................................................153
6.6.2
Know-how protection .................................................................................................................154
6.6.3
Copy protection..........................................................................................................................156
6.7
Downloading the elements of your program..............................................................................157
6.8
Uploading from the CPU ............................................................................................................157
6.8.1
Copying elements of the project ................................................................................................157
6.8.2
Using the compare function .......................................................................................................158
6.9
Debugging and testing the program ..........................................................................................159
6.9.1
Monitor and modify data in the CPU..........................................................................................159
6.9.2
Watch tables and force tables....................................................................................................159
6.9.3
Cross reference to show usage .................................................................................................160
6.9.4
Call structure to examine the calling hierarchy..........................................................................161
7
Basic instructions................................................................................................................................... 163
7.1
Bit logic.......................................................................................................................................163
7.1.1
Bit logic contacts and coils.........................................................................................................163
7.1.2
Set and reset instructions ..........................................................................................................166
7.1.3
Positive and negative edge instructions ....................................................................................168
7.2
Timers ........................................................................................................................................170
7.3
Counters.....................................................................................................................................178
7.4
Compare ....................................................................................................................................183
7.4.1
Compare ....................................................................................................................................183