Random values

MBech
✭
in RobotStudio
Is there a standard function in RAPID to generate random values for variables? Something equivalent to the 'rand' or 'randf' function in C?
0
Comments
-
No, but there's probably plenty of ways to make your own. For instance, if the robot is moving, you might try something like:
FUNC num GetRandom()
VAR jointtarget joints;
VAR num nVal;
joints := CJointT();
RETURN nVal:=Round(Sqrt(Abs(joints.rax_3)))
ENDFUNC
Russell Drown0 -
Nowadays you can use Rand()-----------------
David
Swedish freelance ABB robot programmer0
Categories
- All Categories
- 5.6K RobotStudio
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 301 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 338 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 832 RAPID Programming
- 14 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings