Odd counter instruction in PLC5

allscott

Member
Join Date
Jul 2004
Posts
1,332
I just stubled upon some code that used the .ACC bit of a counter in a XIC instruction. I can't figure out what the programmer was trying to do or when this bit would turn on.

Anyone ever done this?
 
I've seen this before, bit zero will be true for all odd numbers, this can be used to do different things every other count.
Example:
All odd boxes are diverted to line A, all even boxes continue on same line.
 
I can't even get the code to accept this in RSLogix 5. What software was this done in. It keeps telling me that it must be set to the bit level, and the with the .acc it can't be done.
 
What this means is that the .acc must be followed by a selected bit
e.g T4:0.Acc/0 or T4:0.Acc/1.
Hope this helps you understand.
 
Something like this:
plc5_cnt_bit.PNG
 
Counter .acc

Ive used this as a flip/flop. C5:22.acc/0 will result in xic changing state with each low to high transition. Ive seen this used as an even/odd type selector. Works very well, and a simple solution to what could be complex code.
 
Yes it appears as though the bit goes "high" whenever the counter is at 0. Still can't figure out what the programmer was trying to do.
 
Greetings allscott,



I was doing just fine - right up until you said this:



Yes it appears as though the bit goes "high" whenever the counter is at 0.




and now I’ll admit that I’m a little bit (no pun) confused ...



it seems to me that when the counter’s accumulator is at “0” then all of the bits within the accumulator would have to be “0” or “low” ...



if the counter’s accumulator really-and-truly is at “0” and you’re seeing ANY of the accumulator’s bits (example: C5:0.ACC/0) as a “1” (or as you said “high”), then something is still fishy here ... or am I simply misunderstanding what you meant? ...



maybe it was just a simple typographical error ... if so, don’t worry about it and feel free to ignore this post ... but if you’re really seeing what you said you saw, then please post again with more details ... and is there any reason (proprietary, trade secret, etc.) reason why you can’t post the .RSP program file? ... I’m sure that someone here could help you understand what the original programmer had in mind ...
 
Allscot, perhaps then you could post the two rungs, the one in which the counter CTU instruction appears, and the one in which the XIC CX:X.ACC/X appears. Accessing individual bits of the accumulator is a common practice and I'm sure that if we saw the actual rungs we could pin-point it right away.
 

Similar Topics

I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
69
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
427
I have been requested to test this proportioning valve for PLC control of flow/pressure. Dwyer Series SVP Proportioning Solenoid Valve The flow...
Replies
10
Views
420
Howdy guys - Looking for some insight on the MAM instruction. Had an interesting one today: I performed a controller upgrade on an older system...
Replies
1
Views
437
Hi everyone, curious if anyone has ever witnessed the following comm error: A little history, I had a department PC die, WIN 7. Had to upgrade...
Replies
4
Views
624
Back
Top Bottom