Cicode Programming Reference > Using Variables

Using Variables

A variable is a named location in the computer's memory where data can be stored. Cicode variables can store the basic data types (such as strings, integers, and real numbers) and each variable is specific for its particular data type. For example, if you set up a Cicode variable to store an integer value, you cannot use it for real numbers or strings.

Note: Each data type uses a fixed amount of memory: integers use 4 bytes of memory, real numbers use 4 bytes, and strings use 1 byte per character. PLC INT types use only 2 bytes.

The computer allocates memory to variables according to the data type and the length of time you need the variable to be stored.

Real-time variables (such as PLC variables) are already permanently stored in database files on your hard disk. Any variable you use in a database field command or expression needs to be defined as a variable tag, or the compiler will report an error when the system is compiled.

Note: Cicode variables can handle a wide range of CitectSCADA variable tag data types. For example, a Cicode variable of INT data type can be used to store I/O device data types: BCD, BYTE, DIGITAL, INT, LONG, LONGBCD, and UINT.

See Also

Using Arrays

Variable Declaration Standards

Variable Naming Standards

Variable Scope Standards

Using Cicode Files