mirzao
Active member
Hi everyone,
I would like to use the timer to capture the time while the temperature is in out of band condition but I don't know how to write the code. Let's say it will loop 10 times, but the out of band condition only occurs in loop 3 to 5, I want it to give the duration for how long it occurs. How can I do that? Thank in advance
If actualTemp(1) = 25.0 Then ' setting temp
'if temperature out of band
'if temperature out of band
I would like to use the timer to capture the time while the temperature is in out of band condition but I don't know how to write the code. Let's say it will loop 10 times, but the out of band condition only occurs in loop 3 to 5, I want it to give the duration for how long it occurs. How can I do that? Thank in advance
If actualTemp(1) = 25.0 Then ' setting temp
'if temperature out of band
If actualTemp(1) < (setTemp(1) - 5) Or actualTemp(1) > (setTemp(1) + 5)Then
ElseTimer.Start()
alarmCounter += 1
myTimer.Enabled =
alarmCounter += 1
myTimer.Enabled =
True
End If
'if temperature out of band
If actualTemp(1) < (setTemp(1) - 3) Or actualTemp(1) > (setTemp(1) + 3) Then
End If
End IfEnd If