plc4x-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Feinauer <j.feina...@pragmaticminds.de>
Subject Re: [S7] String handling
Date Sun, 02 Sep 2018 12:44:22 GMT
Hey all,

I did some more research and am able to (partially) answer my own question.
Regarding to this thread [1] and die TIA Spec (only available as image) the following is true:

Syntax: STRING[n] has length n+2
First to bytes (see comment in chris' code) are
1: Maximal String length
2: Actual String length
So no null termination is needed (I guess the remainder is null padded but it dont has to
be).
All characters are ASCII.

Furthermore the notion STRING (without length) is "syntactic sugar" for STRING[254], i.e.,
overall size of 256.

These things are also documented in my proposal [2].

I will implement it this way if everybody agrees.

Julian

[1] https://support.industry.siemens.com/tf/WW/en/posts/string-data-type/51621?page=0&pageSize=10
[2] https://cwiki.apache.org/confluence/x/jhpPBQ

Am 02.09.18, 13:03 schrieb "Julian Feinauer" <j.feinauer@pragmaticminds.de>:

    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?
    
    Thanks
    Julian
    

Mime
View raw message