Add Event Action — Math |
Topic: CM011![]() |
The math instruction solves a user-defined formula when the condition defined in event type transitions to TRUE. Develop the formula in the math dialog using the on-screen keypad, the computer keyboard, and Tag Name Database.
Configure an Action
The basic steps are the same for adding any Event Action to an Event. See Adding Event Actions - The Basics.
- In the Result Tag field, click the drop-down arrow or browse to the tag you want to assign.
- The result value is adjusted to the Data type of the Result Tag.
- In the Formula text box, enter a formula or alternately select Keypad to open a more comprehensive keypad window. Enter tags into the formula using the Tag Browse button.
- Using the key descriptions in this table, develop your formula. See the formula example at the end of this topic.
You can nest parenthetical expressions up to eight levels deep.
If Floating Point Data Type is used in any operation, then all operations are based on floating point math. The solution is stored in the Data format selected for the result.
Error Flags: These internal system tags are provided to programmatically react to an unexpected condition.
- SYS MATH ERROR
- SYS MATH DIVISION ERROR
- SYS MATH OUT OF RANGE
- SYS MATH ERROR EVENT NUM
See System Tags for more information.
|
Note: Maximum Embedded Tags = 8. |

An inventory forecast of a part needed for production is calculated every morning before the day’s production starts. The resulting value is used in another event to alert purchasing to replenish stock, or to email a supervisor to reorganize production plans.