您可以使用以下选项和参数启动命令行。
语法
<folder>Automation Builder.exe --<option>
当路径或选项参数包含空格、破折号或斜线符号时,必须写在直引号内。
选项--culture
(用户界面语言)
CODESYS 以指定语言启动。
语法
--culture=<culture>
<Culture>
:典型的语言代码如下:de、en、fr、it、es、zh-CHS。
示例
使用英文用户界面启动CODESYS :
Automation Builder.exe --culture=en
另见
-
linktarget doesn't exist but @y.link.required='true'
选项--profile
(CODESYS 配置文件)
CODESYS 直接使用指定的配置文件启动。在没有此选项的情况下启动CODESYS 时,会打开“Select Profile” 。
语法
--profile="<profile name>"
<profile name>
:您必须按照“帮助 关于” 开发系统闪屏或计算机开始菜单中显示的配置文件名称指定配置文件名称。
示例
Automation Builder.exe --culture=de --profile="Automation Builder 2.5"
选项--compare
(启动项目比较)
CODESYS 启动后,立即开始对两个CODESYS 项目进行比较。在选项后键入项目文件路径作为参数,然后键入参考项目的路径。CODESYS 启动并打开“Project Comparison - Differences” 视图。
语法
--compare="<path of project file>" "<path of reference project file>"
示例
Automation Builder.exe --compare "D:\proj\project1.project" "D:\proj\project2.project"
另见
选项--project
(打开CODESYS 项目)
CODESYS 启动,并打开指定项目。
语法
--project="<path of project file>"
<path of project file>
:项目文件路径
示例
打开test
项目:
Automation Builder.exe --culture=de --project="D:\projects\test.project"
另见
选项--projectarchive
(打开CODESYS 项目存档)
CODESYS 启动,提取指定的项目存档并打开项目。
语法
--projectarchive="<path of project archive file>"
<path of project archive file>
:项目存档的文件路径
示例
提取test.projectarchive
并在开发系统中打开项目:
Automation Builder.exe --projectarchive="D:\projects\test.projectarchive"
另见
选项--runscript
(运行脚本)
CODESYS 运行指定的脚本文件。
|
CODESYS 启动时运行 您必须提供脚本文件的完整路径。 |
|
该选项与 |
|
该选项与 CODESYS CODESYS 会打印脚本生成的所有错误、警告、编译器报告和命令行信息。脚本信息(1:严重性文本)可以与其他信息(2:Severity FatalError、Error、Warning、Information),使用
" |
|
该选项与 |
|
该选项与 如果未指定 |
|
该选项与
|
在脚本文件中使用 "sys.argv "传输参数的示例
start /b /wait Automation Builder.exe
--runscript="D:\Script\ArgvAnd__main__Test.py"
--scriptargs:'username password 3.14 "path=\"C:\temp\\"'
脚本文件: 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__)
输出结果:stdout
:
sys.argv: 6 elements: - D:\TestScripts\ArgvAnd__main__Test.py - username - password - 3.14 - path= "C:temp" __name__: __main__
有关__name__
全局变量的更多信息,请参阅 Python 文档。
信息输出示例
start /b /wait Automation Builder.exe --runscript="D:\Script\AmpelTest.py" --noUI 1>ScriptMessages.txt
CODESYS 将脚本生成的所有信息传递到ScriptMessages.txt
文件。其他信息将打印到命令行中。
start /b /wait Automation Builder.exe --runscript="D:\Script\AmpelTest.py" --noUI 2>NUL
CODESYS 会抑制所有信息,脚本信息除外。脚本信息会打印到命令行中。
选项 --scriptdebugger 的示例
以下initdebug.py
脚本已在基于pydevd
的调试器(如 PyDev / LiClipse 和 PyCharm)上成功测试。要使用此脚本,请使用以下命令行启动CODESYS :
--profile="Fanta Development Build" --scriptdebugger="D:\test\charmdebug\initdebug.py"
文件: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()
选项--ignorewhitespace
(在项目比较中忽略空格)
如果在--compare <project1> <project2>
选项之后添加该选项,则在项目比较中会忽略空白。请注意,与语义相关的空间,例如STRING
字面中的空间,仍会被考虑在内。
语法
--compare="<path of project file>" "<path of reference project file>" --ignorewhitespace="true"|"false"
示例
Automation Builder.exe --compare "D:\proj\project1.project" "D:\proj\project2.project" --ignorewhitespace="true"
另见
选项--ignorecomments
(忽略项目比较中的注释)
如果在--compare <project1> <project2>
选项之后添加该选项,则在项目比较中会忽略注释。
语法
--compare="<path of project file>" "<path of reference project file>" --ignorecomments="true"|"false"
示例
Automation Builder.exe --compare "D:\proj\project1.project" "D:\proj\project2.project" --ignorecomments="true"
另见
选项--ignoreproperties
(在项目比较中忽略对象属性)
如果在--compare <project1> <project2>
选项之后添加该选项,则在项目比较中会忽略对象属性(权限、编译设置、目录、位图等)。
语法
--compare="<path of project file>" "<path of reference project file>" --ignoreproperties="true"|"false"
示例
Automation Builder.exe --compare "D:\proj\project1.project" "D:\proj\project2.project" --ignoreproperties="true"
另见
选件--skipunlicensedplugins
(没有许可证不得加载组件)
CODESYS 启动。在这种情况下,将跳过是否仍应加载未授权组件的查询。如果是这样,那么CODESYS 并不 暗示加载这些组件。
示例
Automation Builder.exe --skipunlicensedplugins
选项--signaturethumbprint
(用于签署编译库的证书缩略图)
如果在--project="<path of project file>"
选项之后添加该选项,则会打开项目并传递用于签署编译库的证书缩略图。
语法
--signaturethumbprint="<thumbprint of digital signature>"
示例
Automation Builder.exe --project="D:\projects\test.project" signaturethumbprint="3E96C9B61010CBDC3186021A1CAA64946DDCAAF3"
另见
选项--enforcesignedcompiledlibraries
(强制签署已编译的程序库)
如果在选项--project="<path of project file>"
之后添加该选项,则在项目中的“Security Screen” 的“User” 选项卡上启用“Enforce signing of compiled libaries” 选项。




注意

打开和关闭“安全屏幕” 时,当前设置将应用到用户选项中,即使没有进行任何活动更改。
语法
--enforcesignedcompiledlibraries="true"|"false"
示例
Automation Builder.exe --project="D:\projects\test.library" --enforcesignedcompiledlibraries="true"
另见
选项--timestampingserverurl
(设置时间戳服务器地址)
如果在选项--project="<path of project file>"
之后添加该选项,则 RFC-3161 时间戳服务器的 Internet 地址(“时间戳服务器” )将在项目中的“安全屏幕” “ 用户” 标签页中设置。




注意

打开和关闭“安全屏幕” 时,当前设置将应用到用户选项中,即使没有进行任何活动更改。
语法
--timestampingserverurl="<URL of RFC-3161 timestamping server>"
示例
Automation Builder.exe --timestampingserverurl="http://timestamp.comodoca.com/rfc3161"
另见