Previous PageNext Page

Understanding Objects & Variables

What is a Variable?

A variable is something that can assume any number of values. Variables are given names for unique identification. Variables can be anything from numbers (1, 2, 3...4.5, 5.6) to text based (ABCDEF).

Variables are an important part of understanding how EZ LADDER® uses functions and objects. Each object will require at least one variable to operate properly (either the object uses a variable directly or variables are connected to it using links). The variable types are dependent upon the type of hardware target and the function being placed or used.

Objects (functions) use these variables to “pass” and store changeable values in the ladder diagram project.

 

Variable Types

There are five basic variable types (target dependent). Boolean (BOOL), REAL, INTEGER, TIMER, and STRING.

Boolean variables are based on true/false (on/off). The object which uses a boolean variable will either be true or false. When a coil or contact is placed, it is directly tied to a Boolean variable name. Booleans can simply be considered either a 0 or 1 (false or true).

Real variables are based on numbers that use floating point math (use decimal points). Real variables can be ranged from -1.7x1038 to 1.7x1038. Reals are typically used for calculations and with functions where decimal point accuracy is required.

Integer variables are based on whole numbers (no decimal points) Integers can be ranged from -2147483647 to 214483647. Integers are used when decimal points are not required.

String variables are used to represent non-numerical data such as characters to display or transmit serially.

Examples of Variables:

Boolean: 0 or 1, False or True, Off or On
Real: 234.56, 192.345
Integer: 1, 525, 1034
Timer: Days, Hours, Minutes, Seconds, Milliseconds
String: This is a string.

 

Variable Properties

When adding new variables, each variable will have properties that will need to be configured. These properties are different for each different type of variable.

Integer / Real / Boolean Variable Properties

The integer, real and boolean variable types share the same required properties.

Note: For the Variable I/O Number and the Default Value; only one field will be active to enter data into. The active field will depend on the type of variable selected.


Timer Variable Properties

Timer variables are required to be used as variables on timer objects for ET (Elapsed Time) and PT (Preset Time). When a timer variable is placed, a different dialog box appears for setting the timer parameters.


Note: Larger times may be entered into fields provided that the total timer value does not exceed 24 days. For example, 1000 ms may be entered and will be considered 1 second when the program executes. However, if 750 hours is entered, its time is greater than 24 days and the timer will not function correctly.

Retentive Variables

In the event of a power loss to the target, EZ LADDER® is designed to allow ladder diagram variables to be stored and then be reloaded when power is restored. This is called the Retentive feature. To use the Retentive feature, the hardware target must support it. As seen above, when variables are defined, selecting the retentive box enables the variable to be retained (or it is non-volatile).

  Previous PageNext Page