Sub TrackPort(portnum As Byte)
Log("Tracking post started:", portnum)
Switches(portnum) = 0 'start of counting
Select portnum
Case 0
CallSubPlus("PostCheckPort0", WaitLimitSec * 1000, portnum)
Case 1
CallSubPlus("PostCheckPort1", WaitLimitSec * 1000, portnum)
Case 2
CallSubPlus("PostCheckPort2", WaitLimitSec * 1000, portnum)
Case 3
CallSubPlus("PostCheckPort3", WaitLimitSec * 1000, portnum)
Case 4
CallSubPlus("PostCheckPort4", WaitLimitSec * 1000, portnum)
Case 5
CallSubPlus("PostCheckPort5", WaitLimitSec * 1000, portnum)
End Select
End Sub
Sub PostCheckPort0(tag As Byte)
'time is out, it needs to check the ventile state
Log("PostCheckPort0: ", tag)
If Switches(tag) < 2 Then ' ventile trouble
webapi.Send_Ventil_Fault(tag + 1) 'number of channel starting 1
Else
Log("Switched OK !: ", tag)
End If
End Sub
Sub PostCheckPort1(tag As Byte)
'time is out, it needs to check the ventile state
Log("PostCheckPort1: ", tag)
If Switches(tag) < 2 Then ' ventile trouble
webapi.Send_Ventil_Fault(tag + 1) 'number of channel starting 1
Else
Log("Switched OK !: ", tag)
End If
End Sub
Sub PostCheckPort2(tag As Byte)
'time is out, it needs to check the ventile state
Log("PostCheckPort2: ", tag)
If Switches(tag) < 2 Then ' ventile trouble
webapi.Send_Ventil_Fault(tag + 1) 'number of channel starting 1
Else
Log("Switched OK !: ", tag)
End If
End Sub
Sub PostCheckPort3(tag As Byte)
'time is out, it needs to check the ventile state
Log("PostCheckPort3: ", tag)
If Switches(tag) < 2 Then ' ventile trouble
webapi.Send_Ventil_Fault(tag + 1) 'number of channel starting 1
Else
Log("Switched OK !: ", tag)
End If
End Sub
Sub PostCheckPort4(tag As Byte)
'time is out, it needs to check the ventile state
Log("PostCheckPort4: ", tag)
If Switches(tag) < 2 Then ' ventile trouble
webapi.Send_Ventil_Fault(tag + 1) 'number of channel starting 1
Else
Log("Switched OK !: ", tag)
End If
End Sub
Sub PostCheckPort5(tag As Byte)
'time is out, it needs to check the ventile state
Log("PostCheckPort5: ", tag)
If Switches(tag) < 2 Then ' ventile trouble
webapi.Send_Ventil_Fault(tag + 1) 'number of channel starting 1
Else
Log("Switched OK !: ", tag)
End If
End Sub