Hardware manual

Impact Reference Guide Commands and Functions R-V
5-25 Datalogic Automation Inc.
RND
This function returns a random number. Example:
x = RND yields x = 1016015
ROUND()
This function will round the argument to zero decimal places if there is no second argument. The optional
second argument indicates the number of places to round. If the first argument is undef, the result is undef.
Example:
x = ROUND (11.1225,2) yields x = 11.12
RTRIM()
This function removes any existing spaces from the rightmost part of a string. In this example, the spaces are
removed from the right of the string. Example:
var_string = RTRIM ("This ") yields var_string = This
SEC()
This function converts the real argument to a seconds value. If there is no argument, it returns the current
second (in local Impact device time). Example:
thissecond = SEC() yields thissecond = 13
SIN()
This function returns the sine of the argument. The result is in radians. If the argument is undef, the result is
undef. In this example, the value 0.4794255 is assigned to the variable x. Example:
x = SIN(0.5) yields x = 0.4794255
SPACE()
This function returns a string of spaces. Example:
var_string = SPACE(6) yields var_string =
SPLIT
The syntax of this function is
SPLIT string BY delimiter TO var1, var2...
This function splits "string" into sub-strings (var1, var2, etc) separated by "delimiter." A delimiter at the
beginning or end of the expression is ignored.
Example (splits the string 10, 11, 12, 13) into four based on the delimiter (the comma). It assigns those val-
ues to the string variables sub1, sub2, sub3, and sub4.
SPLIT "10,11,12,13" by "," to sub1, sub2, sub3, sub4 yields
sub1 = 10
sub2 = 11
sub3 = 12
sub4 = 13
If there are more string variables than sub-strings, the unfilled string variables are undefined. For example,