Hi There,
I have an AB L33ER talking with a unit over Modbus TCP, coms are all good and i am reading in data so all that side of it is fine.
The values that are sent from the unit vary in data type majority in BCD. when i read in a value in BCD 32 i can see it in two ints on my map. when i convert them to BCD with the FRD instruction my two seperate ints correspond to the total value being sent - great!!
The issue;
No matter what way i try to combine the two ints to one dint it just doesn't come the same, i have tried the copy as the two ints are in any array after each other. i have tried copy then TOD/FRD i have used SWP/MVM/BTD all with various parameters but to no avail.
Question:
Anyone there help me out with this? below is an example:
Value being sent 123456
Data read in Int[7] (Dec Val 18) = IntArray[0] (BCD val 12)
Data read in Int[6] (Dec Val 13398) = IntArray[1] (BCD Val 3456)
So how do i combine the two ints to give me dint value 123456?
Thanks in advance...
I have an AB L33ER talking with a unit over Modbus TCP, coms are all good and i am reading in data so all that side of it is fine.
The values that are sent from the unit vary in data type majority in BCD. when i read in a value in BCD 32 i can see it in two ints on my map. when i convert them to BCD with the FRD instruction my two seperate ints correspond to the total value being sent - great!!
The issue;
No matter what way i try to combine the two ints to one dint it just doesn't come the same, i have tried the copy as the two ints are in any array after each other. i have tried copy then TOD/FRD i have used SWP/MVM/BTD all with various parameters but to no avail.
Question:
Anyone there help me out with this? below is an example:
Value being sent 123456
Data read in Int[7] (Dec Val 18) = IntArray[0] (BCD val 12)
Data read in Int[6] (Dec Val 13398) = IntArray[1] (BCD Val 3456)
So how do i combine the two ints to give me dint value 123456?
Thanks in advance...