![RobotStudio event](https://new.abb.com/images/librariesprovider89/default-album/robotstudio-webinar-arc-welding.jpg)
replace name with num value
![andy_c](https://secure.gravatar.com/avatar/766853afb7ac64a95081e8b234cfa988/?default=https%3A%2F%2Fus.v-cdn.net%2F5020483%2Fuploads%2Fdefaultavatar%2FK2266OAKOLNC.jpg&rating=g&size=200)
andy_c
✭
Hi,
I have a slight problem, i have a randomGenerator witch gives me a number between 0 and 200. And i have 200 routines named "routine1, routine2" etc. And i want to do the rutin by random from the number i get from the randomGen. So to my question:
How do i replace the number 1 in routne1 with the value i get from my randomGen?
BR
0
Comments
-
you could make a routine that accepts your number and use test / case to run each of your individual routines..TEST RandonNumCASE 1 :Routine1;CASE 2:Routine2;ENDTESTlittle bit tedious.. but without know what your doing with the 200 routines i cant think of much better.0
-
Hello,You can use something called late binding to do this in a much simpler way. Please see the following example code:randomNumber :=GetRandomNumber;routineName := "Routine" + NumToStr(randomNumber, 0);%routineName%;This will call the routine with the name "Routine1" (if randomNumber is 1).Good luck!BR frpa0
-
HiYou can useCallByVar - Call a procedure by a variable
Example
reg1 := 2;CallByVar "proc", reg1;
Regards
Knud Erik Lindberg
Jorgensen Engineering0
Categories
- All Categories
- 5.5K RobotStudio
- 397 UpFeed
- 18 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 319 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 804 RAPID Programming
- 4 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings