plc4x-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christofer Dutz <christofer.d...@c-ware.de>
Subject [S7] Handling Bit-Strings
Date Tue, 04 Sep 2018 09:21:50 GMT
Hi all,

as I found out the differences of the different S7 types, i am currently implementing the
parsing and serialization of these types.
Now there are 3 types of 1-byte values:

  *   BYTE
  *   SINT
  *   CHAR

At a first glance it seems strange that Siemens defined these, but it turned out that:

  *   BYTE = Bit string of 8 Boolean values
  *   SINT = 1 byte integer number
  *   CHAR = 1 character String

So now I’m thinking of how BYTE, WORD, DWORD and LWORD should be handled.

For the Integer and FloatingPointFieldItems I implemented getBoolean to return true, if the
value is not 0.
However for the byte-strings it would make more sense to instead return more Boolean items,
so reading 2 bytes for example would return 16 boolean values.

What are your thoughts on this matter?

Chris

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message