Compiling a Ladder Diagram
You can use the Build menu options to compile your Ladder Diagram. The compilation feature is useful as it checks that your Ladder Diagram has the correct syntax.
There are 2 compile options:
- Compile—Compiles the diagram. If the program is invalid, the compiler display provides a message with a brief explanation of any syntax errors. If the syntax is correct, the compiler displays a success message.
- Compile with Diagnostics—Compiles the Ladder 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 Ladder Diagram as an ST programs. For example, you may find it easier to create a Ladder Diagram and then use the Compile with Diagnostics tool to access the ST code for the Ladder Diagram. You can then copy this code into an ST program (you have to remove the $ signs in the code).
To compile a Ladder Diagram:
- Display the Ladder Diagram in Design mode.
- Select the Build menu, then select the Compile option or the Compile with Diagnostics option as required.
The Ladder Diagram is compiled and the compile messages are shown in the Compiler display.
If there are syntax errors, you will need to alter the Ladder Diagram. Typically, the causes of invalid syntax 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.