Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Cannot access primary project with --noUI option

sg
2016-12-13
2016-12-14
  • sg - 2016-12-13

    I am trying to run a script which accesses the project and does manipulations to it. This is run through command line. When I run it with --noUI option projects.primary returns None in the script.

    It runs fine when run with UI. Am I missing something here.

    It can be recreated with the project and script attached and the following command:

    "C:\Program Files (x86)\3S CODESYS\CODESYS\Common\Codesys.exe" --noUI --project="UnitTests.project" --profile="CODESYS V3.5 SP9 Patch 5" --runscript="t1.py"
    

    CodesysTest.zip [38.9 KiB]

     
  • mkeller - 2016-12-14

    Hi Shabroz.Gill.

    Shabroz.Gill hat geschrieben:

    "C:\Program Files (x86)\3S CODESYS\CODESYS\Common\Codesys.exe" --noUI --project="UnitTests.project" --profile="CODESYS V3.5 SP9 Patch 5" --runscript="t1.py"
    

    First you can try to put the at the end of the parameters, in the case the order of the parameters causes your problem.

    If you always open the same project why not open the project from within the python script. When you have to open different projects, you can open the project from within the python script but use the parameter to transfer the project path to the script.

    BR
    Martin

     

Log in to post a comment.