StickFix
Dear Sirs! I hope you're doing well.
 
I have good experience in written programming, so it was easier for me to be a noob in ST language for PLC, so I'm on doing my first steps with OpenPLC and trying to compile my first program. So I wrote the following one (a simple counter, stimulated by any input signal).
PROGRAM program0
VAR
    Counter: INT;
    InputSignal: BOOL;
    ResetValue: INT;
END_VAR

IF InputSignal THEN
    Counter := Counter + 1;
    IF Counter >= ResetValue THEN
        Counter := 0;
    END_IF
END_IF
END_PROGRAM
Well, I'm getting the following (attached screenshot), having tried everything I could think of. What does (pid 38764) mean?
What is happening here?
Thank you very much!!
 
EDIT: After posting, I didn't see where the attached image is, so I copy the error message over here:
Iniciar la construcción en C:\Users\A\OpenPLC_Editor\Alfred\build
Generando el código ST/IL/SFC IEC-61131  para el SoftPLC...
    Collecting data types
    Collecting POUs
    Generate POU program0
    Generate Config(s)
Compilando el programa IEC en código C...
"C:\Users\A\OpenPLC_Editor\matiec\iec2c.exe"  -f -l -p -I "C:\Users\A\OpenPLC_Editor\matiec\lib" -T "C:\Users\A\OpenPLC_Editor\A\build" "C:\Users\A\OpenPLC_Editor\A\build\plc.st"
Terminado con estatus 1 (pid 38764)
C:\Users\A\OpenPLC_Editor\A\build\plc.st:49-1..49-11: error: unknown syntax error.
In section: END_PROGRAM
0049: END_PROGRAM

1 error(s) found. Bailing out!
 
Reply 0 0
thiagoralves
Reply 0 0
StickFix
Wooah! Thank you!
 
Solution for this case:
Don't redefinde variables between VAR .. END_VAR in the program, when you already did it in the window above your code.
Use ; after each END_IF, abd use (*comments*) this way.
Reply 1 0
Reply