Compiling a Function Block Diagram or Function Block Library
You can use the Build menu options to compile your Function Block Diagram or Function Block Library (see ST and Function Block Libraries). The compilation feature is useful as it checks that your Function Block Diagram has the correct syntax.
There are 2 compile options:
- Compile—Compiles the diagram. If the diagram is invalid, the compiler display provides a message that describes the reason for the syntax error. If the syntax is correct, the compiler displays a success message.
- Compile with Diagnostics—Compiles the Function Block Diagram and provides detailed diagnostic information. As with the Compile option, there are messages for any errors in the syntax. If the syntax is correct, the compiler displays a success message.
The Compile with Diagnostics tool is useful when you want to use a Function Block Diagram to form the basis of an ST program. For example, you may find it easier to create a Function Block Diagram and then use the Compile with Diagnostics tool to access the ST code for the diagram. You can then copy this code into an ST program (you have to remove the $ signs in the code).
To compile a Function Block Diagram:
- Display the Function Block Diagram or Function Block Library in Design mode.
- Select the Build menu, then select the Compile option or the Compile with Diagnostics option as required.
The Function Block Diagram is compiled and the compile messages are shown in the Compiler display.
If the program is invalid, you will need to alter the Function Block Diagram. Typically, the causes of syntax errors are minor, such as the wrong type of value being specified or a missing connection.
If a database item's name includes parentheses ( ), you should ensure that each opening parenthesis is paired with a closing parenthesis.