Skip to content
Discussion options

You must be logged in to vote

Documentation says:

The Datatype STRING defines a string of maximal 254 characters. The field reserved for a standard string is 256 Bytes. This space is required in order to save 254 characters and a string-head of 2 bytes. The string-head contains the maximal and the actual length of the string. In a string all characters of the ASCII-Code can be used. A string can even contain special characters like control keys and non printable characters.

The first two bytes are consumed by the header. To avoid this, you can use helper functions from the Snap7 library: snap7.util.get_string and snap7.util.set_string, or you can write your own class to handle this data type, something like this:

im…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@DanShinde
Comment options

Answer selected by gijzelaerr
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #424 on March 01, 2023 17:37.