RobotStudio event

World Zone help

Options
Hello,

I am re asking this question in a new post so that I can start from scratch. I have been trying to do a World Zone such that when the robot enters that zone, the robot will shut off. I have tried multiple methods, and have not had any luck even with the great help.

This is my code attempting to do Temporary WZ's:

MODULE MainModule
    CONST robtarget p10:=[[461.29,144.16,221.59],[0.29728,-0.143906,0.942789,0.0454265],[0,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget p20:=[[422.52,-233.55,218.06],[0.287825,0.238498,0.924538,-0.0741974],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget p30:=[[422.52,-233.55,538.15],[0.287814,0.238489,0.924544,-0.0741978],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget p40:=[[433.25,226.30,534.73],[0.289204,-0.227574,0.927106,0.0710358],[0,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget Home:=[[373.93,0.03,630.05],[0.707179,-3.9492E-05,0.707034,9.98114E-06],[0,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

    VAR wztemporary object2;

    PROC temp_zone()
        VAR shapedata volume;
        CONST pos corner1_1:=[275,353,101];
        CONST pos corner2_1:=[369,-353,534];
        wzboxdef\Inside,volume,corner1_1,corner2_1;
        WZLimSup \Temp, object2, volume;
        !wzenable object2;
        Path_10;
        !WZDisable object2;
    RETURN;
    ENDPROC

    PROC main()
        !        Path_10;
        temp_zone;
        !WZEnable object2;
    ENDPROC

    PROC Path_10()
        MoveJ Home,v200,z5,tool0;
        MoveJ p10,v200,z5,tool0;
        MoveJ p20,v200,z5,tool0;
        MoveJ p30,v200,z5,tool0;
        MoveJ p40,v200,z5,tool0;
        MoveJ Home,v200,z5,tool0;
    RETURN;
    ENDPROC
ENDMODULE


However, it is not recognizing the WZ, and I keep getting an error after the first cycle: "Event Message 40664. Description: The 'object2' worldzone has already been defined and activated. A worldzone can only be defined once. Program Ref./MainModule/temp_zone/WZLimSup. Actions: Use a worldzone with another name."

What does this mean, and what do I need to do in order to fix this?

Thanks,
SM