two dimensional num arrays
Hello,
I would need a 2x2 aray of num.
PERS num databuffer{sizebuffer,6};
I would like to be able to change a whole line in a single line of code, e.g.
databuffer{1} := [500, 148, 352, 120, 121, 024];
Error indicate that this is wrong since I did not give two indices. What can I do to change the lines of such array in a similar manner?
Thank you
0
Best Answer
-
Hi
The syntax for the arrays goes like this:
PERS num databuffer{2,6}:=[[1,2,3,4,5,6],[1,2,3,4,5,6]];
So in your program code, you can use a line like this:
databuffer:=[[1,2,3,4,5,6],[1,2,3,4,5,6]];
Or if you want to set only one part of the array, you might be able to create a small procedure for that, for example like this:
PROC SetDataBuffer(num position, num array{*})
FOR i FROM 1 TO Dim(array,1) DO
databuffer{position,i}:=array{i};
ENDFOR
ENDPROC
And then you can use single line of code:
SetDataBuffer 2,[6,5,4,3,2,1];
I hope this helps you.
-Osku
5
Answers
-
(I would need a sizebuffer x 6 array of num.)0
-
yep it helps ! thanks0
-
As I am a beginner i have doubt that, i'm using 2D array, and i'm confusion that how can i create an array for the different pallet for different component, and the operator will select any 2 component for the machine tending application.is there any simple way to do a array logic by this logic...0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 783 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings