RobotStudio event

Can anybody explain me what does it mean in RAPID: %name_of_proc% ?

Options
I have a part of program which looks as follows:

        WHILE diPLCstopAfterCycle=1 DO
            GoHome;
            Set dovR1cycleRun;
            %"mainMovments_R3"%;
        ENDWHILE

How the line: "%"mainMovments_R3"%;"  is executed and what is the principle of using "% %" in the RAPID program?

Answers

  • lemster68
    Options
    That is a call by variable in which the variable is a string of which the value is a routine name.
    Lee Justice
  • lemster68
    Options
    I would like to add that unless some other part of the program changes the value of the string, then this type of call is unnecessary.  It would be just as well to code:

     mainMovements_R3;

     as a direct procedure call.
    Lee Justice
  • soup
    soup ✭✭✭
    Options
    Search the forum and/or manual for "late binding" for more info.

    As @lemster68 mentioned, it's commonly used to call a routine using a string. It could also be used to call a routine from a module which is to be loaded later or even loaded dynamically during runtime -- so if the mainMovements_R3 procedure didn't exist yet the program check would fault when called directly but "%"mainMovments_R3"%;" would pass.
  • lemster68
    Options
    Very good point, you are right.
    Lee Justice
  • Lukas_89
    Options
    Thanks a lot for help @lemster68 and @soup.