(8{)} ( .)
Lifetime Supporting Member
Hi All,
This one is really weird. It may have been discussed but It's
something new to me. Really knocked me for a loop.
Anyway...
I was programming a data transfer between a PLC-5 and CLX controllers. The PLC-5 reads data fromt the CLX over DH+.
I set up an INT array in the CLX and assigned it to appear
as N32 on DH+. Some of the data I had to transfer was Floating point data so I COPied the data into the INT array. So far so good.
Now comes the weird part.
When I programmed the MSG in the PLC-5 all of the data appeared
to transfer correctly but when I copied the Floating point data
back from the integer file in the PLC-5 to a floating point
file, behold, gibberish.
After scratching my head and stroking my beard I wrote a loop
that swaps the low and high 16 bit parts (integer data) of the floating point data. I copied the results to floating point and,
behold, good healthy data.
I don't know if this is documented but evidently the COP instructions work a little differently in the two controllers. The PLC-5 copies low-word/high-word and the CLX high-word/low-word when copying floating point data (maybe it's the oposite, who knows).
Regardless, weird.
Any comments?
(8{)} .)
(Yosi)
This one is really weird. It may have been discussed but It's
something new to me. Really knocked me for a loop.
Anyway...
I was programming a data transfer between a PLC-5 and CLX controllers. The PLC-5 reads data fromt the CLX over DH+.
I set up an INT array in the CLX and assigned it to appear
as N32 on DH+. Some of the data I had to transfer was Floating point data so I COPied the data into the INT array. So far so good.
Now comes the weird part.
When I programmed the MSG in the PLC-5 all of the data appeared
to transfer correctly but when I copied the Floating point data
back from the integer file in the PLC-5 to a floating point
file, behold, gibberish.
After scratching my head and stroking my beard I wrote a loop
that swaps the low and high 16 bit parts (integer data) of the floating point data. I copied the results to floating point and,
behold, good healthy data.
I don't know if this is documented but evidently the COP instructions work a little differently in the two controllers. The PLC-5 copies low-word/high-word and the CLX high-word/low-word when copying floating point data (maybe it's the oposite, who knows).
Regardless, weird.
Any comments?
(8{)} .)
(Yosi)