MCTB
68
The error message will provide help in determining what is wrong with the equation; however, due to the number
of possible combinations it is up to the user to ultimately evaluate the equation and verify its validity. Once the
equation can be properly solved, pressing the “Done” button will return to the Math/Logic Configuration screen.
4.6.2
Math/Logic Equation Examples
The MCTB equation module is not designed for high speed calculation or logic purposes. The equation module
is not deterministic, i.e., does not operate on a fixed interrupt. The equations are scanned approximately once
every two seconds; however, file IO operations or remote communications, VNC activity, etc., could extend the
evaluation interval.
If your desired output control logic requires timing resolution better than the above scan rate, use separate
external device(s) to perform the required logic that are capable of the timing resolution needed.
4.6.2.1
Order of Operations
The MCTB supports standard math operators including addition (+), subtraction (-), multiplication (*) and
division (/). The power of the MCTB math/logic block, is that it allows free-form entry of any equation including
any combination of variables the system provides. Due to this however, when entering equations, it is important
to understand the standard order of operations or the result may not be what is expected. The standard order
of operations is a collection of rules that reflect conventions about which procedures to perform first in order to
evaluate a given mathematical expression.
For example, in mathematics and most computer languages (including the MCTB), multiplication is granted a
higher precedence than addition, and it has been this way since the introduction of modern algebraic notation.
Thus, the expression 2 + 3 × 4 is interpreted to have the value 2 + (3 × 4) = 14, not (2 + 3) × 4 = 20. Where it
is desired to override the precedence conventions, or even simply to emphasize them, parentheses ( ) can be
added to indicate an alternative order or reinforce the default order to avoid confusion. For example, by adding
parenthesis to the original expression, (2 + 3) × 4 forces addition to precede multiplication providing the result
of 20.
The same holds true for division and subtraction in which division is given a higher precedence than subtraction.
Therefore, when an equation is evaluated by the MCTB, multiplication and division are executed first from left
to right, and then addition and subtraction are performed from left to right. If parenthesis are included in the
equation, the expression(s) within the parenthesis are evaluated first.
Summary of Contents for MCTB 4.3
Page 24: ...MCTB 24...
Page 195: ...MCTB 195...
Page 227: ...MCTB 227 A 5 SmartIO Monitor Module Specifications...
Page 228: ...MCTB 228 A 6 Expansion IO Module Specifications...
Page 229: ...MCTB 229 A 7 Power Supply Specifications DIN Rail Mount Power Supply Specifications...
Page 230: ...MCTB 230...
Page 231: ...MCTB 231 Open Frame Power Supply Specifications...
Page 232: ...MCTB 232...
Page 233: ...MCTB 233 A 8 Power On Delay Relay Specifications GE1A C10HA110...
Page 234: ...MCTB 234...