Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

TaskCall

  • Last UpdatedFeb 02, 2024
  • 2 minute read

Calls a Cicode function by specifying the function name and providing an arguments string.

The function will be executed in a new Cicode task with the same cluster context as the current task. The current task will be blocked until the new task completes and a value can be returned.

This function cannot be called from page foreground animation code. If this is attempted, a hardware alarm will be raised and IsError() will return 282 (foreground Cicode cannot block).

You can use this function to call a private function, but only from within the file in which the private function is declared. See Function Scope.

TaskCall allows the function to be called and the arguments provided to be specified dynamically by the Cicode logic. This may be useful in some cases where the function needed is not known until runtime.

Plant SCADA requests the required I/O device data and waits for the data to be returned before starting the function.

Syntax

TaskCall(sName, sArgs)

sName:

The name of the function to call, as a string.

sArgs;

The arguments to pass to the function, separated by commas (,). Enclose string arguments in quotes "" and use the string escape character (^) around strings enclosed within a string.

Return Value

The result of the function call (as a string). If a void function is called, an empty string is returned. To see if an error occurred (such as an invalid function name or invalid arguments) call IsError().

TaskNew, TaskNewEx

Example

STRING result;

result = TaskCall("StrFill", "^"abc^",10");

// result will be set to "abcabcabca"

See Also

Task Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in