variable in tag

Im using A B's RS logix 5000. Just started programming with ladder logic. I'm wondering if it is possible to use a variable in a output function. In other words, I want to set an output depending on a counter value; If the counter is one, I want to set output Local:2:O.DATA.1 If the counter is two, I want to set output Local:2:O.DATA.2 and so on. Other wise, I have to write the same section 32 times...

I'm sure there is an easier way.

Thanks for your help.

Tom

Reply to
Tom_ch
Loading thread data ...

No, you cannot indirectly address bits in RSL5000. You CAN indirectly address array elements.

Why don't you just use Local:2:O.Data as the "Array" of the BSL instruction? Set the value of Local:2:O.Data to 1 and each shift will energize the next output. Or, if you are going to use all 32 bits, just take the current value of Local:2:O.Data, multiply it by 2, and store it back to itself.

Reply to
BFoelsch

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.