LadderLogic
Member
Gerry said:It looks like it will detect MB13520 plus any other 2 of 4
Yes it will, because the inspection station sets MB13520 bit so that is when the detection makes sense.
Gerry said:It looks like it will detect MB13520 plus any other 2 of 4
Terry Woods said:rdrast...
If you have been around (at PLC.net) long enough... then you know that I am "the" major proponenent for Karnaugh Maps. However, in this case, although I haven't found it yet, I believe there is a way to make the determination much faster than a K-Map could.
At the very least, one could exercise a special-function program, or a sub-routine with jumps, to divide by 2 until the result consists of a quotient greater than "0" and a remainder of "1". If that occurs then, without a doubt, more than one input is ON!
However, I'm still working on trying to make this determination in a single rung.
This is an interesting problem.
I'm still waiting for Gerry to describe his method in a conceptual manner.
Pierre said:Single BIT when converted into a DATA have the a value relative to there position into this DATA.
Comparing inputs from a module, say I:1/0 to I:1/15
0000 0000 0000 0001 would be displayed has 1 in a Data-word
0000 0000 0000 1000 would be displayed has 8 in a Data-word
0000 0000 1000 0000 would be displayed has 128 in a Data-word
All these "displayed" values are from consecutive bits while only one bit is "ON".
So comparing "values" will not work.
MyCounter = 0
mode = true
while mode
IF i = True
Then MyCounter = (MyCounter +1)
IF MyCounter= 2
Then mode = false
Endif;
Else
If i < n
Then i= i+1
Else mode = false
Endif;
Endif;
Return
Pierre said:... So comparing "values" will not work.
Terry Woods said:Oh.... it's already been done? It can't be done better because that would be reinventing the wheel?
If we don't keep looking for better answers... then we won't ever find better answers!