Count closed outputs?

JasonSelf

Member
Join Date
Sep 2013
Location
Cincinnati
Posts
31
If I have 8 outputs and a random 3 are closed, is there a way for an RSLogix 5000 program to give me a count of the closed outputs? The math functions don't look as if they will take a Boolean for their inputs or else I would think I could just sum them.

Thanks in advance for your help!
Jason
 
CLR MyInputCount
XIC Input1 ADD 1 MyInputCount MyInputCount
XIC Input2 ADD 1 MyInputCount MyInputCount
XIC Input3 ADD 1 MyInputCount MyInputCount
XIC Input4 ADD 1 MyInputCount MyInputCount
XIC Input5 ADD 1 MyInputCount MyInputCount
XIC Input6 ADD 1 MyInputCount MyInputCount
XIC Input7 ADD 1 MyInputCount MyInputCount
MOV MyInputCount HowManyInputs


Ugly but effective.
 
What's ugly about it? Its fast, simple, and easy to understand
. What I can't understand is how Waterboy's Inputs 1 to 7 relate to Jason Self's 8 Outputs....Anyway, the same method should work for Outputs as well.
 
Yes a good simple solution.
If you have many bits to count (and I think you don't)use FBC or use a home made counter using indirect addressing and make a loop.
I don't know FBC very well, but i might do the job
 
would you clarify what you want? random 3 closed. do you want to count when any output closes or when any 3 outputs close?
 
TheWaterboy's solution is the one I was originally going to go with, some other constraints make that not so cut-and-dry for me.

I am really interested in the FBC approach. I have successfully constructed an array based on which of my (individual) outputs are closed but for some reason my result array isn't populating as I had expected. Does anyone know of a good tutorial for the FBC instruction? It seems like I am following the AB manual OK but I'm definitely missing something.

Thanks everyone for jumping on this question!
 
What you are missing is that if the software that picks the random 3 outputs to turn on (I dislike the "closed" label for an output) is functioning correctly, why do you need to count them?

Surely in the logic that drives the outputs there is already some sort of counting taking place, so that it only turns on 3 outputs.

If this is a double-check that only three outputs get turned on, isn't it a little too late to worry about it after it has happened. Better to make sure it doesn't happen in the first place, and forget about it.

My vote goes to Bernie's solution.

Perhaps if you could elaborate more as to why you need to count something that has already been counted .....
 
I think that you had best go with the method suggested by 'The Waterboy' (even though his execution was a little off). We don't really need to know why the outputs are are in order to count them. Be sure to place the 'counting' rungs after all logic that can energise the outputs.
 

Similar Topics

What is the raw count of Allen Bradley Flex Analog Output Module 5094-OF8 raw count?
Replies
1
Views
134
I am working on a Markem X40 printer which uses NGPCL Commands and needs to send commands using a .net program. I need help with the following...
Replies
1
Views
164
Hi, I'm programming in RSLogix 500, and I'm wondering how I would program a Jog command that does not increase the encoder count. Basically we'd...
Replies
3
Views
318
Hi all, I am currently working on a software in Automation Studio that is supposed to detect when effort is inputted by a user. This is done via...
Replies
0
Views
604
Hi i have project on micrologix 1400 to display cycle time count on HMI. I am beginner. in project i have six input once all input get high it...
Replies
3
Views
816
Back
Top Bottom