执行脚本

概述

您可以从 EcoStruxure Machine Expert 用户界面来执行包含一系列脚本命令的脚本文件 (filename.py)。

有关从 EcoStruxure Machine Expert 用户界面运行脚本的更多信息,请参阅脚本相关命令章节。

批处理文件

常用命令

命令

描述

- REM ::

此行是注释,将被忽略。

cd

切换到另一个目录。

echo off

不显示命令。

@

echo

在编程控制台上显示字符串串或变量。

set

声明变量并向此变量赋值。

>

将输出写入文件。如果文件已存在,则该文件将被覆盖。

>>

将输出附加到文件。如果文件不存在,则将创建该文件。

应用示例:

@echo off
REM Go to the directory where EcoStruxure Machine Expert is installed
cd "<Replace this with the path to the LogicBuilderShell.exe, for example, C:\Program Files\Schneider Electric\EcoStruxure Machine Expert\V2.0>"
REM Run LogicBuilderShell.exe with no graphical user interface and the full path to the script
LogicBuilderShell.exe "<Replace this with the full file path where the script is stored, for example, D:\MyScripts\TestScript.py>"
pause