Examining multi inputs if more than 1 needed

g.mccormick

Lifetime Supporting Member
Join Date
Jul 2012
Location
IN
Posts
961
What is the best way to examine multiple inputs at a time for setting an output.

For example lets assume that there is multiple dampers, each damper has an open position indicator. Before the vfd can be requested, N number of the dampers must be opened.
I have done an example in Do-more with 4 inputs and needing any 2 to be on for the output to be on. What about if I need any 2 of 8, or 3 of 16, etc. The ladder logic would get very big very fast. It seems that there should be a way to do this with bitmaps or something.
 
Are the inputs members of the same input card/file?

Look at that as a 16/32-bit integer (depending on the card) and think of a way to determine how many bits are '1'.
 
I have done an example in Do-more with 4 inputs and needing any 2 to be on for the output to be on. What about if I need any 2 of 8, or 3 of 16, etc. The ladder logic would get very big very fast. It seems that there should be a way to do this with bitmaps or something.

For 16 or less inputs You could use "casting", check the help file for details. Then use the "sumbits" function to get the number of bits that are on.

Use the import function under file to load this example into your simulator.
 
In any 'number of bits' issue I use a straightforward method which may be understood by anyone reading the logic.

Zero (clear) a numeric register.
The one rung for each bit, if true increment the register.
When done you have the nuber of ON bits. No cryptic logic. Just count the bits.
 
In any 'number of bits' issue I use a straightforward method which may be understood by anyone reading the logic.

Zero (clear) a numeric register.
The one rung for each bit, if true increment the register.
When done you have the nuber of ON bits. No cryptic logic. Just count the bits.


Bernie that may be the best idea.

I was trying to imagine using bitmap of ints, XOR, or something else like that.

I'm actually going to do this in TwinCat, but same idea would apply.

I will create this in DO-more and post.
 
Ok here is my example incrementing a count.

I am trying to get this in a "FOR" loop, using casting of the inptus X[ForIndex], but I'm having difficulty with the count just incrementing regardless of inputs.

Anyway here is an example.
 
For 16 or less inputs You could use "casting", check the help file for details. Then use the "sumbits" function to get the number of bits that are on.

Use the import function under file to load this example into your simulator.

Milldrone. That's great. Its easier than the increment way, the only drawback I see is that it is not as portable since different PLC's may not have the same casting and SUMBIT functionality. It is perfect for this discussion though.

Thanks

I also changed it so that X0-X7 cast to X0:UB to D0.
 

Similar Topics

Hi, New to the forum and hope I can contact a fellow IDEC user. I am using 6.43 Winldr software which is the latest version but IDEC seem to have...
Replies
2
Views
1,839
Hello, I had a question about benchmarking the Rockwell FactoryTalk View SE software. I've installed in the neighborhood of 30 different...
Replies
2
Views
277
Hello, I'm trying to test Acopos multi using Automation Studio. Ready LED is green blinking, how can i know what error of Acopos on Automation...
Replies
1
Views
127
Good Afternoon , I'm sure there are many Ishida Muti-Head Weigh Systems . We have a Ishida CCW-M-214W Multi-Head system . We are...
Replies
1
Views
525
Hi Guys, I'm trying to integrate Pilz Ethernet IP Module to ControlLogix. I added Pilz module as a Generic Ethernet module and I'm able to...
Replies
2
Views
510
Back
Top Bottom