4 - 29 4 - 29
4 ST PROGRAM EXPRESSIONS
4.4 Call of Function Block
In an ST program, a function blocks (FB) can be used.
This section explains the method of using a user-created FB in an ST program. (For
the FB creating method, refer to the "GX Developer Version 8 Operating Manual
(Function Block)".
(1) Call of function block
When a created FB is to be used in an ST program, an FB name must be
defined first on the local variable setting screen. (Refer to REFERENCE .)
The FB can be used by describing the defined FB name (FB call) in the ST
program.
When calling the FB, describe all input variables and I/O variables. Also, always
specify values for the input variables and I/O variables.
For an output variable, its description can be omitted if the result of the output
variable is not needed.
[Description example]
When the following FB is created
FB data name
: LINE1_FB
Input variable
: I_Test
Output variable : O_Test
I/O variable
: IO_Test
FB label name
: FB1
The description example of a FB call is as given below.
FB1( I_Test : = D0, O_Test : = D1, IO_Test : = D100):
The description of the output variable can be omitted.
(2) How to acquire the output result
By providing "." after the FB name to specify the output variable name, the
output of the FB can be acquired.
[Description example]
Describe as given below when assigning the result of the output variable to D1.
D1 := FB1.O_Test;
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......