Author Topic: time delay on relay release  (Read 9839 times)

temp

  • Newbie
  • *
  • Posts: 1
  • I'm a llama!
    • View Profile
time delay on relay release
« on: June 18, 2005, 08:09:49 AM »
On the T100MD I close and open a relay at a certain frequency as follows:

if pulseperiod(1) < 33000 then
  setio  out1
else
  clrio out1
endif

how do I insert a delay (say 5 seconds) before the relay releases?  I need a certain amount of hysteresis in the circuit.
 

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:time delay on relay release
« Reply #1 on: June 20, 2005, 03:42:56 PM »
You can use Out1 to trigger a timer (lets call it T1)

Then before you execute the CLRIO statement, perform a check:

.....
ELSE
   IF TESTIO(T1) = 1
            CLRIO OUT 1
   ENDIF
ENDIF

This way, OUT1 will not be cleared  unless T1 contact closes.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS