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  )
        THEN
              PulseDO \Plength:=0.5, Out_100;
        ENDIF
        RETURN;
ENDTRAP

Also here is the movement where the detection is needed:
 IWatch trpInsertionCheck;
            bCheckInsertSens:=TRUE;
            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.



Tagged:

Comments

  • lemster68
    lemster68 ✭✭✭
    You should be doing a search.
    Lee Justice
  • lemster68 said:
    You should be doing a search.
    But the SerchL instruction returs posititon. It useless for our purpose...
  • Why   ( DI1= high OR DI1= high  )   in trap rutine ?
    Regards
    Knud Erik Lindberg
    Jorgensen Engineering
  • 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