EasyManua.ls Logo

Fuji Electric SPH Series - Page 103

Fuji Electric SPH Series
151 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...
2-29
Section 2 Programming Languages
(2) Describing a function block in the IL language
When describing a function block call in the IL language, it is necessary to specify input/output parameters and a call
instruction (“CAL,” “CALC,” or “CALCN”) as shown below.
<Sample program for calling an up counter FB (CTU_1)>
LD INPUT1 (* Count input *)
ST
CTU_1.CU
LD
INPUT2 (* Reset input *)
ST
CTU_1.RESET
LD
SETDATA (* Set value *)
ST
CTU_1.PV
CA
L CTU_1 (* Read CTU_1 unconditionally *)
LD
CTU_1.Q
ST
OUTFLAG (* Up bit *)
LD
CTU_1.CV
ST CURRENT (* Current value *)
Passes input parameters.
Passes output parameters.
Calls the function block.
(3) Describing a function block in the ST language
Specify a function block call in the ST language as shown below.
<Sample program for calling an up counter FB (CTU_1)>
CTU_1(CU: =INPUT1, RESET: =INPUT2, PT: =SETDATA);
OUTFLAG: =CTU_1.Q;
CURRENT: =CTU_1.CV
Passes output parameters.

Table of Contents

Related product manuals