ExecuteScript: Run Script Commands

Function Block Description

This function block can run the following USB script commands:

oDownload

oUpload

oSetNodeName

oDelete

oReboot

Refer to Script and Files Generation with USB Mass Storage

Graphical Representation

G-SE-0017244.2.jpg

 

 

IL and ST Representation

To see the general representation in IL or ST language, refer to the chapter Function and Function Block Representation.

I/O Variable Description

This table describes the input variables:

Input

Type

Comment

xExecute

BOOL

On detection of a rising edge, starts the function block execution.

On detection of a falling edge, resets the outputs of the function block when any on-going execution terminates.

NOTE: With the falling edge, the function continues until it concludes its execution and updates its outputs. The outputs are retained for one cycle and reset.

sCmd

STRING

USB script command syntax.

Simultaneous command executions are not allowed: if a command is being executed from another function block or from USB script then the function block queues the command and does not execute it immediately.

NOTE: A USB script executed from a USB memory key is considered as being executed until the USB key has been removed.

This table describes the output variables:

Output

Type

Comment

xDone

BOOL

TRUE indicates that the action is successfully completed.

xBusy

BOOL

TRUE indicates that the function block is running.

xError

BOOL

TRUE indicates error detection; the function block aborts the action.

eError

ExecuteScriptError

Indicates the type of the execute script detected error.

Example

This example describes how to execute an Upload script command:

VAR
EXEC_FLAG: BOOL;
ExecuteScript: ExecuteScript;
END_VAR
ExecuteScript(
xExecute:= EXEC_FLAG,
sCmd:= 'Upload "/usr/Syslog/*"',
xDone=> ,
xBusy=> ,
xError=> ,
eError=> );