Determining how many inputs are on?

jatkinson924

Member
Join Date
Jan 2018
Location
Nashville, TN
Posts
10
I'm programming a AB 1769-L18ER processor with Studio 5000. I'm wondering if anyone knows away to determine how many inputs are on thru logic? Instruction to use? I've gotta turn off certain outputs if I reach a certain amount of inputs turned on. I'd appreciate any help!
 
I'm programming a AB 1769-L18ER processor with Studio 5000. I'm wondering if anyone knows away to determine how many inputs are on thru logic? Instruction to use? I've gotta turn off certain outputs if I reach a certain amount of inputs turned on. I'd appreciate any help!

If all of your Inputs are from one module, you can use a Diagnostic Detect (DDT) on the inputs directly. The output is a list of which bits are not the same between 2 arrays.

If your Inputs are not all in the same module, you will need to COP the Inputs to an array before you compare it to a Bit array of 0's.

The output array is not interesting, but the control for the output lists how many bits were not the same. I think this is what you are looking for.
 
I don't disagree with either reply but....
If the inputs are spared out or you don't want to count on in the middle for some reason, perhaps its a counter input or something, there is a longhand method which is simple and quick.

Assuming you are using in input map ladder, or code, that takes physical IO and maps it to memory bits, just good practice that, then all you need is a single int and a couple of instructions.

At the top of the map ladder/rung set you input count int to 0
On every rung/line that sets a memory bit to the input state inc the count by one.

you will not see any flutter because the int will only be set at the end of the scan, unless you made it volatile, which you shouldn't.

To be fair it is a bit longhand but then its also bulletproof and isn't reliant on card metadata or nicely grouped inputs.
It, the methodology, will of course work or any list of assignment statements or conditions, depending on your perspective - alarm count anyone?

BTW if you use a spreadsheet to build your code the time impact of adding a single extra instruction, for each input, is almost nothing!

Hope that helps,
Al
 
Thanks for the help. I tried the DDT instruction but found it changes the reference bit to match the source bit, which i don't need to happen. FBC instruction is the same as the DDT but doesn't change the reference bit. This worked perfect!
 
Thanks for the help. I tried the DDT instruction but found it changes the reference bit to match the source bit, which i don't need to happen. FBC instruction is the same as the DDT but doesn't change the reference bit. This worked perfect!

Sorry about that. I should have pointed out that the DDT changes the compare mask. But you figured it out.
 

Similar Topics

We are in the process of installing a new DC drive to replace a 1373 series Speedpak drive. There are 8 leads coming out of the motor -- Two for...
Replies
5
Views
843
Good morning! I am looking for a clever method to determine the number of occurrences in a series using ladder logic. What I need to determine is...
Replies
6
Views
1,255
I have my PLC and HMI connected to my local network over DHCP just like my laptop. I can upload and download including VNC to the HMI over wifi...
Replies
2
Views
1,137
We have a DC Drive (ABB DCS800) which is running a load (initially) at a fixed speed. For testing purposes, we want to simulate a different...
Replies
20
Views
6,215
ive been tasked, due to a restructure of our inventory, to find out how big our SLC programs are. specifically, we have several dozen 5/05s at...
Replies
4
Views
1,640
Back
Top Bottom