RobotStudio event

Workobject changing

Hello,
is there any way to program workobject changing ? For example, I define four workobject and in FOR statement it will be automatically changing.  Something like:

FOR i from 1 to 4

workobject(i)

ENDFOR
Tagged:

Comments

  • You can do something like this:

    <div>MODULE MainR1
    </div><div>&nbsp;&nbsp;
    </div><div>&nbsp; PERS wobjdata wobjA := [FALSE, TRUE, "", [[0, 0, 10],[1, 0, 0, 0]], [[0, 0, 0],[1, 0, 0, 0]]];
    </div><div>&nbsp; PERS wobjdata wobjB := [FALSE, TRUE, "", [[0, 0, 20],[1, 0, 0, 0]], [[0, 0, 0],[1, 0, 0, 0]]];
    </div><div>&nbsp; PERS wobjdata wobjC := [FALSE, TRUE, "", [[0, 0, 30],[1, 0, 0, 0]], [[0, 0, 0],[1, 0, 0, 0]]];
    </div><div>&nbsp; PERS wobjdata wobjD := [FALSE, TRUE, "", [[0, 0, 40],[1, 0, 0, 0]], [[0, 0, 0],[1, 0, 0, 0]]];
    </div><div>&nbsp; PERS wobjdata usedWobj;
    </div><div>&nbsp; PERS wobjdata wobjs{4};
    </div><div>&nbsp;&nbsp;
    </div><div>&nbsp; PROC main()
    </div><div>&nbsp; &nbsp; wobjs:=[wobjA, wobjB, wobjC, wobjD];
    </div><div>&nbsp; &nbsp;&nbsp;
    </div><div>&nbsp; &nbsp; FOR i FROM 1 TO Dim(wobjs,1) DO
    </div><div>&nbsp; &nbsp; &nbsp; usedWobj := wobjs{i};
    </div><div>&nbsp; &nbsp; ENDFOR
    </div><div><br></div><div>&nbsp; ENDPROC
    </div><div>&nbsp;&nbsp;
    </div><div>ENDMODULE
    </div>
  • Thank you very much !