2 Instruction Descriptions
2-40
NJ-series Instructions Reference Manual (W502)
R_TRIG (Up) and F_TRIG (Down)
z R_TRIG
R_TRIG assigns TRUE to output signal Q for one task period only when input signal Clk changes to
TRUE. Otherwise, the value of Q is FALSE. In the first task period in which this instruction is executed,
the value of Q is FALSE regardless of the value of Clk. If the value of Clk is TRUE when the power sup-
ply is turned ON, the value of Q remains FALSE until the value of Clk changes to FALSE and then back
to TRUE.
z Up
The functions of the R_TRIG instruction and the Up instruction are exactly the same. The Clk variable
of the R_TRIG instruction corresponds to the In variable of the Up instruction. The Q variable corre-
sponds to the Out variable.
R_TRIG (Up): Outputs TRUE for one task period only when the input signal changes to TRUE.
F_TRIG (Down): Outputs TRUE for one task period only when the input signal changes to FALSE.
Instruction Name FB/FUN Graphic expression ST expression
R_TRIG
Up Trigger
FB R_TRIG_instance(Clk, Q);
Up FUN None
F_TRIG
Down Trigger
FB F_TRIG_instance(Clk, Q);
Down FUN None
Variables
Name Meaning I/O Description Valid range Unit Default
Clk, In Input signal Input Input signal Depends on data type.
--- ---
Q, Out Output signal Output Output signal 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
Clk, In OK
Q, Out OK
Function
R_TRIG
R_TRIG_instance
Clk Q
Up
In Out
F_TRIG
F_TRIG_instance
Clk Q
Down
In Out