can I use a procedure to output a selected parameter?
suffq
✭
Hi there,
I'm trying to create a procedure that from a few parameters can crunch some numbers and then modify/ update a position variable. which can be used throughout with different parameters.
here's an example to give an idea of what I mean:
VAR pos Input:=[3,2,1]
VAR pos Output:=[0,0,0]
PROC main()
PosOutput input, output;
ENDPROC
PROC PosOutput(pos pos1, pos pos2)
pos2:= [pos1.x*2, pos2.y, pos2.z];
ENDPROC
When I run such a program the Output variable doesn't seem to update. is there a way to update the Output that's being called through the procedure?
regards,
Quin
I'm trying to create a procedure that from a few parameters can crunch some numbers and then modify/ update a position variable. which can be used throughout with different parameters.
here's an example to give an idea of what I mean:
VAR pos Input:=[3,2,1]
VAR pos Output:=[0,0,0]
PROC main()
PosOutput input, output;
ENDPROC
PROC PosOutput(pos pos1, pos pos2)
pos2:= [pos1.x*2, pos2.y, pos2.z];
ENDPROC
When I run such a program the Output variable doesn't seem to update. is there a way to update the Output that's being called through the procedure?
regards,
Quin
Tagged:
0
Answers
-
I think that you will see that the value for pos2 has the value stored in it. Just because you name a parameter "Output" does not make it behave in the way you want it to. Make the parameter for pos2 an INOUT parameter and you should see the value changing.Lee Justice1
-
Like this
PROC PosOutput(pos pos1, INOUT pos pos2)
pos2:= [pos1.x*2, pos2.y, pos2.z];
ENDPROC
Systemintegrator - Web / C# / Rapid / Robotstudio
If I helped, please press Vote Up1 -
Thankyou the INOUT parameter has solved my issue0
Categories
- All Categories
- 5.5K RobotStudio
- 390 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 304 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 772 RAPID Programming
- 17 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings