ExecuteScript: Run Script Commands
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
To see the general representation in IL or ST language, refer to the chapter Function and Function Block Representation.
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 |
Indicates the type of the execute script detected error. |
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=> );