RobotStudio event

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
    ABB
  • Yes. That is exactly what I did!

    It would be nice to have that capability, however!

    Thank you for your response and thoroughness.

  • 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

  • Micky
    Micky ✭✭✭
    edited December 2013

    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