Predefined Calculated Variables
(Original Document)
Building-up an Integer Variable
This function allows you to build one integer variable from several boolean variables using the Building up an integer variable from boolean variables dialog box.
Using the Boolean Variable Dialog Box
The Create an integer variable from boolean variables dialog box creates a calculated integer variable, where the value of the bits corresponds to the value of other boolean variables. The equation model used is:
VAR1*1 + VAR2*2 + VAR3*4 + VAR4*8 + VAR5*16 + VAR6*32 + VAR7*64 + VAR8*128 + ...
VARx is a boolean variable.
Dialog Box Options
Description
Define the Integer Variable Size
Number of bits to edit.
Integer Variable
List of the value of all bits to edit.
Boolean Value
Three mark values are available:
  • Constant 0 and 1
  • Status of an existing boolean variable:
    Modules: This drop-down list features all the modules available in the configuration.
    Trending Tool variables: This list contains all the variables of the selected module.
OK
This button allows you to create the calculated variable described above and closes the dialog box.
Cancel
This button closes the dialog box.
Extraction of Boolean Variable(s)
Constraints
The selected variables must be integer variables.
Results
This function allows you to extract bits from one integer variable. So, boolean variables are created using the Extraction of boolean variable(s) from an integer variable dialog box.
Using Extract Boolean Variable(s) Dialog Box
The Extract boolean variable(s) from an integer variable dialog box creates calculated boolean variables that represent the status of the bits of an integer variable. The equation model used for boolean variables is:
INTEGER->BOOLEAN((INTEGER VARIABLE) LOGICAL AND (CONSTANT = BIT NUMBER))
Dialog Box Options
Description
Integer variable
Contains the selected integer variable from which you want to extract the boolean variables.
Select the bits you want to record
If you chose to follow some bits of the variable only, you must click the buttons in this zone to determine precisely which bits to follow.
OK
This button allows you to create the calculated variables described above and closes the dialog box.
Cancel
This button closes the dialog box.
Help
Open a window featuring an online help related to the dialog box.
Convert BCD Into Integer
Constraints
The selected variables must be integer variables.
Results
For each selected variable, a new calculated variable is created which value is equal to BCD variable value. The template of the equation is:
((VARIABLE) LOGICAL AND (CONSTANT = 0x0F)) PLUS
((((VARIABLE) DIVIDE (CONSTANT = 0x0010)) LOGICAL AND (CONSTANT = 0x0F)) MULTIPLY (10)) PLUS
((((VARIABLE) DIVIDE (CONSTANT = 0x0100)) LOGICAL AND (CONSTANT = 0x0F)) MULTIPLY (100)) PLUS
((((VARIABLE) DIVIDE (CONSTANT = 0x1000)) LOGICAL AND (CONSTANT = 0x0F)) MULTIPLY (100)) PLUS
where VARIABLE is supposed to be a BCD type variable.