...
Refer to the following sections for further details about the Rules Processing System.
Rule Specifications - Definition of rules and their parameters
Class Libraries - C/C++ API for working with rules
Rules Manager Process - Creating a custom rules processor
User Interface - Creating a custom HMI
...
Rule Specifications
...
Expand | ||
---|---|---|
| ||
In general, the rule criteria are the conditions that must be met before the rule actions can be taken. Each of the Boolean statements specified in a criteria group must be satisfied in order to consider the criteria group completely satisfied and to trigger the output actions. This is equivalent to saying that all of the Boolean statements contained in a criteria group are AND’ed together to produce the value of the entire expression. This includes any sub-criteria groups that are contained within a parent criteria group. However, the rule itself may contain multiple criteria groups. Each of these root criteria groups are OR’ed together during evaluation of the rule to produce the final result. Because any Boolean statement can be represented in Sum-Of-Products form (the logical-OR of groups of AND’ed statements), this criteria group structure is capable of storing any Boolean statement. Currently, the only type of criteria that may be specified in an operational rule is a VariableCondition. VariableCondition CriteriaA VariableCondition is an expression containing variables from global common and/or constant values. The condition is considered true if the expression evaluates to a non-zero value, otherwise the condition is considered false. A VariableCondition expression is formatted identically to a standard Variable Operation. Following are examples of VariableConditions:
|
Expand | ||
---|---|---|
| ||
In general, the rule actions are those instructions carried out when the rule criteria conditions are met. The order of actions performed corresponds to the order in which they are specified in the rule definition. Any action that cannot be performed due to improper formatting or variable types will be skipped and the following action performed. In this case, a log entry will be generated to record the error event. Currently, the only type of action that may be specified in an operational rule is a ModifyVariable statement.
ModifyVariable Actions
GlobalVariable = Expression where: GlobalVariable is the fully qualified name of variable in global common whose type is int, float, double, long, short, char, or char[]. Expression is any expression in a form identical to a standard Variable Operation.
The following special conditions apply:
Following are examples of valid expressions:
|
...
The Rules Processing System API consists of a set of hierarchical classes defined in the TSENTRY tpriNtRt C/C++ library. See the tpriRps library documentation for more details about these classes.
...
Expand | ||
---|---|---|
| ||
In general, a rules manager process runs periodically (i.e. every 5 seconds) in the background on the host control system. It is responsible for the following tasks:
A manager process is not provided with TSENTRY. Custom implementations of a rules processing system can either use the default tpriRpsProcessor class to create a rules processor object or they can extend the tpriRpsProcessor class to customize the rules processor object. All that is required then within the manager process is to create and initialize the tpriRpsProcessor or tpriRpsProcessor‑derived object and then periodically call the ProcessRules() member function to perform rules processing. |
...
A complete user interface is not provided with TSENTRY; however, TSENTRY does provide an HMI object, TPRI.RpsEditor, that can be used to build a customized HMI for a Rules Processing System.
...