Introduction to the usage of Mitsubishi PLC series FB block

news 1818℃

What is the FB block of Mitsubishi PLC?

Those who are familiar with Siemens PLC know that there are FBs in Siemens PLC. In fact, Mitsubishi PLC is similar to Siemens, which is the program called in the main program.

1. How to create an FB block and how to call

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

in the main program and click OK to create an FB block called motor.

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

From the above figure, we can see that the program body and local labels are both red, because we did not write the program and build the local labels.

first create a local label, double-click the local label, the interface as shown in the figure below appears.

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

Click the drop-down menu in the class:

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

VAR: internal temporary variable

VAR_CONSTANT: internal static variable,

VAR_INPUT: input interface variable

VAR_OUTPUT: output interface variable

VAR_IN_OUT is not the same as the output interface variable

VAR_IN_OUT of Siemens.

is an example to illustrate:

controls the start and stop of the motor:

first define a local label, as shown in the following figure

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

write FB program:

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

how to call in the main program?

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

In the above example, the local label is first defined in FB. In fact, ST language is not the most intuitive for logic, but it is used for calculation. For example, we can calculate the area of ​​a triangle,

triangle area S=triangle side length A*triangle side Long B/2,

also first define the local label:

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

write FB program:

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

call FB in the main program:

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

simulation:

Introduction to the usage of Mitsubishi PLC series FB block - Lujuba

Tags: news