Skip to content

Commit

Permalink
Update ab-tag-read-fragmented.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-trunorth authored Mar 21, 2024
1 parent 16e2236 commit 30f9e56
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/ab-tag-read-fragmented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl Encode for AbString {
buf: &mut BytesMut,
encoder: &mut A,
) -> Result<(), A::Error> {
// NOTE: If writing to a string in the PLC, a "string-like" UDT must be created. By default, AB PLCs don't allow external write access to strings
let mut data = self.data.as_bytes();
if data.len() > DEFAULT_STRING_CAPACITY {
data = &data[0..DEFAULT_STRING_CAPACITY];
Expand Down

0 comments on commit 30f9e56

Please sign in to comment.