The specified script file is run by CODESYS.
|
CODESYS runs the You have to provide the complete path of the script file. |
|
Use this option with the |
|
Use this option with the The CODESYS user interface is not opened. CODESYS outputs all errors, warnings, compiler reports, and command-line messages generated
from the script. The script messages (1: Severity Text) can be separated from other
messages (2: Severity FatalError, Error, Warning, Information) with the |
|
Use this option with the |
|
Use this option with the If you do not specify |
|
Use this option with the
|
Examples of using transfer parameters in script files with 'sys.argv'
start /b /wait Automation Builder.exe
--runscript="D:\Script\ArgvAnd__main__Test.py"
--scriptargs:'username password 3.14 "path=\"C:\temp\\"'
Script file: ArgvAnd__main__Test.py
from __future__ import print_function import sys print("sys.argv: ", len(sys.argv), " elements:") for arg in sys.argv: print(" - ", arg) print() print("__name__: ", __name__)
Output result: stdout
:
sys.argv: 6 elements: - D:\TestScripts\ArgvAnd__main__Test.py - username - password - 3.14 - path= "C:temp" __name__: __main__
For more information about the __name__
global variable, see the Python documentation.
Examples of the message output
start /b /wait Automation Builder.exe --runscript="D:\Script\AmpelTest.py" --noUI 1>ScriptMessages.txt
CODESYS passes all messages which are generated by the script to the ScriptMessages.txt
file. Other messages are printed to the command line.
start /b /wait Automation Builder.exe --runscript="D:\Script\AmpelTest.py" --noUI 2>NUL
CODESYS suppresses all messages, except for script messages. The script messages are printed to the command line.
Example of using the –scriptdebugger option
The following initdebug.py
script was tested successfully with pydevd
-based debuggers, such as PyDev / LiClipse and PyCharm. To use this script, start
CODESYS with the following command line:
--profile="Fanta Development Build" --scriptdebugger="D:\test\charmdebug\initdebug.py"
File: initdebug.py
:
from _future_ import print_function from _future_ import unicode_literals import sys sys.path.append(r"D:\test\Env2\Lib\site-packages\pycharm-debug.egg") import pydevd def scriptdebuggersetup(): pydevd.settrace('localhost', port=51234, stdoutToServer=True, stderrToServer=True) def scriptdebuggershutdown(): pydevd.stoptrace()
For more information, see: and ⮫ http://docs.python.org/tutorial/modules.html