Specifications
5 - 18
Private Sub cmdMonitor_Click()
If tmrTime.Interval = 0 Then 'Confirm whether it is in process of monitoring or not
tmrTime.Interval = MonitorTime 'Execute the monitoring
txtStatus.Text = "Monitoring" 'Display the Monitoring message
cmdMonitor.Caption = "Monitor stop" 'Change the button display
cmdClose.Enabled = False 'Disable the Close button
Else
tmrTime.Interval = MonitorTime 'End the monitoring
txtStatus.Text = "Monitoring was stopped. " 'Display the Monitor was stopped message
cmdMonitor.Caption = "Monitor start" 'Change the button display
cmdClose.Enabled = True 'Enable the Close button
End If
End Sub
Private Sub cmdEnd_Click()
End 'Program end
End Sub
Private Sub tmrTime_Timer()
Dim i As Integer 'Variable 1 for loop
Dim j As Integer 'Variable 2 for loop
Dim k As Integer 'Variable 3 for loop
Dim szDeviceList As String 'For monitor device storage
Dim Devbox(12) As String 'For monitor device temporary storage
Dim lData(12) As Long 'Monitor device value storage
Dim lRet As Long 'Return value
Const lSize As Long = 13 'Number of devices to be monitored
'Set device to be monitored
Devbox(0) = "X0"
Devbox(1) = "X1"
Devbox(2) = "X2"
Devbox(3) = "X3"
Devbox(4) = "X4"
Devbox(5) = "X5"
Devbox(6) = "X6"
Devbox(7) = "X7"
Devbox(8) = "D0"
Devbox(9) = "D1"
Devbox(10) = "D2"
Devbox(11) = "D3"
Devbox(12) = "D4"
For i = 0 To lSize - 1
szDeviceList = szDeviceList + Devbox(i) 'Set the device to be monitored
If i <> lSize Then
szDeviceList = szDeviceList + vbLf
End If
Next