ML 1400 Long Number to Floating point

roxusa

Lifetime Supporting Member
Join Date
Nov 2008
Location
NJ
Posts
989
I am working with the ML 1400 to utilize the HSC, I have set it up and can read from my encoder into HSC:0/ACC. However I need to convert the number in the ACC to something I can scale to a number with decimal point like with a SCP. I would like to read 0-66" for positioning.
I have tried the MOV instruction from ACC to L9:0 but still can only read up to 32767 befor it goes negative.
I tried the CPW instruction and am not sure how to read the number that it produces (4.484155e-41)
I am using RS-Emulate to find a way to read higher PPR encoders in an effort to give positioning and readouts to various axis on a machine.
I have been reading other posts and looking for any AB Tech Note links for examples, any ideas are appreciated-Thanks
 
So far I have come up with using CPT to convert the Long Number (L9:0)
into a Float (F8:0) to use as the input to my SCP.
 
Another note I had to use a CPW to get my HSC:0.ACC into L9:0
not a MOV
 
Use a CPW (Copy Word) to move all 32 bits from HSC:0.ACC to L9:0. That won't mis-interpret the sign bit, and you'll get a value all the way up to 2^31 = 2,147,483,648.

CPW was specifically added to the operating system for the 1500/1400/1100 so that it could deal more effectively with Long and other nonstandard datatypes that the COP instruction didn't handle.

Then use a MOV (which automatically converts datatypes) or a CPT to scale it to your Length value.

I'm not sure if the SCP scaling instruction can accept a Long word as the Input; I know it can accept them as max/min values.
 
Use a CPW (Copy Word) to move all 32 bits from HSC:0.ACC to L9:0. That won't mis-interpret the sign bit, and you'll get a value all the way up to 2^31 = 2,147,483,648.

CPW was specifically added to the operating system for the 1500/1400/1100 so that it could deal more effectively with Long and other nonstandard datatypes that the COP instruction didn't handle.

Then use a MOV (which automatically converts datatypes) or a CPT to scale it to your Length value.

I'm not sure if the SCP scaling instruction can accept a Long word as the Input; I know it can accept them as max/min values.

Even if the CPW function was unavailable, couldn't you simply multiply an Integer by 1 and place the result into a Long Integer or Floating Point word?
 
THANKS ALL
I have changed my CPT to a MOV and everything looks good in Emulate.
 

Similar Topics

I am getting data from a modbus device and I need to combine 2 16 bit N registers in to 1 32bit L register. I have tried a CPW N242:2 -> L245:0...
Replies
5
Views
2,126
Hi all, I'm communicating with a modbus device which sends data in 32 bits data. You can see the structure in this example: N7:4...
Replies
6
Views
4,556
I have an Allen Bradley MicroLogix 1400. I am trying to display a value onto an HMI, however my HMI will not accept a Long (i.e. L10:2) as an...
Replies
6
Views
10,564
Hi all, I am communicating with a modbus device which sends data in 32 bits format. The MSW represent the integer part of the value and the LSW...
Replies
3
Views
5,569
Hi, I'm having an issue with a mircologix not transmitting out. The current setup is a mircologix 1400 connected to a Guardian 100 Radio...
Replies
1
Views
102
Back
Top Bottom