What do you mean it doesn’t work? It doesn’t execute or it fails with an error? BTW, you don’t need IWatch, the interrupt should be enabled by the preceeding code.
What are your parameter settings for calling this routine in PowerOn?
It doesn’t execute .because while execute instruction IWatch it will appear error: no trap connected. ( i know Iwatch doesn’t necessary)
I think if connect the trap in the event routine PowerOn. some times if the conditions met the PP will start from the trap routine but not in the main rouitne. system may forbid this situation occuring while powerOn restart.
Is this an IRC5? If so, did you enter the PowerUp parameter entry manually, or through RobotStudio Online?
According to the IRC5 documentation, and as I verified with 5.09 RSO, -Task and -AllTask are mutually exclusive, i.e. you can specify a task name OR you can specify AllTask, but not both. The same rule probably applies to S4 as well, but I haven’t confirmed that.