RobotStudio event

connect trap

Hello,

Did anyone have the experience that write the code which connect the interrupt in the event routine PowerOn. as the following code.

 VAR intnum intPressRight:=0;
  PROC PowerUp()
    IDelete intPressRight;
    WaitTime 0.5;
    CONNECT intPressRight WITH tPressRight;
    ISignalDI diRightButton, high , intPressRight;
    IWatch intPressRight;
  ENDPROC

in a normal routine it works,but while i set this routine associated to a event routine PowerOn it doesn't work. What the problem?

 

Peter

Comments

  • 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?

    RussD2007-6-9 3:6:3
    Russell Drown
  • RussD,

    in sys.cfg:

    #
    CAB_EXEC_HOOKS:

          -Routine "PowerUp" -Shelf "POWER_ON" -Task "T_ROB1" -AllTask  

    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.

     

    Peter_ABB2007-6-9 16:29:0
    Peter
  • 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.

    What happens if you remove -AllTask?

    RussD2007-6-9 19:15:35
    Russell Drown
  • Yes, IRC5 ROBOTWARE_5.08.0176   entered the parameter entry manually. 

    after removed -AllTask it doesn't work too ( tested in a RobStudio virtual controller). i 'll try it again in a true robot.

    Peter_ABB2007-6-11 14:59:13
    Peter