AutomationTechBrian
Lifetime Supporting Member
I know this is something that is done all the time... I think I've used it before communicating with a VFD. But right now it's not making sense, and I don't program everyday. I'm struggling to see what has gone wrong.
Test_REAL is a Float
TEMP01 is an array of DINTS
POC is an array of DINTS
POC is a real-world thing that I'm working with. It's a communication array made of DINTS. For the REAL values, the value takes up two DINTS, but the arrangement is opposite:
TEMP01[0] gets moved into POC[1]
TEMP01[1] gets moved into POC[0]
I loaded this into the customer's PLC, feeling confident it would work as expected. The I put a place-holder REAL value with a value of "0" in the place where Test_REAL is in this example. I ended up getting -5741 for the TEMP01[0] value, and 16783 for the TEMP01[1] value. So, I came home and did the same on my CompactLogix L16ER. The value of Test_REAL is 100. Does this look right to you? (attached, below)
Then, what is the way to re-assemble the two array DINTS back to a REAL? There's something with the order of the two DINTS, but I'm just not finding it and I've run out of spare time.
Test_REAL is a Float
TEMP01 is an array of DINTS
POC is an array of DINTS
POC is a real-world thing that I'm working with. It's a communication array made of DINTS. For the REAL values, the value takes up two DINTS, but the arrangement is opposite:
TEMP01[0] gets moved into POC[1]
TEMP01[1] gets moved into POC[0]
I loaded this into the customer's PLC, feeling confident it would work as expected. The I put a place-holder REAL value with a value of "0" in the place where Test_REAL is in this example. I ended up getting -5741 for the TEMP01[0] value, and 16783 for the TEMP01[1] value. So, I came home and did the same on my CompactLogix L16ER. The value of Test_REAL is 100. Does this look right to you? (attached, below)
Then, what is the way to re-assemble the two array DINTS back to a REAL? There's something with the order of the two DINTS, but I'm just not finding it and I've run out of spare time.