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

Add Commands in the menu to call specific PY script

rsprich
2016-06-08
2016-06-22
  • rsprich - 2016-06-08

    Hi,

    the command "Execute Script file..." open a dialog box for choosing the PY file.

    Is there a way to give a parameter to select a specific script file ?

    So, i will able to add commands in a dedicated menu (each calling a different script).

    Regards.

     
  • mkeller - 2016-06-09

    Hi rsprich.

    rsprich hat geschrieben:
    Hi,
    the command "Execute Script file..." open a dialog box for choosing the PY file.
    Is there a way to give a parameter to select a specific script file ?
    So, i will able to add commands in a dedicated menu (each calling a different script).
    Regards.

    The command has one parameter for the path of the python script but you can't use "Customize..." to create your own entries with it. BUT in the upcoming release of CODESYS V3.5 SP9 we added a new feature which might suites your needs:

    Zitat:
    The CODESYS base directory can contain a sub directory "ScriptDir" which will be searched for python scripts with the file extension ".py". The found python scripts can be executes through the new popup menu "Scripts" below the existing menu "Scripting".

    You can use it by adding the new commands "A" ... "Z" and "..." from the ScriptEngine Commands to a new popup menu or any other place you want.
    BR
    Martin

     
  • rsprich - 2016-06-22

    Thank you for your answer. So, waiting for the SP9...

     
  • mkeller - 2016-06-22

    Hi rsprich.

    CODESYS V3.5 SP9 was released last week.

    BR
    Martin

     

Log in to post a comment.