Random values

MBech
MBech United States
Is there a standard function in RAPID to generate random values for variables? Something equivalent to the 'rand' or 'randf' function in C?

Comments

  • RussD
    RussD United States

    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 Drown
  • Newman
    Newman Sweden
    Nowadays you can use Rand()
    -----------------
    David
    Swedish freelance ABB robot programmer