Back to top
Setting Up the Siemens S7-1200 PLC and PDMM for Profinet Fieldbus Communication (PDMM as the Slave)
KAS (PDMM) as a Profinet Slave - Setup for Siemens S7-1200 PLC
Using KAS IDE Version: 2. 12 Build 2, 12, 0, 72029 and Siemens TIA Portal V15.
This is a step by step procedure for setting up a Siemens S7-1200 PLC and a PDMM (KAS) for Profinet communication. In this case, the PLC is the master and the PDMM is the slave device. The Profinet communication is intended to support the transfer of data between PLC variables and KAS variables. The KAS program controls the servo axes. Basically, the PLC will only be setting values for some variables in the KAS program.
Starting with new projects in TIA Portal and the KAS IDE, follow these steps to create the necessary parts of the projects to support the communication.
Siemens TIA Portal Project:
1. Open the Hardware Catalog and expand “Other field devices” and drill down to the KAS device. Drag and Drop “KAS PN-IO device” into the Network View.
2. In the Network View, click on the hyperlink “Not assigned” and select the PLC device (“PLC_PROFINET interface_1”). This will create the Profinet network link between the PLC and the slave device.
3. Open the Device View and select the PDMM device. Click on the Properties tab. In the Ethernet addresses section, enter the IP address of the PDMM. Also enter the Profinet device name. (Uncheck the box for “Generate PROFINET device name automatically”.) This name is the Profinet name that the PLC will use to identify the PDMM.
If you choose to check the box for “Generate PROFINET device name automatically”, TIA will use the device module name for the Profinet device name and the Converted name.
4. Click on PLC_1 in the project tree and compile and download the project. Then go online.
5. You will see red icons indicating an error. The KAS device under Distributed I/O should indicate a “Not reachable” error. This is because the KAS project has not yet been set up to support Profinet communication. Once everything is set up properly and the KAS program is running, you will see these icons turn green.
KAS IDE Project:
1. Create a new KAS project. For this example, I selected PLCopen and 2 Axes FFLD, but you can choose any type of project you want. You can also use an existing project.
2. If the Fieldbus item is not already in the Project View, right-click on Controller and select Add Fieldbus. Click on Fieldbus to open the Fieldbus Editor. Use the toolbar in the Fieldbus Editor to create a fieldbus configuration.
3. Select PROFINET IO device, since the PDMM will be the Profinet slave device.
4. Give the configuration a name (any name you want). Enter “tsec0” for the Adapter Identification.
Remember the Profinet Device Name that you entered in TIA Portal? Enter that same name for the Default Station name. The Default station name is the Profinet name defined in the PDMM.
5. Click the “Configure slots” button and configure at least one slot. A slot is used as a reference number for the data that will be transferred over Profinet.
6. I selected an Input with a signed 32bit data type and an output with a signed 32bit data type. You can select inputs, outputs, or arrays of the data size and type corresponding to the KAS variable that will be mapped to each slot number. Click OK and click OK again.
7. Under your new Profinet configuration, create a group for inputs and a group for outputs. Click on the “Insert Slave/Data Block” button. Give it a name and select the Type (input or output).
8. Click on Insert Variable. Select or create a variable and enter the slot number to want to map to that variable. Set the Subslot to Do this for the inputs and outputs. Inputs are data that are input to the PLC. Outputs are data that are output from the PLC.
9. Connect to the PDMM. Compile and download the project. Run the KAS program. When the KAS program is running, it will support Profinet communication. If you stop the KAS program, then the Profinet communication will be stopped.
Alternative Method for Defining the KAS Profinet Device Name Through TIA Portal:
1. Instead of entering the Profinet device name in the KAS fieldbus settings for Default station name, leave the Default station name blank.
2. In TIA Portal, open the Device View, and select the PDMM (KAS) device.
3. Click on the “Assign device name” button.
4. Click the “Update list” button to search of devices on the network.
If a Default station name was previously defined in KAS, then TIA will find that name and indicate that it is different from the name specified in TIA Portal.
If the PDMM was never configured with a Default Station Name, then that will be indicated in the status.
5. Click the “Assign name” button to send the name specified in TIA Portal to the Default station name in KAS.
Assigning Module Addresses in TIA Portal:
1. Go offline.
2. Open the Device View and select the PDMM (KAS) device.
3. Open the Hardware catalog.
4. Drag and drop the input and output modules that you need into the PDMM (KAS) device module list in the corresponding slots. It should match what you configured in the slots in KAS.
5. Enter addresses for the inputs and outputs. I address is for inputs. Q address is for outputs. Start with address 256. This example shows only one input and one output, but you can have as many of each as to you want.
6. Compile and download the TIA project. Go online.
7. Create a watch table and enter the addresses that you want to read/write. %IW is for input of Word (16bit) data size. %QW is for output of Word data size. You could also enter them as bytes. A 32bit module will use two Words, the first at address 256-257 and the second at address 258-259. Each address number is one byte.
8. You can now force values of the outputs from TIA and force values of the inputs from KAS. You should see the values change in the corresponding device.
More Details about the Profinet Device Name:
TIA PROFINET device name:
The "PROFINET device name" in TIA is user defined (when the checkbox is not checked). This name is used to automatically configure the "Converted name".
TIA Converted name:
The "Converted name" in TIA is used for referencing the Profinet device name of the slave device. The name in the master must be identical to the name in the slave.
TIA Module name:
The name of the slave device module in TIA is irrelevant, unless you check the box for "Generate Profinet device name automatically".
KAS Configuration name:
The "Configuration name" in KAS is irrelevant.
KAS Default station name:
The "Default station name" in KAS is used for the Profinet Device Name.
Set this to the same as in TIA and it will work.
By default, there is no name. You must specify this name in KAS or assign it through TIA.
Deleting the "Default station name" will not clear the Profinet Device Name from KAS. It will use whatever was last set in the "Default station name".
Upper case letters do not seem to matter. I suspect that KAS is also using some sort of converted name that is all lower case letters.
Methods for setting the PxMM’s Profinet name:
1. Set the "PROFINET device name" (and "Converted name") in TIA, and set the "Default station name" in KAS. Compile and download both projects. Profinet communication will be established.
2. Set the "PROFINET device name" (and "Converted name") in TIA, and ignore the "Default station name" in KAS. Use the "Assign Profinet device name" feature in TIA to assign the "Converted name" to the slave device. The PxMM device will accept the new name and use it for communication, but the KAS IDE will not indicate a change in the value of "Default station name". But it will establish communication.
Checkbox for "Generate Profinet device name automatically":
If you check the box for "Generate Profinet device name automatically", TIA will copy the "Module name" into the "PROFINET device name" and "Converted name". The same methods apply for making sure the name in the PLC matches the name in KAS.
The "Default station name" in KAS is the name used for Profinet communications.
When doing an "Assign Profinet device name" via TIA to change the PxMM's Profinet name, the name will change. But you will not see any change of the value/text of the "Default station name" in KAS IDE.