There is no direct way to call a subroutine depending of a condition in a RSL program. This can however be done with a Python script.
You need to get a trigger in the python script and then call RSL subroutine from the Python script.
In this example the Python will get a Component Signal (which is
transferring the actual component handle to the script) and then the script
will call a subroutine in the RSL program which (in this example) has the same name as
the component.
Note also that preventing the RSL program to start with the simulation
and running the Main sequence, you need to select the RSL behaviour and
set it to action mode.
ActionMode = True
Here is the example of the Python script:
def OnRun():
comp = getComponent()
rsl = comp.findBehaviour("RSL")
while True:
triggerCondition(lambda: getTrigger() == signal )
name = signal.Value.Name
rsl.callRoutine(name)