These docs are a bit ambitious. The steps described are accurate but IronPLC cannot yet run programs.
You can use the command line interface to check a file (and sets of files) for correctness.
This section assumes you have installed the IronPLC Compiler. See Installation if you have not already installed the IronPLC Compiler.
Create a Project Directory#
You’ll start by making a directory to store your IEC 61131-3 code. ironplcc doesn’t care where your code lives (and your code can be in multiple directories), but creating a directory will make it easy to work with your code.
Open a terminal and enter the commands in Create Project Directory
to make the
Create an IEC 61131-3 Program#
The next step is to create a source file for your IEC 61131-3 program.
ironplcc doesn’t care what your call your file(s), but it will
automatically detect file names with the
.st extension as IEC
In the same terminal, enter the commands in Create Hello World Program to create a program.
echo "PROGRAM main
Button AT %IX1: BOOL;
Buzzer AT %QX1: BOOL;
Buzzer := NOT Button;
RESOURCE res ON PLC
TASK plc_task(INTERVAL := T#100ms, PRIORITY := 1);
PROGRAM plc_task_instance WITH plc_task : main;
END_CONFIGURATION" > main.st
Check the Program for Correctness#
Finally, in the same terminal, run the commands in Check Syntax to check your program’s syntax.
ironplcc check main.st
OK should print to the terminal.
For now, that’s it. Presently, IronPLC does not create runnable programs.