Mitsubishi Electric MELSEC Q Series Programming Manual page 71

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

4 ST PROGRAM EXPRESSIONS
4 - 31
Precaution for acquiring the FB output
Execute FB output acquirement after an FB call. If it is executed before an FB
call, an error will occur.
Example: FB name: FB1
Input variable : I_Test
Output variable: O_Test
D1 : = FB1.O_Test;
FB1(I_Test : = D0, O_Test : = D1);
An error occurs since this program is written in order of FB output
acquirement and FB call.
Precaution for use of I/O variables
If the result of an I/O variable is used like an output variable, an error will occur.
Like an input variable, the value of an I/O variable must be specified at the time
of an FB call.
Example: FB name: FB1
I/O variable
Output variable: O_Test
[Description example]
FB1( IO_Test : = D1);
D1 : FB1.IO_Test;
Precaution for making an FB call
In an ST program, the FB set on the local variable setting screen can be used
only once. (If it is used more than once, an error will occur.) To use the same FB
more than once, declare the FB by the number of times it will be used
beforehand on the local variable setting screen.
Example: The following example shows that the FB label has been defined more
than once on the local variable setting screen.
In the program, the FB is used as indicated below.
label (I_Test := D0, IO_Test := D100);
label1 (I_Test := D1, IO_Test := D150);
label2 (I_Test := D3, IO_Test := D200);
: IO_TEST
An error occurs.
(* FB output acquirement *)
(* FB call
4 - 31
*)

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents