TheInfernoMan
Yesterday I have found the OpenPLC Project on the Internet and it sounds perfect and super interesting.

But what maked me unhappy was the try today to install the OpenPLC Software.
The Editor worked easily and exporting the project was easy.

But I tried to install the OpenPLC Server on Windows (for Arduino) and while starting the setup_win.js there are two errors of this type: 

main.cpp:220:19: error: ‘updateBuffersIn’ was not declared in this scope
updateBuffersIn(); //read input image


So I thought it would be easier on a Raspberry Pi and the same error apeared again...
This is frustrating and my interest in OpenPLC is going to leave.

Same errors on RPi with the Build.js (but this time with raspberry pi setting)
And if I try to start the server it shows:

Working on port 8080

events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1000:11)
at Process.ChildProcess._handle.onexit (child_process.js:791:34)


What can I do? Any tip? I thought the software would be EASY to use.
Sorry for my bad english, I am german.
Reply 0 0
thiagoralves
If you are looking for a software EASY to use, you should look for one of the commercial PLC alternatives like Siemens, Allen-Bradley or Schneider-Modicon. They charge a lot of money for their user-friendly software, even though sometimes I think that a software that requires a 800 pages manual to operate is not user friendly at all.

OpenPLC is a free and open source software built entirely by the community during our spare time. Our main focus is not user friendliness, but rather functionality. You might not get the best user interface or the best support, but hey, it's free!

Anyway, the problem you had is related to a patch someone made in the code and that I merged to the official branch yesterday. It seems that I was not careful enough and let some little mistakes slip through. There were a few lines of code missing in the patch and I didn't notice. Anyway, I just fixed the problem, you should be able to install and use OpenPLC either on Windows+Arduino or Raspberry Pi now by following the instructions on the website. Just make sure you remove your current OpenPLC_v2 directory, clone and build OpenPLC again to get the most recent changes:
rm 

rm -Rf OpenPLC_v2
git clone  https://github.com/thiagoralves/OpenPLC_v2.git
cd OpenPLC_v2
./build_win.sh (Windows)
./build.sh (Raspberry Pi)
Reply 1 0
TheInfernoMan
First, thanks alot for your fast help. The installation now worked perfectly and the configuration too.
The NodeJS Server starts now and the local web page is now reachable.

But I've tried to upload a program to test it and now there is an "Error optimizing program. Please check console log".
I have uploaded the HelloWorld Program from the example (for Arduino) and in the NodeJS Console there is not much more information.

Thanks in advance for your help and I begin to like the project [smile]
How many people are working on this project?

Regards,
Inferno
Reply 0 0
thiagoralves
Another silly mistake... It should be working fine now. I tried on my Arduino and on my Raspberry Pi and it worked. I hope I've not left anything else behind.

About your question, it is hard to keep track of how many people is actually working on the project. I get little contributions all the time from all around the world. You will find more active developers here in the forum, for example, the thread about the new hardware that I'm planning to create (https://openplc.discussion.community/post/openplc-new-hardware-device-9292586?pid=1300149196) has about 4 or 5 active people working on it.
Reply 0 0
TheInfernoMan
No in my case it is not working, yet. I have deleted my current OpenPLC Directory and get it new from git...
Same error, no difference. But in Git I see you have commited [confused]

Thanks in advance
Reply 0 0
thiagoralves
Are you trying to run it from your Raspberry Pi or Windows? Can you verify if your OpenPLC_v2/st_optimizer_src/st_optimizer.cpp file looks like this one:  https://github.com/thiagoralves/OpenPLC_v2/blob/master/st_optimizer_src/st_optimizer.cpp ?

Look specifically for the lines that have changed. You can find the modified lines here:  https://github.com/thiagoralves/OpenPLC_v2/commit/3764381b71a12ad73e7c3adc97e920097fea0020
Reply 0 0
TheInfernoMan
I am at the moment at my windows system. Yeah my st_optimizer.cpp looks like the new one.
But the problem is still there...
Reply 0 0
TheInfernoMan
I started randomly the st_optimizer.exe and the error is: cygstdc++-6.dll, cygwin1.dll and cyggcc_s-1.dll is missing... Can that be the reason?
Reply 0 0
thiagoralves
Nope. You can't launch st_optimizer.exe outside of Cygwin. If you want to launch it, you will have to run it from Cygwin. Assuming the st file you uploaded is called "hello_world.st" you can try something like this after opening Cygwin:

cd OpenPLC_v2
./st_optimizer.exe ./st_files/hello_world.st ./st_files/hello_world.st

If you don't see any output it is because it worked. If you see an error you can try to recompile st_optimizer (just make sure you have the same version from github) by doing this:

cd st_optimizer_src
g++ st_optimizer.cpp -o st_optimizer
cd ..
cp ./st_optimizer_src/st_optimizer.exe ./
Reply 0 0
TheInfernoMan
No at the moment there is no error message running the st_optimizer.exe...

But the problem while optimizing the program is still there, thanks 
Reply 0 0
thiagoralves
Can you paste here the full log on OpenPLC webserver with the problem? Also, have you tried to generate the program again from PLCOpen Editor? I can't imagine anything that could be going wrong with it now
Reply 0 0
TheInfernoMan
Hello, do you mean this with the console log? Yes I have generated the program again.

G:\cygwin\home\Maurice\OpenPLC_v2> node .\server_win.js
Working on port 8080
AND.st is starting ...
AND.st uploaded to st_files\ AND.st
finishing old program...
optimizing ST code...
Error optimizing program. Please check console log
Reply 0 0
thiagoralves
That's why it is not working, you are starting OpenPLC from the Command Prompt! Under windows you must do everything on Cygwin, otherwise it will not work. Open Cygwin terminal and then type:

cd ~/OpenPLC_v2
node server_win.js
Reply 1 0
Reply