chamobit
Hello All,
 
I am newbie trying to learn ST.
 
Here  my environment:
 
OpenPLC Editor 2.01
Release: 2023-06-27
 
OS:

Ubuntu 20.04.2 LTS

 
As a first example I try to create a new project / ST for a simple code:
 

IF button = TRUE THEN
led3 := TRUE;
ELSE
led3 := FALSE;
END_IF;
 
Within the Variable Area I use the following:
 
[203128%2F8275177%2Fmceclip0]
 
Then once I try to Start the PLC simulation I got the following error:
 
Start build in /home/playground/Diario/Referencia/Software/OpenPLC_Editor/editor/examples/LEDTWO/build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
Collecting data types
Collecting POUs
Generate POU LED2
Generate Config(s)
Compiling IEC Program into C code...
"/home/playground/Diario/Referencia/Software/OpenPLC_Editor/matiec/iec2c" -f -l -p -I "/home/playground/Diario/Referencia/Software/OpenPLC_Editor/matiec/lib" -T "/home/playground/Diario/Referencia/Software/OpenPLC_Editor/editor/examples/LEDTWO/build" "/home/playground/Diario/Referencia/Software/OpenPLC_Editor/editor/examples/LEDTWO/build/plc.st"
exited with status 1 (pid 1420294)
sm_cards.txt:186-5..186-15: error: invalid input variable(s) declaration.
in file included from file standard_FB.txt:52
included from file /home/playground/Diario/Referencia/Software/OpenPLC_Editor/matiec/lib/ieclib.txt:32
sm_cards.txt:235-5..235-15: error: invalid input variable(s) declaration.
in file included from file standard_FB.txt:52
included from file /home/playground/Diario/Referencia/Software/OpenPLC_Editor/matiec/lib/ieclib.txt:32
2 error(s) found in /home/playground/Diario/Referencia/Software/OpenPLC_Editor/matiec/lib/ieclib.txt. Bailing out!
Error : IEC to C compiler returned 1
PLC code generation failed !
 
May you please point to a full "hello world" version using ST with OpenPLC or let me know where is my error?
 
Thanks a lot for your support. Great Project!
 
Best Regards
Reply 0 0
guodong
改一下变量名称试试加语
Reply 0 0
thiagoralves
The program seems correct. Most likely this is an old or corrupted OpenPLC installation that has some bug. Make sure you're running on the latest version by going to file -> check for updates.
Reply 0 0
plcwill
If you haven't done so already by getting it working. But, if you didn't.  You will need some timing because the led is flashing too fast to see it flash. Also look at the examples with in the editor for some help.
Reply 0 0
Reply