Author Topic: A simple CALL DELAY COUNTER dCuFu question  (Read 6538 times)

cch1955

  • Full Member
  • Posts: 198
  • Automated Machine Systems Designer
    • View Profile
A simple CALL DELAY COUNTER dCuFu question
« on: February 27, 2008, 10:18:21 AM »
Great One:

I have a dCuFu that has a DELAY of 1000 in it to allow process time before executing some actions. It is a bad way to do it, but it was handy.

I have an input bit in ladder changing state in real time which decrements a standard counter.

Am I right in my understanding that during the time the DELAY is counting down in the CALLED dCufu the counter will not decrement (ladder scan stops while called function executes) and pulses on the input would be lost until the DELAY is finished?

I know I could used a HSC or and Interrupt input to resolve this if it is the case , but can handle it another way if my understanding is correct.

Thanks.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:A simple CALL DELAY COUNTER dCuFu question
« Reply #1 on: February 27, 2008, 12:36:44 PM »
Yes, when you use the DELAY function the PLC simply pause there until the delay period expires. Only interrupt and communications are working during this period but other parts of the ladder program will not be processed.

You can always start a timer within the custom function. E.g.

  TIMERPV[1] = 10   ' start a 10 second timer

So when the timer times out its contact is used to trigger another custom function to continue your program.

You may need to clear the contact  of the timer after execution of the timer-triggered CF. A simple CLRIO can accomplish it easily.

The following FAQ thread shows you how to start a timer within a custom function:

http://www.tri-plc.com/yabbse/index.php?board=2;action=display;threadid=1046
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

cdenk

  • Full Member
  • Posts: 161
  • newbie
    • View Profile
Re:A simple CALL DELAY COUNTER dCuFu question
« Reply #2 on: March 01, 2008, 06:11:31 AM »
Agree with the previous post, plus I think most programs do not use anywhere all the timers that are available, use what's available. The timer can be named, and while watching online monitoring, you can watch it counting down, or even test for an intermediate value to set a warning.