Download Print this page

Omron NS Reference Manual page 31

Hide thumbs Also See for NS:

Advertisement

Section2 Functions
NS series Macro Reference
FOR(n), NEXT
Applicable versions
Format
Function
Return Value
Example
GETNUMVAL
Applicable versions
Format
Function
Return Value
Example
n; number of interation
System version 6 or higher
FOR(n), NEXT n; a LOOP
A series of statements in a computer program that are to be executed repeatedly
at specified times. A program between "FOR to NEXT" cannot be nested in
another "FOR to NEXT". (Single loop only)
None
Execute a loop "FOR to NEXT" 10 times and substitute $W0~'$W9 to the initial
value,0.
$W0=0;
$SW27=0;
FOR(10)
$W0I0=0;
$SW27=$SW27+1;
NEXT;
*Setting range for "n" is 0 to 32767. A negative number is considered as 0. $W,
$HW or $SW can be specified as an address.
Outputs written value and changed value
System version 2 or higher
GETNUMVAL( )
Get writing numeral value or changing numeral value for numeral display & input
object.
Use this function for "Before writing numeral" or "When changing numeral" at
"Macro Execution Condition" in numeral display & input object.
Input numeral value
$W0=GETNUMVAL( );
'Set value for writing numeral value to $W0
11

Advertisement

loading

This manual is also suitable for:

Ns-series