Command-Line integration

This Module allows you to read and also write variable values and statuses from an command-line utility. This command line utility can be invoked as an ordinary command line utility, such as “cmd.exe” or “Powershell”, by giving it command line arguments.

This module allows you to write external scripts that retrieve or write data from/to VisXpert variables. The variables that can be read or written, are not restricted to an driver, and thus also PLC bound variables can easily be written to the respective Controllers.

This allows you for example to use scripts to fetch data from custom data sources and then write them into VisXpert variables where they can be written to the respective logical controllers (Plc).

The Functionality can be integrated into Shell-Scripts, Powershell-Scripts or any other Scripting language that is able to invoke executables.

If you need better integration and control, you can look into the .Net Libraries that are also available.

Adding to the Project

To be able to use this ability, the “CmdLine” module must be added to the configuration first. If this module is not configured, all Command line accesses will be denied.

Running an Command

To run an command you have to invoke the “VxVar.exe” command line tool, found in the binary directory inside you VisXpert installation directory. For example: “D:\Program Files (x86)\VisXpert\bin\VxVar.exe”

This path is NOT automatically added to the global “PATH” Environment variable, so you have to specify the fully qualified Path name to be able to invoke the executable.

The “VxVar.exe” is only available locally on the computer where VisXpert is installed and is running on. It is not available via Network communication or as stand alone application.

Command Line Arguments

The “VxVar.exe” has several arguments that can or must be passed to determine what action is requested. For this the tool implements the following arguments:

  • Verbose: Print more information to the Console. Only for debugging. Allows you to see what is happening
  • Get: Retrieve the Value of an VisXpert variable and return it to StdOut
  • Set: Set the Value of an VisXpert variable
  • Name: The “Group:VarName” VisXpert variable to be Set or Get
  • Value: the Value of an VisXpert variable

The Name and Values must be enclosed in double quotes

Examples

Read and write an value using the built-in windows Cmd.exe

Read and write an value using the built-in windows Powershell

Print Friendly, PDF & Email