Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Timer issue.


utemorley2012 Sep 29, 2014 05:52 PM

All,

I am attempting to develop a Timer to control when a flag is recorder for a daily calibration. However, My timer option does not seem to be working. Any suggestions?


If IfTime (0,60,Min) Then
Cal_450=true
Cal_Flag=true
Cal_Timer=Timer(1,Min,0)
EndIf
If IfTime (15,60,Min) Then
Cal_70=true
EndIf
If IfTime (30,60,Min) Then
Cal_Zero=true
EndIf
If Cal_450=true Then
ModbusMaster (Result_Coil,Socket703,115200,Slave703,5,Cal_450,01,1,2,50,1)
If Result_Coil=0 Then
Cal_450=False
EndIf
EndIf
If Cal_70=true Then
ModbusMaster (Result_Coil,Socket703,115200,Slave703,5,Cal_70,02,1,2,50,1)
If Result_Coil=0 Then
Cal_70=False
EndIf
EndIf
If Cal_Zero=true Then
ModbusMaster (Result_Coil,Socket703,115200,Slave703,5,Cal_Zero,03,1,2,50,1)
If Result_Coil=0 Then
Cal_Zero=False
EndIf
EndIf

If Cal_Timer >= 45 Then
Cal_Flag = False
Cal_Timer=Timer (1,Min,3)
EndIf

* Last updated by: utemorley2012 on 9/29/2014 @ 11:53 AM *


JDavis Sep 29, 2014 07:25 PM

It looks like you writing the current value of your timer apart from where you started and stopped it.

Try the following:

Cal_Timer=Timer(1,Min,4)
If Cal_Timer >= 45 Then
Cal_Flag = False
Cal_Timer=Timer (1,Min,3)
EndIf

Log in or register to post/reply in the forum.