When the Event Table executes code it will run it as a macro only. That is, the event table holds the simulation, runs the macro, then starts the simulation again.
So timed events will be lost when run from the Event Table.
The only way to get around this is to put timed events into a simulation-controller just like when simulating periferal equipment like an elevator or a door.
Like this:
Private Sub Controller_AfterTick(ByVal Time As Double)
If myTime > Time Then
'do stuff
End If
End Sub
:star:
You could also do this for an IO signal:
Private Sub Controller_AfterTick(ByVal Time As Double)
Dim myIO As IO
Set myIO = ActiveStation.ActiveMechanism.Controller.IOs(“do1”)
If myIO.Value = 1 Then
'do stuff
End If
End Sub
So fi you combine the two criteria you could have a timed event triggered by an IO signal in the simulation-controller.
I don’t agree with John that you can’t use the ccrp-timer together with the eventtable. If you set up a ccrp-timer you can enable and disable it from a macro that you trigg with a event in the eventtable. See the attached station how you can do it (start the macro “SpeedControl” in the Station). The attached station require that you have the ccrp-timer in your PC (it is also attached). Your problem could depend on that RS can’t find all your IOs (have happend me sometimes). To check that you can run this Macro (the IOs will be displayed in the Output window). A restart of the VC normally solves this.
Sub CheckIOs()
Dim VC As Controller
Dim IO As IO
Set VC = ActiveStation.ActiveMechanism.Controller
For Each IO In VC.IOs
Call ActiveStation.PrintLog(IOs, IO.Name)
Next
End Sub