Input action: Execute Command Permalink

Commands are listed here with transfer parameters that the visualization processes when an input event occurs.

“Configure commands”

_visu_icon_open_list.png
  • “Execute program on the plc”

  • “Execute program on client”

  • “Print”

  • “Navigate to URL (WebVisu)”

  • “Create Recipe”

  • “Read Recipe”

  • “Write Recipe”

  • “Write Recipe in File”

  • “Load Recipe from File”

  • “Delete Recipe”

Click the _visu_icon_add.png symbol to add the selected command to the lower command list.

_visu_icon_add.png

The command in “Configure commands” is added to the list.

_visu_icon_remove_command.png

The command is removed.

Requirement: A command is selected.

The order in the list defines the order of execution.

_visu_icon_down_command.png

The selected command is moved down one position in the list.

_visu_icon_up_command.png

The selected command is moved up one position in the list.

Table 838: Command: Execute program on the plc

“Command”

“1st parameter”

“2nd parameter”

‎ExecutePlcProgram‎

‎'C:\programs\notepad.exe'‎

‎'Notes_A.txt'‎

EXE file that is executed on the controller

The program is executed on the PLC and therefore it must not be interactive or have any user interfaces.

It is possible, for example, for a program to copy a file.

Program name with directory as a string in single straight quotation marks

Arguments of the program as a string in single straight quotation marks

Example: Name of the file that the program opens

Table 839: Command: Execute program on client

“Command”

“1. Parameters”

“2. Parameters”

‎ExecuteClientProgram‎

‎'C:\programs\notepad.exe'‎

‎'Notes_A.txt'‎

EXE file that is executed on the display variant. Exception: WebVisu.

The program is executed within the context of the display variant. After this, the program may be interactive and have a user interface.

Program name with directory as ‎STRING‎ in single straight quotation marks

Arguments of the program as ‎STRING‎ in single straight quotation marks

Example: Name of the file that the program opens

NOTICE

NOTICE
NOTICE
NOTICE

NOTICE

NOTICE

If the visualization is displayed as a CODESYS WebVisu, then no program (EXE file) can be started.

Table 840: Command: Navigate to URL (WebVisu)

“Command”

“1. Parameters”

“2. Parameters”

‎NavigateURL‎

‎'http://en.wikipedia.org'‎

‎PLC_PRG.stURL‎

‎'replace'‎

The visualization navigates to the web page of the URL.

Requirement: The visualization is executed as a CODESYS WebVisu.

URL

  • As a literal in single straight quotation marks

  • As a variable (STRING)

If a parameter is not specified, then the web page is displayed in a new window or a new tab.

If ‎'replace'‎ is specified, then the CODESYS WebVisu is replaced by the web page.

Table 841: Command: Read Recipe

“Command”

“1st parameter”

“2nd parameter”

‎ReadRecipe‎

‎'RecipeDefinitionForModules'‎

‎'RecipeModuleA'‎

Name of the recipe definition

  • As a literal

  • As a variable (‎STRING‎)

Name of the recipe

  • As a literal

  • As a variable (‎STRING‎)

At visualization runtime, the controller reads the actual values from the variables of the recipe definition and writes them to the specified recipe. The values are saved implicitly (to a file on the controller) and shown in the recipe definition in the Recipe Manager of CODESYS. In other words, the recipe which is managed in CODESYS is updated with values from the controller.

Table 842: Command: Write Recipe

“Command”

“1. Parameters”

“2. Parameters”

‎WriteRecipe‎

‎PLC_PRG.stRecipeDef‎

‎PLC_PRG.stRecipe‎

Name of the affected recipe definition

  • As a literal

  • As a variable (‎STRING‎)

Name of the recipe (from the recipe definition)

  • As a literal

  • As a variable (‎STRING‎)

At visualization runtime, the values of the recipe are written to the variables on the controller as they are in the Recipe Manager.

Table 843: Command: Save Recipe in File

“Command”

“1. Parameters”

“2. Parameters”

‎SaveRecipeAs‎

‎PLC_PRG.stRecipeDef‎

‎PLC_PRG.stRecipe‎

Name of the affected recipe definition

  • As a literal

  • As a variable (‎STRING‎)

Name of the affected recipe that is updated and saved to a file

  • As a literal

  • As a variable (‎STRING‎)

Optional parameter: If you do not specify a transfer parameter here, then the values from the recipe variables are saved only the file that is specified later. The implicit recipe files are not updated.

At visualization runtime, the “Save Recipe as” dialog opens and prompts the user for a file name and a storage location on the controller. The file name must not be ‎<recipe>.<recipe definition>‎. The file extension is ‎.txtrecipe‎.

The user can then save the file that includes the actual values from the recipe variables. If a transfer parameter is not specified in the 2nd parameter, then the file is saved without changing an implicit recipe file. If a transfer parameter is given in the 2nd parameter, then the implicit recipe file is also updated.

Note: If the “Save recipe changes to recipe files automatically” option is selected in the “Recipe Manager – General” tab, then the recipe definition in CODESYS and the implicit recipe files are kept the same automatically.

Note: Implicit (automatically generated) recipe files exist on the controller with names in the following syntax: ‎<recipe>.<recipe definition>.txtrecipe‎. These are typically used in the application as a buffer when reading and writing recipe variables.

Table 844: Command: Load Recipe from File

“Command”

“1st parameter”

“2nd parameter”

‎LoadRecipeFrom‎

‎PLC_PRG.stReccipeDef‎

‎PLC_PRG.stReccipe‎

Name of the affected recipe definition

  • As a literal

  • As a variable (‎STRING‎)

Name of the affected recipe

  • As a literal

  • As a variable (‎STRING‎)

At visualization runtime, the “Load Recipe” dialog opens. It provides the visualization user with a file list that is located in the file system of the controller and filters by the extension ‎txtrecipe‎. The selected file is downloaded. Then the recipes from the file are written to the implicit files and read to the given recipe in the recipe definition of the Recipe Manager.

Requirement: The file was created with the ‎SaveRecipeAs‎ command.

Table 845: Command: Create Recipe

“Command”

“1. Parameters”

“2. Parameters”

‎CreateRecipe‎

‎PLC_PRG.stRecipeDef‎

‎PLC_PRG.stRecipe_New‎

Name of the affected recipe definition

  • As a literal

  • As a variable (STRING)

Name of the new recipe

  • As a literal

  • As a variable (STRING)

At visualization runtime, a new recipe is created in the given recipe definition.

Table 846: Command: Delete Recipe

“Command”

“1. Parameters”

“2. Parameters”

‎DeleteRecipe‎

‎PLC_PRG.stRecipeDef‎

‎PLC_PRG.stRecipe‎

Name of the affected recipe definition

  • As a literal

  • As a variable (‎STRING‎)

Name of the recipe

  • As a literal

  • As a variable (‎STRING‎)

At visualization runtime, the specified recipe is deleted from the recipe definition.