How can you configure an S7 CP during runtime?
There are application areas in which it is best not to set up the communications connections via the configuration interface (NetPro) of STEP 7, but program-controlled via a specific application. This option is offered by the function block FB55 "IP_CONFIG".
This functionality is only supported by the following SIMATIC CPs:
|CP343-1 Lean||6GK7 343-1CX00-0XE0|
|CP343-1 Lean||6GK7 343-1CX10-0XE0|
|CP343-1 IT||6GK7 343-1GX20-0XE0|
|CP343-1 Advanced||6GK7 343-1GX21-0XE0|
|CP443-1 Advanced||6GK7 443-1EX40-0XE0|
|CP443-1 Advanced||6GK7 443-1EX41-0XE0|
You must have at least STEP 7 V5.2 SP1 to be able to implement SFB55/FB55.
Proceed as follows to configure a CP that is to keep its configuration during runtime:
|1||Open or create a STEP 7 project. Make your hardware configuration.|
|2||Open the Properties of your CP and in the "IP Configuration" tab you select the item "Set IP address in user program".
|3||Load the station. Once the CPU switches to the RUN state you see that the SF LED is still lit on the CP. This is because the CP has not yet received its complete configuration. Only once you have called FB55 "IP_CONFIG" does the CP apply the IP address from the data block and switch to the RUN state.|
|4||In order to add FB55 to your project you select "File -> Open" in the SIMATIC Manager, switch to the "Libraries" tab and there you select "SIMATIC_NET_CP".
|5||Now you select FB55 depending on your controller (300/400) and copy it to the blocks of your CPU.|
|6||Install the configuration DB and call FB55 in your user program.
Attached is a sample configuration DB.
Attachment 1: DB101_e.pdf ( 16 KB )
If the configuration option is not selected (see point no. 2), calling FB55 does not succeed. Provided for such a case in the manual is a specific error message (STATUS) that is also supplied by the S7-300 series CPs.
STATUS = 0x8B10
Error message of the S7-400 CP:
"The K bus connection between CPU and CP is not set up".
The status value in this case is equivalent to status value 0x8B10 for S7-300 described in the manual.
Reason for the differences between S7-300 and S7-400:
The attached download contains the archived STEP 7 project with the functions and data block described above. In the user program FB55 is called with a rising edge at input 0.0 and thus the CP is configured.
Attachment 2: STEP7_Proj.zip ( 269 KB )