Ladder logic - if input is held constant for x time

Thread Starter

nanok66

Joined Jul 14, 2016
75
Hi, I am new to PLC's and ladder logic. I am looking to find a solution how to program an output to only trigger if an input has been constantly held for longer than 2 seconds.

Just to give the example, it is for a water level sensor that may oscillate with sloshing water and cause false triggers. I want to know when the water is fully below the level sensor ie - when the sloshing stops and the sensor has been in a constant state for a longer period of time (>2 seconds).

I would ideally want any changing signal to restart the 2 second timer so oscillations could never fool the logic.

Any help is appreciated!
 

Thread Starter

nanok66

Joined Jul 14, 2016
75
I guess I'm just not familiar with the language yet. Using raspberry pi with OpenPLC.

No second timer here I was just describing my problem in more detail with my last paragraph. Yeah it does seem simple but I don't believe any of the basic ladder logic examples I've seen cover this scenario. If you guys even had a good reference for me to read more I'd be open to it. I'll keep searching in the meantime.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
I am only familiar with the standard Commercial PLC's, Idec, Mitsubishi, Allan-Bradly, Omron, Fanuc etc.
You set a timer to run via a sensor input and it only times out if the sensor remains steady for a period, e.g. 2sec.
Unless I am missing something?
I am not familiar with Raspberry-Pi.
Max.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
If I were doing this in a Micro controller I would set up a 2 sec timer and use an interrupt on input for the sensor and start the timer, any subsequent inputs by the sensor before the timer had timed out would re-set it, and start the process over.
Max.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
Why do you need 2 timers?
That would only be the case if a retentitive timer was used?
If the sensor X0 turns off before 2 seconds, a normal timer is reset.
Max.
 

hjtrbo

Joined Jul 3, 2015
2
You don't understand my logic...

Its a timer based deadband with (standard, any PLC brand) non retentive time delay timers.
When the PLC is first powered up, y0 is off
When x0 has been on for at least 2 seconds (t0), y0 is on.
When x0 has been off for at least for 2 seconds (t1), y0 is off.
 
Last edited:

Thread Starter

nanok66

Joined Jul 14, 2016
75
Cool I think I just need to explore the PLC software I'm using a bit more. You guys have great input and I think this should be enough to figure it out in my software.
 
Top