We have a system with PLCs with different byte order conventions - little endian/big endian.
I'm looking for Codesys routines for converting data between a host's internal representation and Network Byte Order(like htons() and ntohs()).
Thanks in advance
Scroll down to programming: https://disorder.dk/wonderware/2020/10/07/modbus-tcp-between-codesys-controllers/
You could use a struct "Union", in this example I always read out the real value in the code where I use the value, but I can switch around on the word0 and word1 when writing into the union from the MODBUS register.
Log in to post a comment.