Jump to content

timer or loop?


Recommended Posts

I'm extremely new to ladder logic and I've run into a problem with my first program. For safety sake, I need to ignore input "1" while input "2" is high and then do the opposite, ignore input "2" while input "1" is high. Both situations need only occur for 500ms, then look for the opposite input again. I can make a timer to ignore one input, but my second timer disables the process from functioning. Thanks in advance for any help.

Link to comment
Share on other sites

  • External Moderators

500 ms is the time of the pulses of SB3.

My way:

First send the value of Inputs to Memory Bits but only when you want:

 SB3  I1   I0      MB0
--| |--|/|--| |-----( )
 SB3  IO   I1      MB1
--|/|--|/|--| |-----( )

Then use MB0 and MB1 instead of I0 and I1 in your application.

Link to comment
Share on other sites

500 ms is the time of the pulses of SB3.

My way:

First send the value of Inputs to Memory Bits but only when you want:

 SB3  I1   I0      MB0
--| |--|/|--| |-----( )
 SB3  IO   I1      MB1
--|/|--|/|--| |-----( )

Then use MB0 and MB1 instead of I0 and I1 in your application.

I don't think that's quite what he had in mind - Perry, what do you mean when you say "Ignore input 1 while input 2 is high"? Do you mean that for 500 ms after input 1 goes high, all signals from input 2 are ignored? And, similarly, after that, for 500 ms after input 2 goes high, all signals from input 1 are ignored? If so, you're looking at something more like this:

 MB1                 T1
--| |---------------(0.50)
 MB2                 T2
--| |---------------(0.50)

 I1   MB2           MB1
--| |-+-|/|-+--------( )
     |     |
     | T2  |
     +-| |-+

 I2   MB1           MB2
--| |-+-|/|-+--------( )
     |     |
     | T1  |
     +-| |-+

For example - if I1 comes on with I2 off, then MB1 immediately comes on, which prevents I2 from turning MB2 on.

However, T1 also starts timing, and after 500 ms, will allow I2 to turn on MB2. At that point, whenever I2 turns on,

it will turn on MB2 (which will keep I1 from turning on MB1).

Note that if I1 turns on and stays on, then after 500ms I2 turns on, MB2 will come on and MB1 will turn off for the next 500 ms, at which point MB1 will turn on again, and MB2 will turn off. If you were looking more for a circuit which would ignore the _entire time_ I2 was on if it came on within 500 ms of I1 turning on, you'd want something more like this:

 
 MB1                 T1
--| |---------------(0.50)
 MB2                 T2
--| |---------------(0.50)


 I1   MB2           MB1
--|P|-+-|/|-+--------(S)
     |     |
     | T2  |
     +-| |-+
 I1                 MB1
--|/|----------------(R)



 I2   MB1           MB2
--|P|-+-|/|-+--------(S)
     |     |
     | T1  |
     +-| |-+
 I2                 MB2
--|/|----------------(R)

Here, if I1 comes on, for the next 500 ms I2 will be ignored, and if I2 stays on after the 500 ms, it will still be ignored. Only if I2 changes from OFF to ON after the 500 ms has elapsed will MB2 come on, disabling MB1.

Link to comment
Share on other sites

What I'm trying to accomplish is have the PLC ignore any possible backlash from a limit switch. I1 is CW triggering from the limit switch and I2 is CCW triggering from the limit switch. It is possible as this switch gets worn that it can hit the CCW contacts after rebounding from the CW direction and it can do the opposite (hit the CW contacts after rebounding from the CCW direction). So I'm just trying to build a timer to ignore opposite inputs for the short time the limit switch arm returns to center neutral.

It appears to me that Phil's first example will accomplish this??

What I'm still a little fuzzy on is the duration that the timer coil remains latched after the delay has timed out. Are the contacts on the respective timer closed for one scan after the time out or are the contacts latched until the timer is reset again?

Link to comment
Share on other sites

  • MVP 2023

The default timer, type TD, has contacts that close when it times out and they stay closed until power is removed from the timer or it is reset with an -® coil referenced to the timer's address.

I would look at the timed pulse for this application, type TE. This timer closes it's contact immediately for the preset amount of time, and then goes off until power is removed from the timer. If the timer is re-triggered while it is "busy", it will not restart. Set the timer's preset for the amount of time you want to debounce the limit switch input, and trigger the timer with that input. Then use the timer's contact in your program.

Look at the Help topic Timers(T) for a good explanation of all the timer types and how they work.

Joe T.

Link to comment
Share on other sites

The default timer, type TD, has contacts that close when it times out and they stay closed until power is removed from the timer or it is reset with an -® coil referenced to the timer's address.

I would look at the timed pulse for this application, type TE. This timer closes it's contact immediately for the preset amount of time, and then goes off until power is removed from the timer. If the timer is re-triggered while it is "busy", it will not restart. Set the timer's preset for the amount of time you want to debounce the limit switch input, and trigger the timer with that input. Then use the timer's contact in your program.

Look at the Help topic Timers(T) for a good explanation of all the timer types and how they work.

Joe T.

I don't see a TD or TE in the M91 timer list. This simple PLC must not have the full list of functions.

Link to comment
Share on other sites

  • MVP 2014

Hello Perry,

I think Joe is referring to the timers in Visilogic, since this is in fact the Visilogic forum. The M91 series PLCs (and u90Ladder software) have a much simpler configuration.

EDIT: this thread has now been moved to the u90 Ladder forum.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...