Offset position array

DjustesenDjustesen Aarhus, Denmark
Hi :)

I am a student working with Robotstudio, and my current project involves stacking 2 different items each in 3 stacks of 3items, with only using 1 offset. I also have to be able to swap between those 2 items, and the robot needs to remember where in the stacking process it was.
I was thinking about using some array funktion to remember the positions.
If you have any tips on how to make the array function or another more simple way to solve this task, i would love to hear from you :)

In the example below from my code it just runs the For loop stacking all the 9 item, if you stop halfway it starts over.

Var robtarget PosChromeVar;

IF DI10_1 = 1 THEN
            FOR z FROM 0 TO 2 DO
                FOR x FROM 0 TO 2 DO
                PosChromeVar := Offs(PosChrome,-x *50, 0,z *30);
                chrome;
                ENDFOR
            ENDFOR
           
            ELSEIF DI10_2 = 1 THEN
            FOR z FROM 0 TO 2 DO
                FOR x FROM 0 TO 2 DO
                PosBlackVar := Offs(PosChrome,-x *50, 50,z *30);
                black;
                ENDFOR
            ENDFOR   
            ENDIF

    PROC chrome()
        IF DI10_1 = 1 AND ChromeCount < 9 THEN
        MoveJ Pos10, v1000, z50, AT2_Vacuum_Tool;
        MoveL p20, v1000, z1, AT2_Vacuum_Tool;
        SetDO\Sync, DO10_1, 1; 
        MoveL Pos10, v1000, z50, AT2_Vacuum_Tool;
        MoveJ PosChromeVar, v200, z1, AT2_Vacuum_Tool;
        Reset DO10_1;
        MoveJ StartPos, v1000, z50, AT2_Vacuum_Tool;
        Incr ChromeCount;
        ENDIF
    ENDPROC


Daniel 


Comments

Sign In or Register to comment.