Antman
Hi everyone,

I have a noob question about following the getting started"creating your first project" example.

I've followed it to the tee, but it throws compiler errors and won't simulate.  It's probably something tiny, hoping someone can help point me in the right direction.

I have a runtime going on the machine, but there is no info I can see on linking it to the editor, or telling the editor what it should be simulating.

The console log is:

Start build in /home/server/Documents/test1/build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
Compiling IEC Program into C code...
"/home/server/Documents/OpenPLC_Editor/matiec/iec2c" -f -l -p -I "/home/server/Documents/OpenPLC_Editor/matiec/lib" -T "/home/server/Documents/test1/build" "/home/server/Documents/test1/build/plc.st"
exited with status 1 (pid 7307)
/home/server/Documents/test1/build/plc.st:97-21..99-34: error: invalid located variable declaration.
In section: PROGRAM program0
0097: PB1 : BOOL PB2 : BOOL LED : BOOL END_VAR
0098:
0099: LED := NOT(PB2) AND (PB1 OR PB2);
/home/server/Documents/test1/build/plc.st:100-1..106-48: error: invalid located variable declaration.
In section: END_PROGRAM
0100: END_PROGRAM
0101:
0102:
In section: CONFIGURATION Config0
0103: CONFIGURATION Config0
0104:
0105: RESOURCE Res0 ON PLC
0106: TASK task0(INTERVAL := T#20ms,PRIORITY := 0);
/home/server/Documents/test1/build/plc.st:107-6..107-43: error: invalid located variable declaration.
In section: CONFIGURATION Config0
0107: PROGRAM instance0 WITH task0 : program0;

Parsing failed because of too many consecutive syntax errors. Bailing out!

Error : IEC to C compiler returned 1
PLC code generation failed !


and photo:
Screenshot from 2019-07-16 19-32-51.png 

hoping someone can help as this seems like a really cool project with heaps of uses (looking at raspi)
Quote 0 0
thiagoralves
Change the name of your LED variable to LAMP. In the latest version of the editor, the word “LED” became a reserved word (it is used internally for other things). I changed its name in the tutorial text but didn’t change in the pictures.u
Quote 0 0
Antman
Thanks for the quick reply, alas... no dice
still get this: Start build in /home/server/Documents/test1/build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
Compiling IEC Program into C code...
"/home/server/Documents/OpenPLC_Editor/matiec/iec2c" -f -l -p -I "/home/server/Documents/OpenPLC_Editor/matiec/lib" -T "/home/server/Documents/test1/build" "/home/server/Documents/test1/build/plc.st"
exited with status 1 (pid 4767)
/home/server/Documents/test1/build/plc.st:97-21..99-35: error: invalid located variable declaration.
In section: PROGRAM program0
0097: PB1 : BOOL PB2 : BOOL LAMP : BOOL END_VAR
0098:
0099: LAMP := NOT(PB2) AND (PB1 OR PB2);
/home/server/Documents/test1/build/plc.st:100-1..106-48: error: invalid located variable declaration.
In section: END_PROGRAM
0100: END_PROGRAM
0101:
0102:
In section: CONFIGURATION Config0
0103: CONFIGURATION Config0
0104:
0105: RESOURCE Res0 ON PLC
0106: TASK task0(INTERVAL := T#20ms,PRIORITY := 0);
/home/server/Documents/test1/build/plc.st:107-6..107-43: error: invalid located variable declaration.
In section: CONFIGURATION Config0
0107: PROGRAM instance0 WITH task0 : program0;

Parsing failed because of too many consecutive syntax errors. Bailing out!

Error : IEC to C compiler returned 1
PLC code generation failed !


and when I look for the library of IO, nothing is there.  I typed the addresses (which seemed like normal PLC type addresses of %I0.0 etc in to the top pane that had the name and class etc.

is there something different I should do?

cant seem to attache image to this but the browse locations pane has no inputs or outputs at all...
Quote 0 0
thiagoralves
Can you attach you program here? There might be something else in the configuration that is not right
Quote 0 0
Antman
Hi again,

Sorry had gone to bed by the time you asked for the files last night.

Here they are, I think it's the ST files you need but I zipped them all up from the project forlder to be sure.

Thanks heaps
Quote 0 0
Antman
Double post.  Deleted
Quote 0 0
thiagoralves
The problem is in the "Initial Value" field. You cannot have initial values for located variables (it breaks the compilation process). Just leave that field blank and your program will compile just fine
Quote 0 0
Antman
thanks heaps!  will give it a try later this morning...
Quote 0 0
Antman
It's always the little things...

Thanks so much for your help.
Quote 0 0