Denso RC5 Especificaciones Pagina 457

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 692
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 456
Chapter 15 Functions
15-9
RND (Function)
Function
Generates random numbers from 0 to 1.
Format
RND (<Expression>)
Explanation
According to the value in <Expression>, processing varies as shown in the
table below.
<Expression> applies to integer values. If a real value is designated, it is
rounded down and converted to an integer.
Value of
Expression
Processing
Expression
< 0
<Expression> is applied as the seed value for the random
number. If the seed value is the same, the return value of the
RND function is always the same.
Expression
= 0
A random number previously generated is taken. Zero is returned
if no random number is generated after the robot controller power
is turned ON.
Expression
> 0
The next random number in the random number sequence is
generated.
Explanation: For the RND function, a value from 0 to 1 inclusive is
returned. Depending on the argument value, the
random number returned by the RND function will vary.
As long as the initial seed value is the same, the random
number sequence returned by a series of RND functions
is the same. This is because each consecutive RND
function generates the next random number using the
previous random number in the random number system
as the seed value.
Remark: When the seed value in the random number is the same, the
random number sequence obtained is the same. To obtain
different random numbers each time, use the return value of
the TIMER function as a seed value.
Example
DIM array(10) As Single
array(0) = RND(-TIMER) 'The seed value for the random number is set using the
'TIMER function.
FORI1=1TO9
array(I1) = RND(1) 'Obtains random numbers.
NEXT I1
Vista de pagina 456
1 2 ... 452 453 454 455 456 457 458 459 460 461 462 ... 691 692

Comentarios a estos manuales

Sin comentarios