Event Detector¶
Introduction¶
The Event Detector monitors a chosen input variable and reports when it crosses a specified threshold value. It can record the time of the crossing, increment an event counter, and write a trigger signal to an output event variable.
It behaves like a simple threshold sensor or comparator in a real control system. It is often used to capture important milestones in a simulation, such as the time at which dissolved oxygen drops below a critical limit, when to trigger a feed addition, or how to count repeated oscillation cycles. By writing an event trigger flag and recording event times and counts, the event detector provides a convenient way to link physical thresholds to logical actions.
Property Grid¶
General¶
- Threshold Value
This setting specifies the value of the input variable at which a crossing event is considered to occur.
- Crossing Type
This specifies which kind of threshold crossing triggers the event.
- Rising
The event is only triggered when the input crosses the threshold upward.
- Falling
The event is only triggered when the input crosses the threshold downward.
- Any
The event triggers on either upward or downward crossing.
- Activation
This determines whether the event is allowed to occur only once or multiple times during the simulation.
- One Time
If set to One Time, the detector triggers only once (the first time the crossing occurs).
- Repeated
If set to Repeated, the detector continues to detect and log subsequent crossings.
Input/Output Variables¶
- Input Variable
This setting specifies the global variable to be monitored. The selected input variable can be any global variable. This instantaneous value defined by the input variable will be compared to the threshold value to identify an activation.
- Output Event Variable
This setting specifies the global variable that is set or toggled when the event is detected. The selected output event variable must be a global variable configured with a Custom Logic data source. The variable will have a value of either 1 or 0. A value of 1 means that the threshold was crossed during the previous time step. A value of 0 means that the threshold was not crossed during the previous time step. Importantly, the output event variable is not a state indicator. It does not tell you whether the input variable is currently above or below the threshold. Instead, it reports whether a change of state occurred between the last time step and the current one.
- Enable Event Time
This setting enables or disables recording of the time at which the crossing occurs. If enabled, the detected time is written to the selected Output Event Time Variable.
- Output Event Time Variable
This setting specifies the global variable where the time of the most recent event crossing is recorded. The selected output event time variable must be a global variable configured with a Custom Logic data source.
- Enable Event Count
This setting enables or disables counting of the number of threshold crossings. If enabled, the count is written to the selected Output Event Count Variable.
- Output Event Count Variable
This setting specifies the global variable that stores the running count of detected events. The selected output event count variable must be a global variable configured with a Custom Logic data source.
Event Detector Toolbar¶
Context-Specific Toolbar Options |
Description |
|---|---|
|
The Help command launches the M-Star reference documentation in your web browser. |
See also Child Geometry Context Specific Toolbar.
For a full description of each selection on the Context-Specific Toolbar, see Toolbar Selections.
Help