Need to inhibit an INPUT if it was the last INPUT...

themaze

Member
Join Date
Feb 2021
Location
Atlanta
Posts
3
Question-

Say I have 8 digital INPUTS to my PLC, any of which may be asserted HIGH for a few seconds, all these inputs "OR'd", currently, to produce a 1 second OUTPUT pulse, to show general activity in my plant. Say further that activity is fairly quiet and the same input is the ONLY input asserting itself multiple times in a row...

I'd like to somehow inhibit any input from causing an output pulse IF it was the LAST input to have created an output pulse.... I.e., I don't want any one input to cause an output if it isn't preceded by an input other than itself... Once any other input causes an output, the inhibited input can rejoin the fun...

Any simple ideas?


https://ibb.co/9HNnBXR

Many thanks!
 
Last edited:
  • send each of the 8 inputs' rising edges to a unique bit of integer1.
  • keep a second integer, integer2, that has the last bit that had a rising edge.
  • if integer1 is non-zero AND integer1 is different than integer2, then an input other than the [last input to have a rising edge] has become 1
the "integer1 is different than integer2" test might need to be to be more complex than [integer1 <> integer2] to handle the case where two discrete inputs have a rising edge at the same time.

but otherwise I think this is about as simple and concise as it can get.

Update:

Alternative, becasue it does not need to be bits (and the environment is not stated so I'll go with ladder):
Code:
   inp1
---] [---[NEQ               ]---[P]---[MOV              ]---
         [SourceA  last_edge]         [Source          1]
         [SourceB          1]         [Dest    last_edge]
  • last_edge is an integer
  • similar for inp2 (put 2 in last_edge), inp3, etc.
  • ---[P]--- is rising edge
  • Trigger pulse when last_edge changes.
  • Again, this might need some special handling for edge cases, but I think putting the ---[P]--- after the NEW takes care of that.

A TOF timer might be of use here.
 
Last edited:
drbb, l am concerned for your mental health, are you a PLC junky (if you are, which l think you are) do you do anything else than look at this forum.
Now l think you are doing the PLC industry a great service by supporting them as l see you have moved onto to other products than AB, but to put the amount of effort and time you do into any question posed by anyone, it concerns me.
One thing about it you will be the fastest poster to 10,000 there has every been, unless you end up in the nut farm.
Don't get me wrong, if l needed help on a PLC l would be happy for you to answer it, but as l have said, you seem to be addicted and as we know you only learn't about them a bit over a year ago, your knowledge does astound me and as l have said before, are you sure your not your brother the PLC expert??????
Regards Kevin
 
Any simple ideas?


Many thanks!

Based on DRB's suggestion here is how it can be done in Siemens S7.
M12.0 is on for one scan so you can use this to start your timer.
Whilst it is for S7 I am sure you can convert it to use with whatever PLC you have.

Should have added - MB 10 is your input bits,

Capture.GIF
 
Last edited:
drbb, l am concerned ...


Thanks for your concern. I have had the same thoughts, even to the point of wondering if my activity here is annoying to others, esp. those more experienced than myself; I welcome any feedback there. And yes I almost certainly have an obsession with solving any problem that catches my eye, an addictive personality, and insomnia.


But I am sure that eventually this will lose its lustre. Also, I have a wonderful spouse who keeps me honest and interested in other things: the rudder for her boat, her delaminated Nordic ski, and our Rhodes Bantam dinghy aren't going to fix and/or restore themselves.


Thanks again.


Just let me know if I become a troll.
 
Last edited:
drbb, l am only jealousy of your intellect and your ability to nut the problem out and solve it.
Please don't loose your love of helping others with there PLC problems.
I love the way you are willing to help from a school exercise to problems that you have to work out yourself from the OPs thread which are very involved.

Keep up the great work, but if l can give one bit of advise, let the OP give some input, personally it ***** me when they ask a basic question (or even an in-depth one) then they intermittently if at all answer questions some time down the track.
PLC's and industrial processors are interesting, but there is way more to life, then you are dead.
My favourite saying that l didn't come up with is, " know one on there death bed ever said l wished l spent more time at work" l think a great point to think about.
I like that you have a war office that will hopefully drag you away from helping PLC people in need(because they are out of there depth) for some real time together.
Personnel l think to many people are playing with PLC's when they shouldn't be, imagine what would happen if this forum wasn't answering questions (well some people like yourself)
Have we had questions from nuclear power stations????????????????
 
If input and not output then
output = true
end if


And reset output after 5 second time


Why this would not work?
 
One approach

Caveats

  • The code is meant as a proof of concept and as shown handles only the first two inputs are shown: duplicate Rungs 0000/0001 for inputs 3-8; all other code remains unchanged
  • The code only detects rising edges, effecting clamping all input 1 bits to one scan duration.
  • If the first rising edge event after the program start is from both input bits on the same scan*, then no other edges will be detected until either the program is re-downloaded or N7:1 is changed in its low 2 bits. This is one of the edge cases mentioned in a previous post.
  • If a new bit comes on while the TOF is running, it will reset and restart the timer i.e. the lamp time will be extended.
* e.g. put a 3 into integer B3:0.


xxx.png
 
You're welcome.


Note that adding an [XIO T4:0/DN]* on the one-shot rungs changes the behavior, especially if input pulses overlap (e.g. see @LD's query). For example, a rising edge from inputM while an inputN-triggered TOF is timing

  • will not immediately restart the timer
  • if that inputM is still on when the inputN TOF is done, it will trigger another TOF run if that inputM
  • if that inputM is off when the inputN TOF is done, that inputM will be missed

* i.e. inhibit receipt of new pulses when the timer is timing.
 
drbb, l am concerned for your mental health, are you a PLC junky (if you are, which l think you are) do you do anything else than look at this forum...

Don't worry, Kevin, DrBitBoy just is just slightly more susceptible to Nerd Sniping than the rest of us.

DRB, keep on doing your thing, just watch out for semi-trailers (y)
 

Similar Topics

We are trying to poll data coming from a PLC for remote monitoring we have the IP address of the PLC and the default port number and the path is...
Replies
25
Views
424
The idea here is to provide for a brief rapid influx of message codes while preventing sequentially repeating the same message. i.e. if two...
Replies
23
Views
536
Hi all Trying to remotely connect to a TIA Portal PLC. I can ping it without a problem but can't get my software to connect. I've opened port...
Replies
8
Views
283
Hi all. That will be a stupid question for a lot of you guys. I'm talking with ProSoft support and he sent me an example late yesterday: XIC...
Replies
9
Views
331
Supposing I want to be put a TIA Portal Project "executable image" onto a memory card (e.g. see picture). The reason for doing this is so that I...
Replies
8
Views
327
Back
Top Bottom