- 04 Jul 2023
- 1 Minute to read
- Print
How to add global variables
- Updated on 04 Jul 2023
- 1 Minute to read
- Print
Global variables can be defined to be controlled by and referenced in logical rules.
This enables a user to, for instance, create a timer to start when a certain condition is met, and for multiple gates, pumps, and/or abstraction units to then be controlled by this global timer.
Note:
This guide covers the minimum data required. Several optional settings are also available for logical rules, please see the Rules section of the technical reference for further details.
Steps
On the 1D River Build tab, click Edit Variables. This will open a new window.
Click Add Variable and a new row will be added to the table.
Define your variable(s) by filling out the table fields:
- Enter a unique Name for your variable.
- From the drop-down provided, select the Variable Type required; Timer, Integer, Float, Binary, or Ternary.
- For a variable of type Timer, an Initial Status (ON or OFF) must be provided.
- A Comment can optionally be provided for each variable.
- An Initial Value for the variable can also be provided (leaving this column blank will result in the default value of 0).
Click OK to save when you have fully defined your variables.
Use your global variables within logical rules in any applicable units (sluice or gated weir, pump or abstraction unit) in the normal manner. An ALSO statement can be used if needed. An example is provided below.
Example usage: switching a global timer on (and setting no abstraction) when the flow is a specified level.
RULE1
IF(FLOW(A2).LE.100.0)
THEN ABS= 0
ALSO MyGlobalTimer=ON
END
Click OK to save and close the unit. Don't forget to also Save these changes to the network.