Rockwell Automation Publication 1789-UM002K-EN-P - January 2015
157
Program Windows Events to Monitor and Change Controller Execution
Chapter 8
On Error GoTo noHandle
ErrorCodeEvent1 = 0
hOutbound(0) = CreateEvent(ByVal 0&, 0, 0, "SOFTLOGIX_01_SHUTDOWN")
ErrorCodeEvent1 = Err.LastDllError
hOutbound(1) = CreateEvent(ByVal 0&, 0, 0, "SOFTLOGIX_01_PROGRAM")
ErrorCodeEvent1 = Err.LastDllError
hOutbound(2) = CreateEvent(ByVal 0&, 0, 0, "SOFTLOGIX_01_RUN")
ErrorCodeEvent1 = Err.LastDllError
hCounter = CreateEvent(ByVal 0&, 0, 0, "Counter")
ErrorCodeEvent1 = Err.LastDllError
If ErrorCodeEvent1 <> 183 Then '183 = Event already exists which is OK
'handle error
End If
noHandle:
End Sub
Private Sub Form_Unload(Cancel As Integer)
CloseHandle (hCounter)
CloseHandle (hOutbound(0))
CloseHandle (hOutbound(1))
CloseHandle (hOutbound(2))
End Sub
Private Sub pbCounter_Click(Index As Integer)
Dim ErrorCodeEvent1 As Long
SetEvent (hCounter)
ErrorCodeEvent1 = Err.LastDllError
If ErrorCodeEvent1 Then
'Handle error
End If
End Sub
Private Sub Timer1_Timer()
Dim inMode As Long
Dim ErrorDescription As String
inMode = WaitForMultipleObjects(3&, hOutbound(0), False, 0)
Select Case inMode
Case WAIT_OB 2
Label3.BackColor = &HFF00&
Label3.Caption = "Run Mode"
Case WAIT_OB 1
Label3.BackColor = &HFF8080
Label3.Caption = "Program Mode"
Case WAIT_OBJECT_0
Label3.BackColor = &HFF00FF
Label3.Caption = "SHUTDOWN Mode"
Case Else
Label3.BackColor = &HFFFFFF
Label3.Caption = "Other Mode"
End Select
End Sub
Содержание SoftLogix 5800
Страница 1: ...SoftLogix 5800 System Catalog Numbers 1789 L10 1789 L30 1789 L60 User Manual...
Страница 4: ...4 Rockwell Automation Publication 1789 UM002K EN P January 2015 Summary of Changes Notes...
Страница 104: ...104 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 5 Configure and Use Simulated I O Notes...
Страница 110: ...110 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 6 Execute External Routines 9 Click OK...
Страница 148: ...148 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 7 Develop External Routines Notes...
Страница 256: ...256 Rockwell Automation Publication 1789 UM002K EN P January 2015 Appendix E System Performance Tuning Guidelines Notes...
Страница 262: ...262 Rockwell Automation Publication 1789 UM002K EN P January 2015 Appendix G SoftLogix 5800 Revision History Notes...
Страница 270: ...270 Rockwell Automation Publication 1789 UM002K EN P January 2015 Index...
Страница 271: ......