variable in tag

Sep 21, 2005 1 Replies

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



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.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required