1/20/2020 9:00 AM | |
Joined: 4/11/2012 Last visit: 12/4/2023 Posts: 176 Rating: (34) |
TIA v15.1, and PLC is 1516F-3. Can someone explain the reasoning behind slice access? Why are the bytes numbered there as they are? In the attached screenshot there is a small program that initializes MW0 with a value "1" and then reads that value byte by byte using three different methods. - MB0 and MB1 When 1 is moved to MW0, the MB0 will contain the Most significant byte and will contain value 0, while the MB1 will contain the value 1. But with the the Slice access the Byte 0 contains the LSB. Why does the slice access give different results than the other methods? Why does the Slice use different endianness than other commands? The documentation on https://support.industry.siemens.com/cs/ww/en/view/57374718 does not have any mention on this. |
1/20/2020 11:57 AM | |
Joined: 9/23/2005 Last visit: 4/23/2024 Posts: 4522 Rating: (698) |
In programming manual it's stated that non-optimized data are reordered to little endian when accessed. So my understanding is that slice access to .%B0 should always return LSB no matter if the data is optimized or not. On the other hand Serialize takes data and creates byte stream in network endianness i.e. big endian. |
Regards, |
|
Follow us on