Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
I have 157 2 byte arrays and i want to convert those to uint values and then save all of them to one array.
I have (those are measured values presenting distances when converted).
aValue1 : ARRAY [0..1] OF BYTE := [07,DE];
.
.
aValue157 : ARRAY[0..1] OF BYTE := [00, 8F];
I want:
aValues : ARRAY [0..156] OF UINT :=[2014,...143];
has anyone any idea? i converted aValue1 to HEXSTRING because i though i can use HEXCHRNIBBLE_TO_BYTE, but this function is only for string(1) and i have after conversion '07 DE'.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have 157 2 byte arrays and i want to convert those to uint values and then save all of them to one array.
I have (those are measured values presenting distances when converted).
aValue1 : ARRAY [0..1] OF BYTE := [07,DE];
.
.
aValue157 : ARRAY[0..1] OF BYTE := [00, 8F];
I want:
aValues : ARRAY [0..156] OF UINT :=[2014,...143];
has anyone any idea? i converted aValue1 to HEXSTRING because i though i can use HEXCHRNIBBLE_TO_BYTE, but this function is only for string(1) and i have after conversion '07 DE'.
How about using a UNION?
Example:
Related
Talk.ru: 1