How can you reconfigure the PROFINET interface with the program control instructions of the S7-1200?
From CPU firmware V2.0 STEP 7 (TIA-Portal) provides for the SIMATIC S7-1200 the T_CONFIG instruction for programmed-controlled configuration of the integrated PROFINET interface of the CPU.
You can make the following settings of the interface configuration:
- IP parameters: IP address, subnet mask, router address
- PROFINET IO device name
The configuration data is stored in the "Conf_Data" data type structure.
You create the "Conf_Data" data type structure as PLC data type, for example.
It consists of the system-specific data types:
The following points are to be observed for correct functioning of the T_CONFIG instruction:
|1||In the CPU properties, under "Ethernet address" you select the setting you want to change.|
For the following setting to be changed
you must select the option "... using a different method".
|2||In addition, the "Mode" parameter in the address data structure IF_CONF_v4 or in the data structure for the PROFINET name IF_CONF_NOS must have the value 1 (= permanent validity of the configuration data).|
Depending on whether you want to change only the interface addresses or also the PROFINET device names, you must set the value of the "SubfieldCount" parameter of the header data type IF_CONF_Header to "1" or "2" (= total number of subfields in the structure) (see Fig. 02).
|3||You enter the addresses to be changed as "Array of Bytes" in each case in the data type IP_V4 for IP address, subnet mask and router address.
|4||You transfer the PROFINET name to be changed as "Array of Bytes" character-by-character at the NOS parameter.|
The rules for assigning PROFINET names apply (like, for example, restriction to a maximum of 240 characters of lowercase letters, numbers, hyphens,
The PROFINET name may be shorter than 240 bytes but not less than 2 bytes.
In this case you must change the "Length" variable accordingly through the calculation "Length of PROFINET name + 6".
Note on security
The functions and solutions described in this article confine themselves predominantly to the realization of the automation task. Furthermore, please take into account that corresponding protective measures have to be taken in the context of Industrial Security when connecting your equipment to other parts of the plant, the enterprise network or the internet. More information is available in Entry ID: 50203404.
The following sample project is available to learn about the T_CONFIG instruction.
It contains the change of the PROFINET interface configuration using the operator panel KTP 600 Basic PN.
When the T_CONFIG instruction is enabled, the HMI simultaneously establishes the communication to the newly configured PROFINET interface of the controller through the "Change connection" event.
Since the KTP 600 Basic PNdoes not support Classless Inter-Domain Routing (CIDR), the last octet of the IP address can be changed only within a class C network.
The KTP 600 Basic PN can also be simulated in STEP 7 V11 without hardware.
The IP addresses of the project are as follows:
- Controller: 192.168.0.1 (configurable to 192.168.0.200)
- HMI: 192.168.0.201
The user interface of the KTP 600 Basic PN consists of the following elements:
- IP string: Transformed IP address as character string for the "Change connection" event
- IP address: IP address to be newly configured (only the last octet can be edited)
- Subnet mask: new subnet mask(cannot be edited)
- Router address: new router address (cannot be edited)
- PN name: new PROFINET device name
- REQ: execution of the T_CONFIG instruction as well as "Change connection"
- PN name: switching on/off of the change of the PROFINET device name
- Display of the last system message of the HMI
To be sure, in STEP 7 V11 you can check the IP assignment by updating the accessible nodes and check the PROFINET device name using the "Assign name" function in the "Online & Diagnostics" mode.
The download includes the "S7-1200_T_CONFIG.zip" project.
Copy the "S7-1200_T_CONFIG.zip" file into a separate directory and then start the file with a double-click. After unpacking the project data you can then use STEP 7 V11 SP2 Update 5 to open and process the project.
S7-1200_T_CONFIG.zip ( 2768 KB )
Detailed information on the topic of T_CONFIG is available in the S7-1200 Automation System Manual (Entry ID 36932465) and in the System Manual for STEP 7 Basic V11.0 SP2 (Entry ID 57199536).
The screens and downloads in this FAQ response were created with STEP 7 V11 SP2 Update 5.