PLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. arne
  2. PLCnext Engineer
  3. Tuesday, 11 February 2020

Hi,

I’m a student who is doing a master thesis for Phoenix Contact. I’m trying to communicate with a Siemens s7-315 PLC over Profinet.
I’m trying to read and write data out of a datablock from the S7 to the  PLCnext Controller. I’m using the WRREC and RDREC functions.
When I want to initiate the data transfer I’m receiving the error code 0xF008, this means an invalid parameter is given.
I have tried to determine the cause of the issue myself via the manual but I can’t figure it out what’s wrong.
My best guess is that it has something to do with the way I call the records where the data comes from.

In the attachments you can find how the datablocks in the siemens PLC's are defined and how I use the WRREC and RDREC funtions. 

 

Thanks in advance,

Arne

Attachments (5)
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Arne,

If your goal is to exchange data between the AXC F 2152 and the S7-315 data blocks, then using RDREC and WRREC is probably not the right way to do this.

 

However if your goal is to read and write Profinet data records, then you can see some of the valid record numbers in section 5.1 of this document from Siemens:

https://support.industry.siemens.com/cs/document/19289930/from-profibus-dp-to-profinet-io

 

But if you simply want to exchange data between the PLCs:

I gather from your screen shots that you have set up the S7 as a Profinet device, and the AXC as the Profinet Controller?

Rather than use Profinet Data Records, the data in DBs in an S7 PLC (if that PLC is acting as a Profinet Device), is more like "process data" to the Profinet Controller. And exchanging process data with a Profinet device is reasonably simple:

When you import the Siemens GSDML file into PLCnext Engineer and configure it correctly, you should see some number of I/O byes from that Profinet device in the PLCnext Engineer -> PLCnext -> Port List window. You can then connect this I/O data to Port variables in your PLCnext Engineer project.

The question of how to configure data in an S7 data block to appear as Process Data on the Profinet network, and how the GSDML file should be configured, when the S7 is acting as a Profinet device ... this is a question for Siemens.

~ Martin.

 

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. one week ago
  2. PLCnext Engineer
  3. # 1
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Arne, just looking into this a bit further (I'm an old Siemens programmer and can't help myself!);

To set up an S7 controller as a Profinet Device, it looks like the term "I-Device" is relevant here. Section 4.8 of this Siemens manual ...

https://support.industry.siemens.com/cs/document/19292127/simatic-profinet-system-description

... explains how to set up an S7 controller as an I-Device, including how to specify which data areas you want to use as Profinet process data (e.g. Data Blocks), and how to generate the GSDML file that you can import into PLCnext Engineer.

Again, I am assuming that you just want to transfer data between the two PLCs ... if you really want to explore Profinet records using RDREC and WRREC, then you can ignore everything I've written.  :)

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. one week ago
  2. PLCnext Engineer
  3. # 2
arne Accepted Answer Pending Moderation
0
Votes
Undo

Hi Martin,

Thx for responding so quickly. As you asked the Siemens s7 is configured as a I-device and the AXC is the controller. 

The project is about new communication methods with a PLC s7. I'm going to try to work with node-red, c++ on/off GSD and one another language. 

I thougth that WRREC and RDREC where the only options to get the data out of the PLCvia Profinet. 
So I wanna try to get it to work the way you are explaining. I already found how to setup the I-device and the transfer area but I'm not sure how to implement it in PLCnext.
The problem is that with the gsdml-file I found online the PLCnext controller is not recognized as controller but as a device.

I'm not sure the PLCnext controller can work without that connection (see image) and how to acces this transfer area in the PLCnext controller.
That's why I actually chose WRREC and RDREC. 

 

Thanx in advance,

Arne

 

Attachments (1)
  1. one week ago
  2. PLCnext Engineer
  3. # 3
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Arne, that's great, it sounds like you are most of the way there.

I already found how to setup the I-device and the transfer area ...

This is almost all you need to do in the S7 PLC. As a Profinet device, the S7 PLC does not need to know anything about the AXC - so you do not need to import any GSDML file(s) into TIA Portal. GSDML files are only used by the Profinet Controller - so, the AXC in this case. But which GSDML file should you import into PLCnext Engineer? This needs to be the one that describes the S7 PLC (Profinet device). I am not 100% sure, but I understand that in this case you must generate a GSDML file in TIA Portal, using the procedure described in section 4.8.2.4 in this document:

https://support.industry.siemens.com/cs/document/19292127/simatic-profinet-system-description

Once the GSDML file is created in TIA Portal, you should export it, and then import it into PLCnext Engineer. You should then be able to create the Profinet Device in PLCnext Engineer, and connect up the IN and OUT ports on that device. These ports will contain the data from the S7 DBs that you defined in TIA portal.

After finalising the configuration, when the AXC (Profinet controller) starts up, it will automatically start transferring process data to and from the S7 PLC, without the S7 PLC needing to do anything else.

... and one another language.

+1 vote for Rust from me   :-)

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. one week ago
  2. PLCnext Engineer
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.