RobotStudio event

World Zone

Hello everybody!!!
I have something wrong with my code that i don't find
I need some help, please.
I created a cylinder world zones, power on event routine, shapdata, CONST pos...

this is the code :

    !================================== VAR AUX WZ CILINDRO TRMPAL2 =============================
    VAR shapedata shpVZona_TRM2;
    CONST pos posCyl_TRM2:=[-4.9,20.0,-240];
    PERS num nRaioCyl_TRM2:=700;
    PERS num nAlturaCyl_TRM2:=3000;
    VAR wzstationary wzZona_TRM2;

    ! =============================================================================
    ! PROC rSegu_TRM2 em Event Rotine POWER ON
    ! =============================================================================
    PROC rSegur_TRM2()
        ! Actuada Pelo sistema  sinal de Power On/Restart
        ! Para Mudar variaveis alterar (.../...)
        ! e Reiniciar Sistema
        WZCylDef\Inside,shpVZona_TRM2,posCyl_TRM2,nRaioCyl_TRM2,nAlturaCyl_TRM2;
        WZDOSet\Stat,wzZona_TRM2\Inside,shpVZona_TRM2,doS_laser,1;
    ENDPROC

   ! =============================================================================
   ! FUNC bool verifica se estamos dentro de TRM2
   ! =============================================================================
    FUNC bool rVerPosSegurTRM2()
        IF DOutput(doS_laser)=0 THEN
            TPErase;
            TPWrite "=============================="+CDate();
            TPWrite "             what          ";
            TPWrite "=============================="+CTime();

            RETURN FALSE;
            TPErase;
            ! ENDIF
        ENDIF
 
        RETURN TRUE;
 routine Security;
        TPErase;
    ENDFUNC


People When robot is inside the cylinder they dont activate the output signal.. i try diferent values and output's and nothing else metters...
I think that is something wrong about the output acess bue i dont know.

I want when robot is inside the cilinder and something wrong hapness as like an waitinput signal that not activate when operator do ppmain, the robot controller know
that is inside the cylinder and call routine Security to go home at safety.

Help please Robotics

Comments

  • Hello,
    You have to forbid write access of the output.
    Look at output "Access Level", must be INTERNAL.