SYSTEM

Function Name

SYSTEM

Description

Allows an .exe file or a batch file to be executed from a Logic program.

The SYSTEM function places each execute command in a list, with the latest command being added to the bottom of the list. The commands are executed in turn and can only be executed when the previous command has been executed (if the command runs an application, the application has to be closed before the next system command is executed). For this reason, there can be delays between the time a Logic program is run and the time the executable file is executed (the command from the SYSTEM function is placed in a queue).

Geo SCADA Expert executes the command on the main server. Therefore, the .exe file or batch file must exist on all servers (except permanent standbys) and must be in the same location on each server.

Arguments

IN {STRING}

The IN input is a string that specifies the path to an executable file or a batch file.

Geo SCADA Expert will execute the executable file or batch file at the location specified in the IN input. If Geo SCADA Expert cannot find the .exe file or batch file at the defined location, the SYSTEM function will have no effect.

For more information on the data types for the inputs and outputs, see Data Type Hierarchy.

Returns

Zero {DINT}

The SYSTEM function returns zero.

Do not use SYSTEM to call interactive processes (for example, running interactive programs like Microsoft® Notepad®). The Geo SCADA Expert server runs as a Windows® service and therefore any interactive process will not be visible on the Windows desktop. Consequently, the process will run until the timeout period has elapsed (see System Calls Settings in the Geo SCADA Expert Guide to Server Administration), or a user ends the process (for example, by using Task Manager).

If system calls are disabled, the credentials are invalid or user impersonation has failed, the SYSTEM function will fail. For more information, see System Calls Settings in the Geo SCADA Expert Guide to Server Administration.

Example:

Function Block Diagram - SYSTEM:

In this example, the IN input is 'C:\Windows\Nd.exe', so when the program executes, the Nd application will run.

ST Program - SYSTEM:

To use a SYSTEM function in an ST program, you need to use this syntax:

VAR

A : DINT;

END_VAR

A := SYSTEM( 'C:\Windows\SetInstall.exe' );

The output of the SYSTEM function has to be stored as a variable (DINT). In this case, a variable named A is used and the string for the SYSTEM's IN input is 'C:\Windows\SetInstall.exe'.

Further Information


System Calls Settings in the Geo SCADA Expert Guide to Server Administration.

Monitoring system calls:

Latest System Calls in the Geo SCADA Expert Guide to the Server Status Tool.

Queued System Calls in the Geo SCADA Expert Guide to the Server Status Tool.


Disclaimer

Geo SCADA Expert 2022