RobotStudio event

Trap routine is not called

Hi all,

we need to make an update to control sensors during one movement. The controler has RobotWare ver.5 and it has no multitasking. So we used Trap routine to detect if the sensor switches on during movent.

Here is the definition of trap:
CONNECT trpInsertionCheck WITH CheckInsSensorTrap;
ISignalDI IN_InsertionVirtualCheck,1,trpInsertionCheck;

the input IN_InsertionVirualCheck is virtual cross connected signal. It was tested and it works OK.

The trap routine itself is:
 TRAP CheckInsSensorTrap
        IF ( bCheckInsertSens=TRUE ) AND
           ( DI1= high OR DI1= high  )
              PulseDO \Plength:=0.5, Out_100;

Also here is the movement where the detection is needed:
 IWatch trpInsertionCheck;
            MoveL RelTool(................................;
            bCheckInsertSens := FALSE;
            ISleep trpInsertionCheck;

Also there is no data in variable Trapdata in Program data/Used types. Trapdata is not shown in used variables...

So my question is: how can we detect the sensor during movement without TRAP or how can we setup the trap?

Thanks to all.



  • lemster68
    lemster68 ✭✭✭
    You should be doing a search.
    Lee Justice
  • cerminek
    lemster68 said:
    You should be doing a search.
    But the SerchL instruction returs posititon. It useless for our purpose...
  • Knud E Lindberg
    Why   ( DI1= high OR DI1= high  )   in trap rutine ?
    Knud Erik Lindberg
    Jorgensen Engineering
  • PerSvensson
    Probably the reason why the trap isn't executed is that the program pointer is ahead of the motion so the ISleep and bCheckInsertSens:=FALSE are already executed even if the robot is still moving , so one way is to synchronize the motion and program pointer and one way to do that is to have a fine point in the move instruction.
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering