Hello All,
I'm rather new to this site, so please forgive any dumbness.
I'm posting this in an effort to do a better job of my programming.
I've got some AB (micro 1200's & SLC's) PLC's communicatimg via radio & ethernet. The PLC's that comm via radio are my focus at the moment, all of which comm integers (modbus). I have some floating points that I'm currently putting into 2 integers then when it gets to a PLC that comms ethernet I put the integers back to Floating point for our SCADA.
If the radio PLC & the ethernet PLC are both SLC's, I'm just using a COP statement to go from floating pt to 2 integers & then back again with the same type of statement (which seems to be working fine).
If the radio PLC is a Micro 1200 & the Ethernet PLC is a SLC
(In the 1200) I'm using a CPW statement to go to integers, & in the SLC, I'm using 2 MOV statements to swap the low & high word (because it seems they are reversed in the SLC) then I'm using a COP statement to put the integers back to Floating Point.
Example: (in the Ethernet SLC 5/05 PLC)
MOV n16:12 to N7:11
MOV n16:13 to N7:10
COP N7:10 to F8:25 with a length of 2
This seems to work also BUT there an easier way for me to do this & is my thinking right on this???
I'm rather new to this site, so please forgive any dumbness.
I'm posting this in an effort to do a better job of my programming.
I've got some AB (micro 1200's & SLC's) PLC's communicatimg via radio & ethernet. The PLC's that comm via radio are my focus at the moment, all of which comm integers (modbus). I have some floating points that I'm currently putting into 2 integers then when it gets to a PLC that comms ethernet I put the integers back to Floating point for our SCADA.
If the radio PLC & the ethernet PLC are both SLC's, I'm just using a COP statement to go from floating pt to 2 integers & then back again with the same type of statement (which seems to be working fine).
If the radio PLC is a Micro 1200 & the Ethernet PLC is a SLC
(In the 1200) I'm using a CPW statement to go to integers, & in the SLC, I'm using 2 MOV statements to swap the low & high word (because it seems they are reversed in the SLC) then I'm using a COP statement to put the integers back to Floating Point.
Example: (in the Ethernet SLC 5/05 PLC)
MOV n16:12 to N7:11
MOV n16:13 to N7:10
COP N7:10 to F8:25 with a length of 2
This seems to work also BUT there an easier way for me to do this & is my thinking right on this???