SczL
Hello,
I am just beggining. I get C code generated successfully and error like in the code area below.
I have checked *.py files listed in console and they all exist. I do not know which one does not?
I was wondering if there should be another variable for y0, y1 "loopback" and call for somekind of M / memory register.
I will be grateful for any help.
Start build in E:\Dokumenty\OPenPLC_z1_wozek\build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
Compiling IEC Program into C code...
Extracting Located Variables...
C code generated successfully.
PLC :
   [CC]  plc_main.c -> plc_main.o
C Build crashed !
Traceback (most recent call last):
  File "E:\Programy\Utils Elektronika\OpenPLC Editor\editor\ProjectController.py", line 1168, in _Build
    if not builder.build():
  File "E:\Programy\Utils Elektronika\OpenPLC Editor\editor\targets\toolchain_gcc.py", line 188, in build
    (self.compiler, CFile, objectfilename, Builder_CFLAGS, CFLAGS)
  File "E:\Programy\Utils Elektronika\OpenPLC Editor\editor\util\ProcessLogger.py", line 140, in __init__
    self.Proc = subprocess.Popen(self.Command, **popenargs)
  File "E:\Programy\Utils Elektronika\OpenPLC Editor\Python\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "E:\Programy\Utils Elektronika\OpenPLC Editor\Python\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
WindowsError: [Error 2] File not found


wozek_plc.jpg
Reply 0 0
SczL
Solved. The reason was changed shortcut cmd - I have changed it when I was adding shortcut to windows start menu. To get the program work I changed the realitve paths to:
"%windir%\system32\cmd.exe /c start "" "E:\Programy\Utils Elektronika\OpenPLC Editor\Python\pythonw.exe" "E:\Programy\Utils Elektronika\OpenPLC Editor\editor\Beremiz.py""
Program started but any compilation returned error due to missing files. These paths were correct and but when I get back to the original shortcut cmd everything is working again.
The workaround to get the start menu shortcut was creating the *.bat file with the same cmd from the short cut.placed in the program path and creating shortcut to the bat file.
Reply 0 0
thiagoralves
I would say your editor is corrupted somehow or your project is misconfigured. Can you compile the hello world example on the website?
Reply 0 0
SczL
Everything is fine, I just need to use original shortcut in program directory or use my workaround with the bat file to execute. The bat file needs to be placed in openplc directory. The above program console log:
Successfully built.
Beremiz_service:  1.0
WAMP import failed :
HTTP interface port : 8009
Pyro port : 61632
Current working directory :c:\users\aborygen\appdata\local\temp\tmphyz0uq
PYRO connecting to URI : PYROLOC://127.0.0.1:61632
PLC did not provide identity and security infomation.
Latest build does not match with connected target.
PLC data transfered successfully.
UI thread started successfully.
PLCobject : NewPLC (d33c6459e38ba22642cc1065bfad551a)
PLC installed successfully.
PLCobject : PLC started  
Starting PLC


The bat file code (same as .lnk file) - screen below. Windows behavior is that creating another shortcut to the first shortcut, makes exact copy of the first shortcut. Everything is fine when they are placed in the same directory, but when moved for example to start menu their relative path could not find the parent program directory. I do not know why adding full path does not work... or it is just windows 😃 So if any one experience problem, use the bat file 🙂
bat.png
Reply 0 0
Reply