EasyManua.ls Logo

Panasonic FP Series

Panasonic FP Series
1345 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Counter instructions
319
Part II IEC Instructions
Data type I/O Function
input CD subtracts 1 from CV at rising edge
BOOL
input LOAD resets counter to PV
INT input PV preset value
BOOL output Q signal output, set if CV = 0
INT output CV current value
Data types
Example
In this example, the same POU header is used for all programming languages. For an 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 (* first cycle *)
load:=TRUE; (* load has to be TRUE,
to set current_value to output_value *)
clock:=FALSE;
END_IF;
copy_name(CD:= clock, LOAD:= set, PV:= output_value, Q=> signal_output, CV=>
current_value);
load:=FALSE; (* now current_value got the right value, load doesn't need
to be *)
(* TRUE any longer *);

Table of Contents

Other manuals for Panasonic FP Series

Related product manuals