Skip to main content

Can I execute a PRACTICE script on a specific event? - Knowledgebase / PRACTICE - Lauterbach Support

Can I execute a PRACTICE script on a specific event?

You can use the command ON or GLOBALON for this. ON is suitable when there is still an active PRACTICE script controlling your test case. GLOBALON is suitable if you want a reaction on an event until you disable it again.

The general syntax is: ON|GLOBALON  < event > < action >

Please refer to the description of the ON and GLOBALON commands respectively in the General Commands Reference Guide O and General Commands Reference Guide G for more information on the supported events and actions.

To disable the event handler, use ON|GLOBALON < event > inherit

Examples:

1. Execute a PRACTICE script when the program execution is stopped:

 GLOBALON PBREAK DO myscript.cmm

2. Continue the PRACTICE script execution when an error happens:

 ON ERROR CONTinue

3. Execute the subroutine powerup_handler when target power is switched to on:

 ON POWERUP GOSUB powerup_handler



Helpful Unhelpful