Using CitectSCADA > Tagging Process Variables > Configuring Local Variables

Configuring Local Variables

Local variables allow you to store data in memory when you start your runtime system. They are created each time the system starts, and therefore do not retain their values when you shut down. Local variables may be of any data type supported by CitectSCADA, including two-dimensional arrays of standard CitectSCADA types.

Local variables are useful when you need each process to have a separate copy of the data. Each process has its own copy of each local variable configured in the project, and the values in a local variable are available only to the process that wrote them.

To configure a local variable:

  1. In Project Editor, select Tags | Local Variables. The Local Variables dialog displays.
  2. In the Name field, enter a name for the local variable. Variable names cannot include the '-', '/', '%' or <space> characters.
  3. In the Data Type field (16 characters), select one of the following supported data types:

    Data Type

    Variable

    Size

    Allowed Values

    BCD

    Binary- Coded Decimal

    2 bytes

    0 to 9,999

    BYTE

    Byte

    1 byte

    0 to 255

    DIGITAL

    Digital

    1 bit or 1 byte

    0 or 1

    INT

    Integer

    2 bytes

    -32,768 to 32,767

    UINT

    Unsigned Integer

    2 bytes

    0 to 65,535

    LONG

    Long Integer

    4 bytes

    -2,147,483,648 to 2,147,483,647

    LONGBCD

    Long Binary- Coded Decimal

    4 bytes

    0 to 99,999,

    REAL

    Floating Point

    4 bytes

    -3.4E38 to 3.4E38

    STRING

    String

    up to 256 bytes

    ASCII (null terminated)

  4. Numeric and digital variables have a default value of 0 and string variables default to "" (empty string). If you do not specify a data type, the local variable will be treated as 16-bit integer.

  5. 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 type specified in the Data Type field. The array can be one or two-dimensional. Up to 32766 elements can be used, which, for a two dimensional array, means that the size of the first dimension multiplied by the size of the second is less than or equal to 32766. When specifying a multi-dimensional array, separate the dimensions with a comma, for example "20,30"."
  6. In the Zero Scale field (11 characters), enter the value of the local variable that represents the zero point for the data. 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.
  7. In the Full Scale field (11 characters), enter the value of the local variable that represents the full scale point of the data. 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.
  8. In the EngUnit field, enter the engineering units that the value represents (for example %, deg, mm/sec, etc.). This property is optional. If you do not specify engineering units, no engineering units are used.
  9. In the Format field, Enter 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 ####.#.
  10. In the Comment field, enter any useful comment. This property is optional and is not used at runtime.
  11. Click Add.

See Also