beautypg.com

Rnd (round), Function, N is a number – Yaskawa LEGEND-MC User Manual

Page 210

background image

200

LEGEND-MC User’s Manual

@RND (Round)

[Function]

DESCRIPTION:

@RND rounds a number or variable given in square brackets. Note that the @RND command is a
function, which means that it does not follow the convention of the commands, and does not require the
underscore when used as an operand.

ARGUMENTS: @RND [n]

where

n is a number

USAGE:

EXAMPLES:

While Moving

Yes

Minimum n value

-2147483648.9999

In a Program

Yes

Maximum n value

2147483648.9999

Not in a program

Yes

Default Value

---

Can be Interrogated

No

Default Format

---

Used as an Operand

Yes

Distributed Control

No, Local

#TEST

Program TEST

VAR1=123.456

Set variable

MG @RND[VAR1]

Display the value of VAR1 rounded to the
nearest integer

VAR2=@RND[VAR1]+25

Perform calculation

EN

End of program