You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Willem Remie <w....@remsol.nl> on 2022/11/11 14:04:18 UTC

[PLC4GO] S7: reading WORD array

Hi all,

First of all, thank you so much for all the effort which went into the project so far. It is a very promising project to break open the industrial arena for a lot of use-cases.

I’ve used the hello_world_plc4go_read.go example as a template to communicate with an S7-314-2 PN/DP controller. Reading a single WORD tag works perfectly fine using following "%DB1:0:WORD" string. However, when trying to read an array of WORDS using the length parameter "%DB1:0:WORD[8]" it always returns the first WORD.

As I’m new to the project I’m not sure if reading an array requires a different ReadRequest or it should work with minimal adjustments of the example. I’m in doubt because I see some issues on gitlab/jira with problems reading/writing (large) arrays.

Regards,
Willem Remie

Re: [PLC4GO] S7: reading WORD array

Posted by Christofer Dutz <ch...@c-ware.de>.
I guess the biggest problem for S7 is requests where tags are too big to fit into one Request.
PLC4X automatically splits requests up into multiple ones, if the packet is full, however it currently can’t do this if one item on its own is too big to fit.
The probably most prominent case of this is reading a “STRING” … the problem with this is, that a STRING is per definition 255 bytes long. Unfortunately, this exceeds the PDU size an S7 1200 has (which is 240bytes).
So, to be able to read strings on S7-1200, you have to use something like “STRING(80)” (if the string is not going to be longer than 80 characters. With a tag defined like this, you can read Strings on S7-1200.
Similar problem is with large arrays: DWORD[400] would result in one tag with a payload of 1600bytes …

In general, we need some logic to not only split up requests, but also to rewrite tags. I had always considered logic like this to be universal and should be shared among different drivers.

However currently we’re actually only having this problem in the S7 driver … so possibly implementing this for the S7 driver (like it was in the 0.6.0 version of the S7 driver) would be something someone could take on.

Chris



From: Willem Remie <w....@remsol.nl>
Date: Friday, 11. November 2022 at 15:05
To: dev@plc4x.apache.org <de...@plc4x.apache.org>
Subject: [PLC4GO] S7: reading WORD array
Hi all,

First of all, thank you so much for all the effort which went into the project so far. It is a very promising project to break open the industrial arena for a lot of use-cases.

I’ve used the hello_world_plc4go_read.go example as a template to communicate with an S7-314-2 PN/DP controller. Reading a single WORD tag works perfectly fine using following "%DB1:0:WORD" string. However, when trying to read an array of WORDS using the length parameter "%DB1:0:WORD[8]" it always returns the first WORD.

As I’m new to the project I’m not sure if reading an array requires a different ReadRequest or it should work with minimal adjustments of the example. I’m in doubt because I see some issues on gitlab/jira with problems reading/writing (large) arrays.

Regards,
Willem Remie