RobotStudio event

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

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

  • That is a call by variable in which the variable is a string of which the value is a routine name.
    Lee Justice
  • 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 ✭✭✭
    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.
  • Very good point, you are right.
    Lee Justice
  • Thanks a lot for help @lemster68 and @soup.