RobotStudio event

World zone configuration lost after virtual controller restart

Hello,
I'm facing an issue,
World zone configuration are defined, and works, but after station is reopened or VC is restarted. Configuration is lost and I have to run configuration again.
I'm using same configuration in real robot and it works properly, but in VC it's lost after restart.
Is there some possibility to read those configurations and run function to configure it again if it's lost?
It's annoying to do it while I'm working on optimizing.

Here's code.

    ! *** HOME POSITION **
    CONST jointtarget deltaHomePos:=[[1,1,1,1,1,1],[9E9,9E9,9E9,9E9,9E9,9E9]];

    VAR shapedata shape_Home;
    VAR shapedata shape_Cnv;
    VAR shapedata shape_Pal1;
    VAR shapedata shape_Pal2;
    
    VAR wzstationary wzHome:=[0];
    VAR wzstationary wzCnv;
    VAR wzstationary wzPal1;
    VAR wzstationary wzPal2;

    PROC ActivateLockingArea()
   
        VAR pos boxConv_ZoneCorner1:=[400.00,-350.00,-30.00];
        VAR pos boxConv_ZoneCorner2:=[1100.00,350.00,570.00];

        VAR pos boxPal1_ZoneCorner1:=[-500.00,300.00,-30.00];
        VAR pos boxPal1_ZoneCorner2:=[500.00,1050.00,720.00];

        VAR pos boxPal2_ZoneCorner1:=[-500.00,-1050.00,0.00];
        VAR pos boxPal2_ZoneCorner2:=[500.00,-300.00,750.00];

        WZBoxDef\Inside,shape_Cnv,boxConv_ZoneCorner1,boxConv_ZoneCorner2;
        WZDOSet\Stat,wzCnv\Inside,shape_Cnv,ActZone_Cnv,High;

        WZBoxDef\Inside,shape_Pal1,boxPal1_ZoneCorner1,boxPal1_ZoneCorner2;
        WZDOSet\Stat,wzPal1\Inside,shape_Pal1,ActZone_Pal1,High;

        WZBoxDef\Inside,shape_Pal2,boxPal2_ZoneCorner1,boxPal2_ZoneCorner2;
        WZDOSet\Stat,wzPal2\Inside,shape_Pal2,ActZone_Pal2,High;

        WZHomeJointDef\Inside,shape_Home,Home,deltaHomePos;
        WZDOSet\Stat,wzHome\Inside,shape_Home,ActZone_Home,high;

    ENDPROC



Comments