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

AVEVA™ Plant SCADA

Declaring Functions

  • Last UpdatedJul 18, 2023
  • 1 minute read

The required FUNCTION Statement follows the optional Scope Statement (if used) and the optional Return Data Type Statement (if used), and precedes any other statements of a function declaration in Cicode. Everything between it and the END Statement, contains the function.

Both FUNCTION and END are Cicode keywords and, as such, are reserved.

You declare the start of a function with the FUNCTION Statement, and declare the end of a function with the END Statement:

FUNCTION
<FunctionName> ( <Arguments> )
<Statement> ;
<Statement> ;
<Statement> ;
END

The FUNCTION Statement needs to be followed by the Name Statement, then the Argument Statement, before any code statements that will be processed by the function.

For information on the Name and Argument Statements, see the sections titled Naming Arguments and Function Argument Structure.

The code (as represented by the <Statement> placeholders) located between the FUNCTION and END Statements, will be executed (processed by the function) when called to do so.

Functions can execute a large variety of statements, and are commonly used to process and manipulate data, including the arguments passed when the function was called, plant-floor and other Plant SCADA data, Windows data, and so on. Plant SCADA provides many built-in functions. For more information, see the section titled Working with Commonly Used Functions.

See Also

Writing Functions

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