RobotStudio event

Event routine not starting

Hello, 

I am having some trouble with event routine. The routine itself is as follows:

MODULE user (SYSMODULE)

 
    VAR wzstationary worldzone1;
    VAR wzstationary worldzone2;

    VAR num testnum:=0; 
    
    
    PROC WZPos()
      VAR shapedata shape1;
      VAR shapedata shape2;
      
      CONST pos corner1:=[455,200,650];
      CONST pos corner2:=[1050,-600,1100];
      CONST pos corner3:=[350,150,150];
      CONST pos corner4:=[1000,-150,600];
      

      testnum:=5; 
     
  
      WZBoxDef \Inside,shape1,corner1,corner2;
      WZDOSet \stat,worldzone1 \Inside,shape1,doBusySlabi,0;
      WZBoxDef \Inside,shape2,corner3,corner4;
      WZDOSet \stat,worldzone2 \Inside,shape2,doBusyTrak,0;
                  
    ENDPROC 
ENDMODULE
     
The problem is that the routine WZPos doesn't start. I think the worldzones are defined correctly, but the routine itself doesn't execute. It is linked with a POWER_ON event in controller configuration (see attachment).

Does someone know what could be the reason for this happening?

Thank you for all your help,
Regards      

Comments

  • Try to call the routine after boot up.  See if you get an error more or less like "world zone already in use or activated".
    Lee Justice
  • jled
    jled
    edited October 2019
    I tried and that is exactly what happens.
  • OK, so that tells us that it did run.  You need to get motors on for the system to recognize the zones.
    Lee Justice
  • Thank you very much!  :)