You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old February 20th, 2021, 09:04 PM   #1
themaze
Member
United States

themaze is offline
 
Join Date: Feb 2021
Location: Atlanta
Posts: 3
Need to inhibit an INPUT if it was the last INPUT...

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 by themaze; February 20th, 2021 at 09:25 PM. Reason: adding pic
  Reply With Quote
Old February 20th, 2021, 09:18 PM   #2
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is online now
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 7,459
Brute force method:

Create this tag: Any_Input = Input1 OR Input2 OR Input 3, etc

Input1 latches an Input1_Anti_Repeat bit which is unlatched by Any_Input AND NOT Input1

Repeat for Input 2 through Input8
  Reply With Quote
Old February 20th, 2021, 09:25 PM   #3
themaze
Member
United States

themaze is offline
 
Join Date: Feb 2021
Location: Atlanta
Posts: 3
will try. thanks
  Reply With Quote
Old February 21st, 2021, 04:33 AM   #4
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,546
  • 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 by drbitboy; February 21st, 2021 at 05:03 AM.
  Reply With Quote
Old February 21st, 2021, 04:50 AM   #5
PLCnovice61
Member
Australia

PLCnovice61 is offline
 
Join Date: Apr 2015
Location: home
Posts: 317
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
  Reply With Quote
Old February 21st, 2021, 05:08 AM   #6
moggie
Lifetime Supporting Member
England

moggie is offline
 
moggie's Avatar
 
Join Date: Apr 2002
Location: Devon, England.
Posts: 636
Quote:
Originally Posted by themaze View Post

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,
Attached Images
File Type: gif Capture.GIF (8.4 KB, 93 views)

Last edited by moggie; February 21st, 2021 at 05:13 AM.
  Reply With Quote
Old February 21st, 2021, 05:13 AM   #7
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,546
Quote:
Originally Posted by PLCnovice61 View Post
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 by drbitboy; February 21st, 2021 at 05:33 AM.
  Reply With Quote
Old February 21st, 2021, 05:52 AM   #8
PLCnovice61
Member
Australia

PLCnovice61 is offline
 
Join Date: Apr 2015
Location: home
Posts: 317
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????????????????
  Reply With Quote
Old February 21st, 2021, 06:16 AM   #9
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,602
If input and not output then
output = true
end if


And reset output after 5 second time


Why this would not work?
  Reply With Quote
Old February 21st, 2021, 07:19 AM   #10
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,221
What is supposed to happen under the following conditions?
Attached Images
File Type: jpg 81.jpg (63.7 KB, 91 views)
__________________
S7-300 to 1500 conversions done - email to s7conversions@hotmail.com
  Reply With Quote
Old February 21st, 2021, 07:39 AM   #11
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,546
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
What is supposed to happen under the following conditions?



Yup, that's what I meant by edge cases: they change any code from clean to a rat's nest.


How about this:

xxx.png

Last edited by drbitboy; February 21st, 2021 at 08:04 AM.
  Reply With Quote
Old February 21st, 2021, 09:22 AM   #12
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,546
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
  Reply With Quote
Old February 21st, 2021, 06:52 PM   #13
themaze
Member
United States

themaze is offline
 
Join Date: Feb 2021
Location: Atlanta
Posts: 3
Dr Bit Boy- thanks! Your suggestion(s) will get me what I need.
  Reply With Quote
Old February 21st, 2021, 07:41 PM   #14
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,546
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.
  Reply With Quote
Old February 21st, 2021, 11:40 PM   #15
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 3,262
Quote:
Originally Posted by PLCnovice61 View Post
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
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Input leds on/off REHJ LIVE PLC Questions And Answers 3 June 17th, 2016 04:06 PM
FactoryTalk View SE Numeric Input Focus zacslade LIVE PLC Questions And Answers 1 March 2nd, 2016 06:26 AM
Analog input / Analog Output - Twin CAT System tech007 LIVE PLC Questions And Answers 1 September 30th, 2011 06:21 PM
Analog Input Fluctuations Steve Etter LIVE PLC Questions And Answers 18 October 20th, 2004 07:34 AM
AB Analog Input Help GTX LIVE PLC Questions And Answers 2 December 14th, 2003 03:37 PM


All times are GMT -4. The time now is 09:22 PM.


.