Page 81 - Advantech WP-5530
P. 81
'Open Second Mode
iDrawer = Val(Text1.Text) 'Number of seconds 1 to 255
iRet = DeviceIoControl(DeviceHandle, ADV_WDOGSec_CTL_CODE, iDrawer, 4, 0, 0, iBytesRtn, SA1)
If (iRet = 0 Or iBytesRtn <> 1) Then
MsgBox("Error opening WDOG.sys. Error = " & Err.LastDllError)
End If
Timer1.Enabled = True
End Sub
Private Sub Command2_Click() 'Button2
Label2.Caption = 0
'Open Minute Mode
iDrawer = Val(Text1.Text) 'Number of minutes 1 to 255
iRet = DeviceIoControl(DeviceHandle, ADV_WDOGMin_CTL_CODE, iDrawer, 4, 0, 0, iBytesRtn, SA1)
If (iRet = 0 Or iBytesRtn <> 1) Then
MsgBox("Error opening WDOG.sys. Error = " & Err.LastDllError)
End If
Timer1.Enabled = True
End Sub
Private Sub Command3_Click() 'Button3
'Close Watch Dog
Text1.Text = 0
iDrawer = 0
iRet = DeviceIoControl(DeviceHandle, ADV_COLSE_CTL_CODE, iDrawer, 4, 0, 0, iBytesRtn, SA1)
If (iRet = 0 Or iBytesRtn <> 1) Then
MsgBox("Error opening WDOG.sys. Error = " & Err.LastDllError)
End If
Label2.Caption = 0
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Label2.Caption = Val(Label2.Caption) + 1
End Sub
74