AB Discrete Control


Thread Starter

Hunter Farris

Need help with AB RSLogix addressing. I am trying to simplify PLC code. I have a register with a pointer value for a FIFO stack. Pointer value is an integer number. Is it possible to assign pointer register with integer value to the bit number of normally open contact?


Hunter Farris
A short answer: yes.
Any integer word can be written to a bit word or IO word.
This instruction MOV N7:0 B3:0 copies a 16 bit integer to the B3 file word zero, bit for bit, ie bit N7:0/0 goes to B3:0/0, N7:0/15 to B3:0/15. If you dont want to move the whole word, use the masked move MVM instruction, or the OR, AND, or XOR functions depending on what you want. I'm not sure what your application is but depending on what you are trying to do you may want to take
a look at using the SQO instruction instead of a FIFO. Don't bother pairing the SQO with an SQI build your own transition logic, its more readable that way. With the SQO set up a file with the desired bits set in each word corresponding to the specific steps of your operation, then the SQO will write the matching step word through a bit mask to the destination you want.
you can also address the data table bits on n/o and n/c contacts in your rung. however, if you program an output with an address from the data table ( n7;0/0 ) the bit in that data word will be overwriten every scan with the state of that rung. ( holding the bit low or high )

Jeremy Pollard

Depending on a lot of things you can do this:

B3/[N7:0] this with indirect the bit address to the value of N7:0 works well, and tastes less filling:)

Cheers from:

Jeremy Pollard, CET
The Crazy Canuckian!
Integration, Automation, and Training

On The Web - http://www.tsuonline.com
PLCopen North America - [email protected] www.PLCopen.org

8 Vine Crescent, Barrie, Ontario L4N 2B3
B3/[N7:0] is a great answer!
I would just like to add that using indirect addressing won't show the address's affected as used so you run the danger of someone using an address that is indirectly addressed.
We try to remember to program an instruction like a copy of the used addresses to itself so the addresses show used.
example: Cop B3:0 to B3:0 (# of words used)
we also put a Normally Open contact in front of it (AFI) so it will never actually perform the copy.
Before I work on a strange program I do a search for a '[' (without quotes) to find out if indirect addressing is being used.

Dave Welch