32 bit words in rslogix

janyberg

Member
Join Date
Jun 2004
Location
Fremont Nebraska
Posts
6
:rolleyes: I have been trying to figure out how to address a 32bit word in rslogix 500. What i am doing is trying to multiply a number and move it into the preset of a high speed counter which uses a 2 words or 32 bits for the preset. Can anyone tell me how to address them two words or how to move a 32bit words to them. It seems like i should be able to do it from a multiply instruction using s:14 and S:13 but i just get a fault when i try it and nothing is in them registers.
I can move it to floating point files but how can i move the floating point files to the output file which a 16bits.
 
I can move to a F8 file. What i need to know is how to move the f8 file to the Output file which uses two words. O:1.10 and O:1.11 I think i should somehow beable to use these as one 32 bit word???/
 
which high speed counter are you using? Is it expecting a 32 bit floating point number or a 32 bit integer? They are different.
 
I have been moving integer numbers to just one of the files O:1.10 and this has been working. But i noticed that the number had to be less than 32767 or i would get an overflow error when i moved it into the N7 file. I will have to check and see if i can move the floating point into the counter preset file. I think that maybe the copy instruction might work here. The counter preset files are two words file 10 and 11 for range twelve that i can direct write to.

JEff
 
Okay, you're going to need to take a step back and think about the way that numbers are represented in A-B logic controllers.

If you have a literal "count" for a high speed counter card, you will be representing that as an Integer. There's no fractions of a count available or required.

Floating Point numbers are composed entirely of fractions, though. Even though it is a "32-bit" value, it's not the same as a 32-bit Integer. Instead, Floating Point values are approximations, using a limited number of significant digits and an exponent. A-B uses IEEE single-precision floating point math, for which you can look up the dirty details on the web.

Two good things:

1. The COP instruction moves Integer words around bit-by-but, unlike the MOV instruction that interprets them as a number. If you have to transfer two 16-bit Integer words that may include a value greater than 32767, you need to use a COP of length 2, rather than a MOV.

2. You're on the right track using the Math Registers S:13 and S:14 to handle large integer resultants in the SLC-500 platform. I'll need to do some experimenting to be able to recommend the proper settings and ladder, but it's definitely the way to do what you need to do.

What is the biggest value you will need to put into the High Speed Counter preset register ?
 
Ok i created another data file I called cnt It was a long file which is two words or 32 bits in length. I tried to copy this with the copy instruction to the Range 12 presest which is two words long O:1.10 and O:1.11. I cannot do this because with the copy instruction on a micrologix 1500 both files have to be the same length. My Long L9 file is 32 bits and the preset on the counter is two 16bit words.

I am trying to write a value which would be greater than 32767 to the counter preset which is two 16bit words but i am assuming it is a 32 bit word because with a high resolution encoder it would be very little movement to go over 32767.

when i talk about the counter i mean a compact I/O high speed counter module. With this module you have ranges available that operate outputs when the range is active the file i am trying to write to is the preset for that range. This all works fine I am currently able to wrtie a 16bit integer to this preset and everything is ok > I am trying to figure out how to write to both words so i can have the preset greater than 32767..

JEff
 
Using the MicroLogix 1500 actually makes this a lot easier than using the SLC-500 modular controllers. I was barking up the wrong tree, there.

There is a Knowbase document that addresses exactly the use of the 1769-HSC high speed counter module with the MicroLogix 1500:

Knowbase A2863807

The key to moving that Long Integer into two Output integer words is the Copy Word (CPW) instruction. The Knowbase document discusses its use as well as other aspects of this configuration.
 
I just found out about the cpw instruction from the micrologix instruction set. I was using the instruction set for slc 500 and assuming they were the same. I should of know because that module is alot different than the hsce module for the slc 500. Thanks for you help.
 
ok I used the cpw instruction to write to the counter. This seems to work however now i am unable to enable the counter . There is a steady green ok light on the module so there does not seem to be errors. Somthing is different though because i used to be able enable the counter when i was just copying data to the output file. I thought maybe it had somthing to do with the low limt so i cpw a 32 bit word to its two registers also. Still trying to figure this out. it was easy until i needed a long word.

Jeff
 

Similar Topics

The topic of reading or writing floating-point values via Modbus seems to come up regularly, and it is to my mind not that difficult. That said...
Replies
0
Views
1,384
I have an application in which I am communicating with an Ethernet/IP generic module. The data exchange is 32 8-bit input words and 32 8-bit...
Replies
1
Views
2,042
Has anyone concatenated two 16-bit (B3) words into one 32-bit (L) word in a Micrologix 1400? I do not want to add the values. I need to maintain...
Replies
4
Views
4,370
hey guys i've only been using plc's a few months for my final yr project in mech eng. i'm using an omrom cpm2a and mad11 expansion unit to...
Replies
6
Views
1,806
Can the "S" bits and words from the SLC-500 be monitored and written over, like for example the Hour, minute, seconds or the max scan time allowed...
Replies
5
Views
2,275
Back
Top Bottom