Two PLCs on separate networks can be setup to send/receive data via Profinet coupler such as one with part number 6ES7158-3AD10-0XA0 from Siemens. The device description file can be downloaded from support.industry.siemens.com.
The GSD files then can be unzip into the following path in project folder.
It is imported and installed into the project by GSD management tool of TIA Portal.
After opening up Devices and Networks, the PN/PN coupler can be found in Hardware Catalog and can be dragged and dropped into the project.
Length of input/output data can be configured in the Transfer mapping section of Module properties. Usually the cabinet which houses the coupler should be connected to port X1. The length of input of port X1 should match the length of output of port X2 on the other side and vice versa.
There are two methods to get and set IO from the PN/PN coupler. The first one is to use the direct address from transfer mapping to create a PLC tag with data type size match the size of configured input/output. That PLC tag then can be used as any normal PLC variable.
The other method is to used hardware identifier constants and two function GetIO and SetIO. Input/output data constants can be found in System constants tab of the PN/PN coupler properties. The two used ones are …~In and …~OUT.
Then these two constants can be used as input for GetIO and SetIO to read and write input/output to and from two data blocks with exactly the same length as configured input/output length.
One response to “How to setup communication between two PLCs via Siemens PN/PN coupler in TIA Portal”
[…] After inserting the robot basic IO module into the TIA Portal project, the IP address and Profinet name have to be set the same as in IO Engineering Tool of RobotStudio. The input and output can also be inserted from Hardware Catalog in Device view mode of Devices & networks. The IO modules then can be accessed by direct addressing or by hardware identifier similar to what is described in the post https://automationhowto.com/plc/how-to-setup-communication-between-two-plcs-via-siemens-pn-pn-couple…. […]