Both inputs on at the same scan...?

yairtzur

Member
Join Date
Mar 2014
Location
Mexico City
Posts
5
Hey guys,

I'm pretty new to all that PLC stuff.
I wonder how I can check wether 2 inputs just became positive.
For example, I/0 AND I/1 are on in the same scan.
I want to check if they became on this scan and power an output as long as they're both still on.
But, if one of them is on without the other, or they're both on but didn't do this in the same scan, I don't want to power that output.
I hope my explanation is clear enough. If not, I will try again.

Thanks,
Yair.
 
There is more than a single "scan" involved. The I/O status is typically serviced as part of the PLC's overall logic solving sweep, but Remote I/O updates the CPU's I/O image table asynchronously from the program sweep. Then there is filter time associated with the input points themselves at the module level. If you are attempting to detect very quickly changing input status, then the typical PLC is probably not fast enough for your application.
 
Even a 1/10 of a second is ok for me.
What I want exactly is this:
I have 2 sensors. If one turns on and then the other (with difference of, say, a second) it's fine with me.
If both of them turn on at the same time (or with 0.1 sec, so be it) i want it to activate an output (alarm, for example).
That alarm should stay on as long as both of the sensors are still on. when one turns back off, that's fine with me (and the other one can again turn on).
When they both turn off - I want to check again wether they turn on simultaneously or one after the other (or not at all).

I'm a real newbie with PLCs so I want to get the idea and practice my applications before actually spending money and wasting time with the real deal.

Thanks!
 
Something like this should do the job. To test it, in Program mode, I turned on both Input switches, then switched to Run mode. Otherwise in Run mode, if 1 switch is first turned on without the other, the Output never goes on.

Of course in real life, things are a little messier. You might find it impossible to EVER have both switches on at the exact same time. In that case, you would have to use two 1-second timers to create a "window" within which both switches ON is valid.

2 INPUTS ON AT SAME TIME- Yairtzur.jpg
 
Last edited:
As Bit_Bucket explained, two inputs transitioning to ON during the same scan doesn't necessarily mean they turned on simultaneously.

This is an interesting exercise though. Here's my (untested) attempt...

|   I/1       I/2
|---] [-------]/[---+------------(A)
| |
| I/1 I/2 |
|---]/[-------] [---+
| |
| I/1 A |
|---] [---+---] [---+
| |
| I/2 |
|---] [---+
|
| A I/1 I/2
|---]/[---+---] [-------] [------(B)
| |
| B |
|---] [---+

In the first rung, if one input is on without the other, A turns on, and gets latched. It remains latched until both inputs become false.

In the second rung, B will be turned on if both inputs are on, but only if A isn't latched. This prevents B from turning on if the additional input goes true on a later scan. B will remain on until one or both inputs turn off. If only one turns off, A will get latched during the next scan by the previous rung, and inhibit B from turning back on. Both inputs must become false before B can turn on again.

Like I said, this is untested. You will have to test it.

I hope this is not an attempt at anti-tie down logic (two-hand control). A PLC is not a safety device.

🍻

-Eric

EDIT: I see Lancie beat me once again... :ROFLMAO:
 
EDIT: I see Lancie beat me once again...
But yours is better!

I suspect that Yairtzur will need to add some timers. Without a 1 or 2 second window, that output may become old and gray before it ever gets to party.
 
Thank you, Lancie1 and Eric Nelson!
Both of your solutions did the job.
I need to start getting it and doing it myself without help...

Another thing - that PLC simulator of this very site doesn't let my address the (L) with A/#. I just can't type A when trying to give it this address.
Does it happen to me only? Or is that a known bug?

Thanks again!
Yair.
 
Because the PLCtalk simulator is limited to the speed of the internet connection, it sometimes does not work correctly due to the delay between events.

You can get your own free copy of LogixPro good for 20 days from http://www.thelearningpit.com/ (I do not work for Bill Simpson or get any pay for saying this).

EDIT: I see that he moved the free period down to 15 days.
 
Last edited:

Similar Topics

Hello All, Our contrologix PLC lost its memory and after after doing a download everything was back to normal, except that two E3 relays devices...
Replies
0
Views
1,435
Hello, My laptop was rebooted lost 500 & 5000 tried to re-install but need to activate, need help badly, Thanks
Replies
1
Views
773
Dear experts, I have the following setup: CPU-313C (6ES7313-5BF03-0AB0 V2.6) + CP343-1 (6GK7343-1EX30-0XE0 V2.0) communicating with Siemens PC...
Replies
7
Views
2,685
Has the thinking changed on the grounding of shields on analog instrumentation cables? A friend recently attended some company training on...
Replies
12
Views
5,203
Should I ground both sides or just one side? I've been recommended both ways. What I am interested in is reasons/arguments pros/cons if you were...
Replies
15
Views
4,732
Back
Top Bottom