Programming ABB robots, Rapid programming
How to call by variable, and how not to.
Here a programmer hard coded the routine name to a string to be used in a Call by variable. It pretty much defeats the purpose of using a Call by Variable and creates extra steps as well. There are two ways to use a call by variable: 1. %MyRoutine%; where the string between the percent signs is the name of the routine to run. 2. CallByVar "MainTyp", nProg; The number value is automatically converted to a string and concatenated onto the string name of the routine.
!**************** STRING ****************
!
! "stMainTyp1" Call for main routine, for engine type 1 (DO NOT EDIT).
CONST string stMainTyp1:="MainTyp1";
! "stMainTyp2" Call for main routine, for engine type 2 (DO NOT EDIT).
CONST string stMainTyp2:="MainTyp2";
! "stMainTyp3" Call for main routine, for engine type 3 (DO NOT EDIT).
CONST string stMainTyp3:="MainTyp3";
! "stMainTyp4" Call for main routine, for engine type 4 (DO NOT EDIT).
CONST string …
Here a programmer hard coded the routine name to a string to be used in a Call by variable. It pretty much defeats the purpose of using a Call by Variable and creates extra steps as well. There are two ways to use a call by variable: 1. %MyRoutine%; where the string between the percent signs is the name of the routine to run. 2. CallByVar "MainTyp", nProg; The number value is automatically converted to a string and concatenated onto the string name of the routine.
!**************** STRING ****************
!
! "stMainTyp1" Call for main routine, for engine type 1 (DO NOT EDIT).
CONST string stMainTyp1:="MainTyp1";
! "stMainTyp2" Call for main routine, for engine type 2 (DO NOT EDIT).
CONST string stMainTyp2:="MainTyp2";
! "stMainTyp3" Call for main routine, for engine type 3 (DO NOT EDIT).
CONST string stMainTyp3:="MainTyp3";
! "stMainTyp4" Call for main routine, for engine type 4 (DO NOT EDIT).
CONST string …
Read More
1