plc4x-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Feinauer <>
Subject Re: [S7] String handling
Date Mon, 03 Sep 2018 08:19:44 GMT
Hey Chris,

thank you for the information!
Yesterday I went through lots of Siemens manuals just to find out that it gets the more confusing
the deeper you go into.
Could it be that the P denotes a Pointer?
Because the "#" is usally used for symbolic addressing when I remember correctly.

My aim is to have a clear and good syntax which is as TIAesk as it could be but on the otherhand
easy to understand for all non TIAlers.
So for me the addresses read like pointers to the start bit (DBX).
This probably makes sense as a String is not considered an elementary type in TIA (as its
larger than 4 bytes).

So the combined syntax would be:
With explicit length information.

A related question is, how does TIA handling referencing to arrays (I think we agreed to do
this as part of this string here).
Can anyone with TIA access (chris?) check how tia handles this?
Or should we simply make it similar with 
P#DB1.DBX314.0:LREAL[10] // Read 10 LREALS starting at offset 314

What do you think?


Am 03.09.18, 09:47 schrieb "Christofer Dutz" <>:

    Hi Julian,
    so I spun up my TIA and did some String stuff ...
    Defined 2 Sting variables:
    Name: 		Data type: 		Offset:		Start value:
    Hurz1		String			314.0		'Der Wold, das Lamm"
    Hurz2		String			570.0		'Auf der grünen Wiese"
    After compiling the memory block (DB1), the offsets were automatically set.
    Then I added a CONCAT function to my PLC program and referenced those two fields as input.
Here's what TIA made out of it:
    Hurz1: 	P#DB1.DBX314.0
    Hurz2:  P#DB1.DBX570.0
    Notice the "P#" instead of the "%"? And it seems that the address looks like a BIT address,
as it has the bit offset part set. But just comparing this to all the others, it seems like
all types can have a bit-offset part set, this is just always ".0" for any non-bit type.
    Am 02.09.18, 13:03 schrieb "Julian Feinauer" <>:
        Hey everybody,
        I have another question about the semantics we should provide for reading / writing
Strings in the S7 Driver.
        I have not found an example on how this is handled currently but to me it looks a
bit like a mix of reading the data as “array”, i.e., using the size parameter on the request
(= fixed size string) but handling it as null terminated String.
        As I have currently no TIA available, can anyone give me the syntax how Strings are
addressed in TIA.
        I think they were fixed size always and I would prefer to do it that way.
        Could anyone who implemented this (or has expertise in this) help me out a bit?

View raw message