ML1400 integer>float conversion

schwarz633

Member
Join Date
May 2012
Location
Wisconsin
Posts
5
I'm reading some data from a device using Modbus TCP and am having some difficulty getting the two 16 bit words converted to FP. I've done something similar with an SLC-5/04 with weigh scales on R-I/O. In that case I had used something like:
COP I:20 > N7:1 length 1
COP I:21 > N7:0 length 1
COP N7:0 > F8:0 length 1
and it worked fine.

In the ML1400 I discovered that the 3rd COP needed to be a CPW, but I'm still not getting good values. Here's what the manual from the device states:

984 Floating point: Intel single precision real. First register contains bits 15 … 0 of 32 bit number (bits 15 … 0 of significand). Second register contains bits 31 … 16 of 32 bit number (exponent and bits 23 … 16 of significand).

I've tried reversing the words as well as straight with no success. Is it possible that the bits need to be flipped from end to end? Any ideas?
 
The solution was to set the length of the CPW to 2, and not reversing the order of the two integers containing the FP data. N10:0 is the destination in the Modbus TCP read MSG instruction.

CPW N10:0 > F8:0 length 2
 

Similar Topics

Hello, I am new here and have been working with PLCs for a few years now. I have been tasked with setting up a Micrologix 1400….. to a Cmore 10...
Replies
10
Views
510
Hi, We may of finally received out first v21 ML1400. IP address set, proceed to download standard file for our machines & at about the 80% mark...
Replies
10
Views
1,449
I have a Allen Bradely 1500 that has a cracked board. It still works but needs replaced (battery is no longer connected). To make migration easier...
Replies
10
Views
3,230
Hi, I've got a new project for a vacuum conveying system. We require to add another HMI to the existing system which will then feed 2 separate...
Replies
6
Views
1,837
Hi All I have connected a Keyence SR1000 to a Compact Logix PLC and am triggering the scanner and reading barcodes over Ethernet/IP, no issues...
Replies
2
Views
848
Back
Top Bottom