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 *
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