2-337
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Data Movement Instructions
2
Clear
Clear
The Clear instruction initializes a variable.
The Clear instruction initializes the value of data to initialize InOut.
If an initial value attribute is set for a variable, the specified initial value is used. If an initial value
attribute is not set, the default value for the data type is used.
The default values for the data types are given below.
Instruction Name FB/FUN Graphic expression ST expression
Clear Initialize FUN Clear(InOut);
Variables
Name Meaning I/O Description Valid range Unit Default
InOut Data to
initialize
In-out Data to initialize Depends on data type.
--- ---
Out Return
value
Output Always TRUE TRUE only --- ---
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
InOut
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
An enumeration, array, array element, structure, or structure member can also be specified.
Out OK
Function
Data type Default
BOOL FALSE
BYTE, WORD, DWORD, or LWORD 16#0
USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT,
REAL, or LREAL
0
TIME T#0ms
DATE D#1970-1-1
TOD TOD#0:0:0
DT DT#1970-1-1-0:0:0
STRING ''
(@)Clear
EN ENO
InOut
Out