You can configure up to 32 icons that will be displayed in a toolbar to access Python script files with one click.
Components required:
An .ico file defining the icon.
A .py file storing the Python script.
A config.json file specifying the call information outline for each icon. A maximum of 16 icons can be configured per file.
To configure more than 16 icons, create two config.json files and store each file at one of the following locations:
C:\Program Files\Schneider Electric\EcoStruxure Machine Expert\Script Commands
<ESME_Installation_Directory\LogicBuilder\Script Commands, for example, C:\Program Files\Schneider Electric\EcoStruxure Machine Expert\V2.0\LogicBuilder\Script Commands
When you start EcoStruxure Machine Expert, the script calls and the related icons are added to the dialog box in the tab , category . You can add them to a new or to an existing toolbar in the tab of the dialog box.
Each config.json configuration file contains the following required and optional elements:
Element |
Required |
Description |
---|---|---|
"Name" |
Yes |
This text is displayed as a tooltip for the icon in the toolbar. Example:
|
"Desc" |
No |
This element is not used in EcoStruxure Machine Expert. |
"Icon" |
Yes |
This element contains the name of the image file (in .ico format) if the image file is located in the same folder (Script Commands) as the config.json file. Example:
If the image file is not located in the (Script Commands) folder, you can add the path information here, such as |
"Path" |
Yes |
This element contains the name of the Python script file in .py format if the script file is located in the same folder (Script Commands) as the config.json file. Example:
If the script file is not located in the (Script Commands) folder, you can add the path information here, such as |
"Params" |
No |
Use this element only if the script requires parameters. Example:
|
A config.json file can have the following content:
[
{
"Name": "Start Process1",
"Desc": "Processing1",
"Icon": "process1.ico",
"Path": "proc1.py",
},
{
"Name": "Start Process2",
"Desc": "Processing2",
"Icon": "process2.ico",
"Path": "proc2.py",
"Params":
[
"exit"
]
}
]
The folder Script Commands thus contains the following files:
config.json
process1.ico
proc1.py
process2.ico
proc2.py
The
list of the dialog box contains the following entries that you can add to a toolbar:Start Process1
Start Process2
Click an icon in the toolbar to execute the respective script file.