Author Topic: timer in cust.func.  (Read 13671 times)

hamidraza

  • Newbie
  • *
  • Posts: 8
  • I'm a llama!
    • View Profile
timer in cust.func.
« on: November 14, 2011, 01:12:56 AM »
1)- how can in check a timer in cust. func. whether it is completed or not.(like testbit command)
2)-can i use the same timer in cust. func that was earlier used in ladder logic.

mijoe

  • Newbie
  • *
  • Posts: 3
  • I'm a llama!
    • View Profile
Re:timer in cust.func.
« Reply #1 on: November 14, 2011, 01:37:46 PM »
Hi there,

You can check if the timer has timed out like this:

IF TIMERPV[1] = 0 Then . . . .
You can also set the timer as follows:

TIMERPV[1] = 20      

Hope this is what you need. :)

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:timer in cust.func.
« Reply #2 on: November 14, 2011, 04:56:37 PM »
Thank you Mijoe.

Please also refer to this thread for some discussion:

http://www.tri-plc.com/yabbse/index.php?board=2;action=display;threadid=1046

You can also use SETIO, TESTIO and CLRIO to test the contact status of a timer.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

hamidraza

  • Newbie
  • *
  • Posts: 8
  • I'm a llama!
    • View Profile
timer present value
« Reply #3 on: November 14, 2011, 08:19:21 PM »
how can i access the timer accumulated/present value.
like if i set a timer for 10 sec. and i want to check whether now 5 sec. has been completed or not.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:timer in cust.func.
« Reply #4 on: November 14, 2011, 11:29:06 PM »
It is the same question as you have asked previously so we merged the topic. Please try not to start a new topic when you are asking the same or related question.

TIMERPV[n]  contains the timer present value for timer #n.

You can monitor the value of TIMERPV[n] if you run your program in a tight loop. Otherwise you can use the timer contact to trigger other events when timer times out.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

hamidraza

  • Newbie
  • *
  • Posts: 8
  • I'm a llama!
    • View Profile
instantaneous value of timer
« Reply #5 on: November 15, 2011, 09:01:47 PM »
how can i get the present/accumulated value of a timer.
i mean if i set a value of 10 sec. for a timer now i want to make a relay high when timer completed 7 sec. how can i get the instantaneous value of the timer.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:timer in cust.func.
« Reply #6 on: November 15, 2011, 09:46:22 PM »
You have asked the same questions 3 times and we can only give you the same answer 3 times.

TIMERPV[1] returns the present value of the timer #1.

The rest please refer to the previous posts in this thread.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS