Hello,
you can try out the following example:
This should give the needed function from the available Script Functions of the robot.