' Class MultiInputTrigger
#RaisesSynchronousEvents: PullTheTrigger
#RaisesSynchronousEvents: tmrTimeOut_Tick
Sub Class_Globals
Private oCallback As Object
Private iTriggers As Int
Private sEventName As String
Private tmrTimeOut As Timer
End Sub
'Initialize the object.
Public Sub Initialize(Callback As Object, EventName As String, TriggerQty As Int, TimeOutmSecs As Int)
' <EventName>_Trigger is the Event to be called.
' TimeoutEvent is the event To call back To If the trigger fails To take place within the Timeout interval.
oCallback = Callback
sEventName = EventName
End Sub
' Call back to the Event to be Triggered
Private Sub PullTheTrigger
' Some code ...
' Call the Event
CallSub(oCallback, $"${sEventName}_Trigger"$)
End Sub
' If the timer times out do this
Private Sub tmrTimeOut_Tick
' Stop the TimeOut timer
tmrTimeOut.Enabled = False
' Some code ...
' Call back to TimeOutEvent
If Not(IsPaused(oCallback)) Then CallSub(oCallback, $"${sEventName}_TimeOut"$)
End Sub