<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Ticket search results</title><link>https://forge.codesys.com/tol/codesys-4-linux/tickets/</link><description>You searched for labels:"This"</description><language>en</language><lastBuildDate>Thu, 11 Aug 2022 08:53:28 -0000</lastBuildDate><item><title>Error while building project </title><link>https://forge.codesys.com/tol/codesys-4-linux/tickets/6/</link><description>I am using the docker image for codesys-ide and I am trying to start with a simple task by building a project. I have created the project in a Windows Machine with Codesys v3.5 SP16.

When I run the docker image with codesys and run the following script:

~~~
# encoding:utf-8
from __future__ import print_function
import os
import scriptengine


# opens project
proj = projects.open(r"MyProject.projectarchive", primary = True)
application = proj.active_application #This line causes the error
application.generate_code()
proj.close()

~~~

I get the following error:

Error: Running script 'z:/builds/codesys_test/run.py' caused exception System.ArgumentException: Traceback (most recent call last):
  File "z:/builds/codesys_test/run.py", line 25, in &lt;module&gt;
ValueError: ScriptObjects need a non-empty Guid! 

Attached you will find the Project I created. The project is archived as when I tried to first open the project without archiving the libraries, Codesys complained that it couldnt find the libraries.
    
In addition I modified the codesys bash file as I need to run my own scripts from a different folder in the docker container:


~~~
#!/bin/bash

WINE=wine
set -x

# get first CODESYS profile and start the script with it
profile=$(basename "$(ls -1 ~/.wine.cds/drive_c/CODESYS/CODESYS/Profiles/*.profile* | head -n 1 | sed 's,\.profile.*,,')")

echo ${profile}

# check if file exists, before we call CODESYS with it
if [ ! -f ${1}.py ]; then
echo "error: script '${1}.py' not found."
exit -1
fi

export DISPLAY=:91
Xvfb :91 &amp;&gt; /dev/zero &amp;
sleep 1
export WINEPREFIX=~/.wine.cds
# test that running scripts work
${WINE} ~/.wine.cds/drive_c/CODESYS/CODESYS/Common/CODESYS.exe --culture=en --profile="'"${profile}"'" --runscript="z:${BASEPATH}/noop.py" --noUI 2&gt; /dev/zero
# remove output log
[ -f .codesys.output.txt ] &amp;&amp; rm -f .codesys.output.txt
${WINE} ~/.wine.cds/drive_c/CODESYS/CODESYS/Common/CODESYS.exe --culture=en --profile="'"${profile}"'" --runscript="z:${1}.py" --noUI

sleep 1
killall Xvfb
rm -rf /tmp/.X91*
~~~


If you have any idea of why this error happens or any suggestion on what could be the reason I would gladly appreciate it.

Thanks in advanced,
Victor
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">vcbz</dc:creator><pubDate>Thu, 11 Aug 2022 08:53:28 -0000</pubDate><guid isPermaLink="false">https://forge.codesys.com/tol/codesys-4-linux/tickets/6/</guid></item></channel></rss>