Add a Local Variable
- Last UpdatedJul 08, 2025
- 3 minute read
Local Variables allow you to store data in memory when you start your runtime system.
To add a local variable:
-
In the System Model activity, select Variables.
-
On the menu below the Command Bar, select Local.
-
The local variables list will display in the Grid Editor.
-
Add a row to the Grid Editor.
-
Type the required information in each column, or in the fields in the Property Grid.
For a description of the properties, see below.
-
Click Save.
Local Variables Properties
General Properties
|
Field |
Description |
|---|---|
|
Name |
You can use any name for a tag (79 characters) provided it follows Tag Name Syntax and is not the same as the name of a Cicode function within the project or any included projects. See Reserved Words for a list of restrictions on naming. |
|
Data Type |
The data type of the variable (16 characters). Select one of the following supported data types:
|
|
Array Size |
In the Array Size field (8 characters), enter the size of the array (number of elements) used to store the local variable. The array will be of the data types specified in the Data Type field. The array can be one- or two-dimensional. When specifying a two dimensional array, separate the dimensions with a comma (for example "20,30"). Up to 32768 elements can be used for a one-dimensional array. For a two-dimensional array, the size of the first dimension multiplied by the size of the second needs to be less than or equal to 32768. The compiler will generate an error message if:
|
|
Eng Units |
The engineering units that the value represents (for example, %, deg, or mm/sec). This property is optional. If you do not specify engineering units, no engineering units are used. |
|
Format |
(11 characters). The display format of the value (of the variable) when it is displayed on a graphics page, written to a file, or passed to a function (that expects a string). This property is optional. If you do not specify a format, the format defaults to ####.##. For more information, see Format Specifiers. |
|
Comment |
Any useful comment (254 characters). |
Scale Properties
|
Field |
Description |
|---|---|
|
Zero Scale |
Enter the value that represents the zero point for the local variable's data (11 characters). The zero scale value is used as the lower limit for trend and bar graphs, and values below the zero scale value will cause an "Out of Range" alert message in the runtime system. |
|
Full Scale |
Enter the value that represents the full scale point for the local variable's data (11 characters). The full scale value is used as the upper limit for trend and bar graphs, and values above the full scale value will cause an "Out of Range" alert message in the runtime system. |
Project Properties
|
Property |
Description |
|---|---|
|
Project |
The project in which the local tag is configured. |