i’m receiving 2 bytes from a plc and wonder if there’s a way to merge them. I thought about ‘convert’ them to hexadecimal or just add the binary data together..
for example .. incoming values byte 1: 76, byte 2: 162 – desired result: num: 19618
0x4C & 0xA2 → 0x4CA2
or 01001100 & 10100010 → 0100110010100010
and then convert it to decimal..
which only provides singles bytes..
For real profinet connection lateron, i already set up 16bit groups.. but for now this wont work i think.
Correct me if i’m wrong
Ok this looks better.. but when i do so, the result is byte-swapped..
i tried to map the word vice versa but then it comes to a nonsense result.
Bytes swapped:
why don’t you combine the two bytes to a group input (16 bit), then you save yourself the later conversion
You can define the signal mapping for the group inputs as follows:
“16-23,24-31”
You can also use here the bit or byte swap, e.g. “23-16,31-24”
Thx Mickey, thats the way i’m doing it right now.
First Byte mapped from 24-31, second Byte from 16-23 (to avoid byte swapping), Word mapped 16-31 and everything works fine