Count Up Only Once

michalis95

Member
Join Date
Jul 2012
Location
Cyprus
Posts
6
Hello guys how are you?

Basically, I want when a psychical input is switched ON (circuit closed) an addition or a counter to add +1 to an integer, no matter how long it is on. Every 5 sec the integer will be reset back to 0.

I managed to do this, however I can't get the first part right, the addition is too fast and I can't figure a way to slow it down
 
A counter "CTU" instruction operates on a false to true transition. It will only increment the accumulated value by 1 each false to true transition.

Or use a one shot (OSR) ahead of the "ADD" instruction.
 
Hello guys how are you?

Basically, I want when a psychical input is switched ON (circuit closed) an addition or a counter to add +1 to an integer, no matter how long it is on. Every 5 sec the integer will be reset back to 0.

I managed to do this, however I can't get the first part right, the addition is too fast and I can't figure a way to slow it down


What software are you using? I think Mickey is assuming you are using AB.
 
Mickey has highlighted a major difference in the way different instructions are executed.

For example....

ADD, SUB, are executed EVERY TIME they are scanned. The math instruction will be performed if the rung is true.

CTU, CTD, take notice of the current and previous rung condition, and will only perform the requested operation if the rung has changed from false to true.

It is too easy to think the instruction does what it says - you have to know how each instruction responds to it's environment.

All the relevant detail is in the Help for each instruction - I haven't found any of the Help documentation that doesn't answer a question like yours, it just needs reading carefully.

If there is anything you are not clear on, post back
 
I think it sounds like what you want is to debounce the input, as the incorrect counting could be from "contact chatter". As above, use an ADD instruction with a 1-shot (mindful of the provisos above) or else use a counter instruction to actually accumulate pulses. You can debounce as follows:

1. Do not energise the counter input until the physical input has been on for a minimum time (say 5ms). If the input turns off for less than this time then that input is ignored - such signals are characteristic of noise.
2. Once on, do not turn off until the physical input has been off for a minimum time (say 5ms) - again, such flickering is more than likely noise rather than a real signal.
 
Sorry, forgot about that, I am using RSLogix 500 :) Thanks for the replies.

I did it with the count up method, and it worked. Thank you! ;p
 

Similar Topics

What is the raw count of Allen Bradley Flex Analog Output Module 5094-OF8 raw count?
Replies
1
Views
142
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
181
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
323
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
607
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
827
Back
Top Bottom