2 Instruction Descriptions
2-868
NJ-series Instructions Reference Manual (W502)
ChkRange
The ChkRange instruction determines if the value of a variable is within the valid range of the range
type specification.
* If you omit the input parameter, the default value is not applied. A building error will occur.
The ChkRange instruction determines if the value of variable to check In is within the valid range of the
range specification variable Val. If the value is within the valid range, check result Out is TRUE. If the
value is not within the valid range, check result Out is FALSE.
You can define the range type specification for integer variables (USINT, UINT, UDINT, ULINT, SINT,
INT, DINT, and LINT).
Instruction Name FB/FUN Graphic expression ST expression
ChkRange Check Subrange
Variable
FUN Out:=ChkRange(In, Val);
Variables
Name Meaning I/O Description Valid range Unit Default
In Variable to
check
Input
Variable to check Depends on data type.
--- *
Val Range
specifica-
tion vari-
able
Range specification variable Depends on the range
specification.
Out Check
result
Output Check result Depends on data type. --- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK OK OK OK OK OK OK OK
Val The basic data type that is the basis for the range specification must be the same as In.
Out OK
Function
Additional Information
(@)ChkRange
EN Out
In
Val