The Trigger Levels panel allows the modeller to trigger events when the content of a flow tank reaches a certain level, potentially under certain constraints (for example, reaching the level from above or only when going through the level as opposed to reaching it and staying stationary). On this documentation page, we will use flow tanks as an example but anywhere you read "(flow) tanks" you can substitute "content holding flow object".
The following properties are on the Trigger Levels panel:
Create Trigger button
Add a new trigger level to the flow tank. FloWorks supports an unlimited number of trigger levels.
This is not used by FloWorks, but helps you identify the reason for the trigger when multiple triggers are defined at the same level.
The (absolute) content that triggers the logic. The level may be equal to zero, to the maximum content, or any intermediate value.
Even when the tank content matches the level, the trigger may still be skipped when the condition is not met.
Built-in examples include that the trigger level must be reached from above, from below or from a
static level ('restart').
Typically the condition will check the
mode variable, which is equal to one of the
following values (the constants are
#defined to the indicated integers, e.g.
MODE_FALLING == 2):
MODE_RISINGindicates that the level was lower than the trigger level and is still rising.
MODE_FALLINGindicates that the level was higher and is still dropping.
MODE_RESTART_RISINGindicates that the level was constant (inflow = outflow) but is about to start rising.
MODE_RESTART_FALLINGindicates that the level was constant but is about to start dropping.
This code will be executed when the tank content matches the trigger level and the condition evaluates to true.