Panasonic FP Series Programming Manual page 313

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Edge detection instructions
R_TRIG
The function block R_TRIG (rising edge trigger) allows you to recognize a rising edge at an input.
Description
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
For R_TRIG declare the following:
CLK
signal input
the output Q is set for each rising edge at the signal input (CLK = clock)
Q
signal output
is set when a rising edge is detected at CLK.
PLC types
Availability of R_TRIG (see page 1330)
The output Q of a function block R_TRIG remains set for a complete PLC cycle
after the occurrence of a rising edge (status change FALSE -> TRUE) at the CLK
input and is then reset in the following cycle.
Data types
Data type
BOOL
In this example, the same POU header is used for all programming languages. For an example
Example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables which are used for programming the function block R_TRIG are
declared in the POU header. This also includes the function block (FB) itself. By declaring the FB
you create a copy of the original FB. This copy is saved under copy_name, and a separate data
area is reserved.
Body
Signal_output will be set, if a rising edge is detected at signal_input.
LD
ST
When programming with structured text, enter the following:
copy_name( CLK:=
Q=>
312
Rising edge trigger
I/O
Function
input CLK
detects rising edge for clock
output Q
set when rising edge detected
signal_input
signal_output
);
,

Advertisement

Table of Contents
loading

Table of Contents