Passing variables to a procedure within MoveLSync instruction
I have a simple routine with one variable as follows...
PROC CPrimerCorner (num FRate)
SetGO goFlowRate, FRate;
ENDPROC
I want to use this procedure within a MoveLSync instruction and pass it a desired flow rate to write to the group output. I am doing it this way because the MoveLDO instruction wont allow a group output and I dont know of a MoveLGO instruction.
Here is my code for calling the MoveLSync...
MoveLSync pClearPrimeCD539_010, v150, fine, DisNord\WObj:=wNStand, "CPrimer Corner, 100";
I get weird errors when running but it compiles everything just fine.
Is it even possible to use a procedure with parameters within the MoveLSync instruction?
Thanks!
Comments
-
It seems as if the called procedure must not have any arguments, just tested it and got similar result as you did. Perhaps a workaround can be do assign the desired value to a global variable that is in the scope of the called procedure instead of passing it as a parameter?
I will log an improvement report about clarifying the RAPID manual. Thanks for your feedback.
/Henrik
Henrik Berlin
ABB1 -
Yes. That is exactly what I did!
It would be nice to have that capability, however!
Thank you for your response and thoroughness.
0 -
Hi
Make your own instruction like:
MODULE ModInstruction(SYSMODULE,NOSTEPIN)
VAR dionum FRate;
PROC MoveLPrime(robtarget ToPoint,speeddata Speed,zonedata Zone,PERS tooldata tool\PERS wobjdata WObj, dionum Value)
FRate:=Value;
MoveLSync ToPoint,Speed,Zone,tool\WObj ?WObj,"SetGroupOutput";
ENDPROC
PROC CPrimerCorner()
SetGO goFlowRate,FRate;
ENDPROC
PROC TestMoveLGO()
MoveLPrime pActual,v100,z10,DisNord\WObj:=wNStand,100;
ENDPROC
ENDMODULE
Best regards
Marcel
0 -
Hello,
you should better use a TriggL instruction instead of a MoveLsync instruction to set the group output, because if the value "Frate" is changed after executing the move instruction "MoveLPrime" and robot reaches the trigger position the wrong value will be set.
Example:
PROC MoveLGO(\switch Conc,robtarget ToPoint,speeddata speed\num T,zonedata zone\stoppointdata InPos,PERS tooldata Tool\PERS wobjdata WObj,VAR signalgo Signal,dnum Value\num DODelay\switch Corr)
VAR triggdata trMoveGO;
TriggIO trMoveGO,0\GOp:=Signal,Value\DODelay ?DODelay;
TriggL\Conc ?Conc,ToPoint,speed\T ?T,trMoveGO,zone\InPos ?InPos,Tool\WObj ?WObj\Corr ?Corr;
BACKWARD
Calling the new routine: MoveLGO p10,v1000,z10,tool0,goTest,10;
Regards
Micky
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings