RobotStudio event

Basic array question.

I am trying to figure out how to use arrays.
The manuals are very confusing (for me) about this topic.

As an example, I would like to store some numbers in an array to use for offsetting from a position.
PERS num nMyArray{2,3}:=[[1,2],[3,4],[5,6]];
CONST robtarget centerpos:=[[-490.16,1517.62,1804.67],[0.262408,-0.265629,-0.646938,0.664872],[1,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC main()
  spraypos:=Offs(centerpos, <b>row</b>*12.7, <b>column</b>*12.7, 0);
  MoveL spraypos, v400, fine, t_spray;
ENDPROC
In the example above, I want to offset the robtarget centerpos by calling the data from the array to replace row  and column.

How do I format the syntax to make that happen?
If I wanted to replace row with 5 and column with 2 how do I code that?

Best Answer

Answers

  • Thank you very much! Most of the mystery has been solved.
    Now I just need to figure out how to define and index a 3D array :D