Panasonic FP Series Programming Manual page 320

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Data types
Data type
BOOL
INT
BOOL
INT
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 CTD 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
If set is set (status = TRUE), the preset_value (PV) is loaded in the current_value (CV). The
value 1 will be subtracted from the current_value each time a rising edge is detected at clock.
This procedure will be repeated until the current_value is greater than/equal to zero. Then,
signal_output will be set.
LD
ST
When programming with structured text, enter the following:
IF
set
THEN
load:=TRUE;
clock:=FALSE;
END_IF;
copy_name(CD:= clock, LOAD:= set, PV:= output_value, Q=> signal_output, CV=>
current_value);
load:=FALSE;
to be *)
I/O
Function
input CD
subtracts 1 from CV at rising edge
input LOAD
resets counter to PV
input PV
preset value
output Q
signal output, set if CV = 0
output CV
current value
(* first cycle *)
(* load has to be TRUE,
to set current_value to output_value *)
(* now current_value got the right value, load doesn't need
(* TRUE any longer
*);
Counter instructions
319

Advertisement

Table of Contents
loading

Table of Contents