⚡ TipControl Events: Reacting to Driver Variables
Events in TipControl allow your IoT system to respond dynamically to changes in driver variables. Each event (except timer events) is tied to a specific variable located under drv.<drivername>.var...
. Events are triggered when driver variables are updated or when the driver’s update()
function is manually called (though this is rarely necessary).
🔧 Event Settings
- Enabled – Toggle each event on or off.
- startEnabled – Determines if the event is active when the driver is first enabled.
🧠 Supported Event Types
Type | Behavior |
---|---|
EQUAL | Fires once when variable equals value; resets if not equal. |
BELOW | Fires once when variable is below value; resets if equal or above. |
EQUALBELOW | Fires once when variable is below or equal; resets if above. |
ABOVE | Fires once when variable is above value; resets if equal or below. |
EQUALABOVE | Fires once when variable is above or equal; resets if below. |
WEQUAL | Fires on every update while variable equals value. |
WBELOW | Fires on every update while variable is below value. |
WEQUALBELOW | Fires on every update while variable is below or equal to value. |
WABOVE | Fires on every update while variable is above value. |
WEQUALABOVE | Fires on every update while variable is above or equal to value. |
CHANGE | Fires when variable changes by a specified amount (numeric only), for all other variable types on any change. |
TIMER | Fires every X milliseconds; variable is ignored. |
🛠️ Using Events in TipControl Designer
Events are easiest to manage via the TipControl Designer:
- Navigate to Event via the toolbar or GoTo → Event.
- Select your device from the Devices list.
- Use the Location dropdown to view drivers with installed events.
- Below the drivers, you’ll find locally stored events.
- Select a driver to view its installed events.
💡 Event Management
- Right-click an event to rename or delete it.
- Checkbox next to the event name toggles its enabled state.
- Variable List shows available variables (may be empty if driver is disabled).
- Condition & Value – Set the trigger condition and test value.
- onStartEnabled – Determines if the event activates with the driver.
- New – Create a blank event.
- Test – Run the event directly on the chip.
- Install – Deploy the event to the device.
- Save – Store the event locally.
🧬 Event Coding in TipControl Language
Each event includes a Code Box where you define the actions to perform when the event fires. This is written in TipControl Language.
🧠 Key Concepts
me
refers to the driver the event is installed on. Example: If installed ondrv.button
,me
is equivalent todrv.button
.- Use
me
to write generalized code without hardcoding driver names. - For low-memory devices, encapsulate long code in macros—event code stays in memory.
- To disable an event after execution, use
return(false)
. Note:me.event
Enabled(eventName,false) will not work for the event itself, even in a subsequantially called macro.
Want to see it in action? Download an example project from our website to explore how events work in real-world scenarios.