Internet PLC Forum

General => Technical support => Topic started by: hamidraza on November 14, 2011, 01:12:56 AM

Title: timer in cust.func.
Post by: hamidraza 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.
Title: Re:timer in cust.func.
Post by: mijoe 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. :)
Title: Re:timer in cust.func.
Post by: support 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.
Title: timer present value
Post by: hamidraza 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.
Title: Re:timer in cust.func.
Post by: support 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.
Title: instantaneous value of timer
Post by: hamidraza 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.
Title: Re:timer in cust.func.
Post by: support 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.