Heisenware Docs
Go to websiteGet a demo
  • 👋Welcome
  • Getting started
  • Release Notes
    • v84 - Get in the flow
    • v83 - Beauty treatment
    • v82 — Fully distributed
    • v81 — Removing old cruft
    • v80 — Chicks on fire
    • v79 — Nothing is forever
    • v78 — Keep moving
    • v77 — More intelligence
    • v76 — Well cooked
  • Build & Deploy Apps
    • Overview
    • Flow Builder
      • Nodes (Functions)
        • Inputs
        • Trigger
        • Output
      • Function Extensions
        • Modifier
        • Filter
        • Error handler
        • Memorizer
      • Objects & Instances
      • Utilities
        • Basic Functions
        • PDF functions
        • Circular buffer
        • Timer
        • Counter
    • Integrations
      • Protocol Connectors
        • GraphQL
        • HTTP/REST
        • MQTT
        • OPC UA
          • Heidenhain PLCs with OPC UA
        • RS-232/485
        • Siemens S7
      • Data Connectors
        • File
        • Relational Database
        • Time Series Database (WIP)
      • API Connectors
        • OGC SensorThings API
        • Operating System
        • Zebra RFID IoT Connector
      • Agent / (Edge Connector)
      • Calling Custom Code
    • UI Builder
      • Input Widgets
        • Form
        • File Upload
        • Photo
        • Signature
        • Barcode / QR-Code (WIP)
        • Document Scan (WIP)
      • Display Widgets
        • Chart
        • Chat
        • Circular Gauge
        • Data Grid
        • Linear Gauge
        • Map
        • Media View
        • Progress Bar
        • Sparkline
        • Status Lamp
        • Toast
        • Value Box
        • Kanban Board
        • Data Tiles
        • Pie Chart
        • Sankey
      • Buttons
      • Text Box
      • Images
      • Icons
    • Communication Interfaces
      • Email Notifications
      • OPC UA Server
    • Data & File Storage
      • Internal InfluxDB
      • Internal PostgreSQL
      • File Server
    • App Appearance
      • Pages
      • In-App Navigation
      • Screens & Devices
      • Theming
    • Simulation & Testing
      • Simulating Events
      • Simulating Data
    • PDF Templates
    • RAG-based Chatbot
    • Deployment
  • Manage Apps
    • Overview
    • Manage Apps
      • General Settings
      • Users and Access
      • Distribution & Versioning
    • Manage Integrations
    • Manage Account
      • Account Structure
      • Members
      • Workspaces
  • TUTORIALS
    • Build Your First Heisenware App
  • Connect Heidenhain CNC with OPC UA Support
  • Related links
    • Website
    • Privacy policy
    • Imprint
Powered by GitBook
On this page
  • Creating a timer
  • Deleting a timer
  • Timer functions
  • Setting timer
  • Getting timer duration
  • Getting seconds left
  • Getting timer progress
  • Getting timer state
  • Starting timer
  • Stopping timer
  • Listening to timer ticks
  • Listening for when the timer reaches zero
  1. Build & Deploy Apps
  2. Flow Builder
  3. Utilities

Timer

Last updated 7 months ago

The timer starts counting up from zero seconds once started and continues until manually stopped. Moreover, it's capable of exceeding its initial set duration, which allows it to show progress beyond 100% or display negative seconds left. This functions is useful for tracking tasks that may exceed their expected time frames, offering flexibility in monitoring extended workflows.

To quickly start with timers:

  1. Find the Functions panel on the left-hand side of the screen.

  2. Expand Utilities and then Timer.

  3. Create a timer instance with the function.

  4. Expand the instance that appeared in the panel and get started with using the timer.

Use the and functions to manage the existing timers. Existing timers can be seen in the functions panel on the left under Timer. Yellow ones are uninstantiated and green ones are ready for use.

Creating a timer

To create a timer:

  1. Insert a timer name in the yellow field.

  2. Click the trigger field to create an instance of the timer. You should see the timer in the functions panel go from yellow to green.

Deleting a timer

To delete a timer:

  1. Insert the name of an existing timer in the yellow field

  2. Click the trigger field.

The instance in the functions panel will turn yellow again, until the yellow field of the create function is cleared, or the create function is deleted from the board.

Timer functions

To utilize timers, you can find functions tied to each instance when you expand the instance with a click on the arrow in front of it.

Setting timer

The setTotalSeconds function sets the timer's total duration in seconds. Enter the duration in the input field as an integer. The countdown starts when the start function is activated.

Getting timer duration

The getTotalSeconds function returns the number of seconds of the total timer duration.

Getting seconds left

The getSecondsLeft function returns the number of seconds left for the timer to run.

Getting timer progress

The getProgress function returns the progress of the timer in percent.

Getting timer state

The getState function returns whether the timer is stopped or started as a string.

Starting timer

After triggering the start function, the timer counts up and the state gets set to started. It will not stop until the stop function is triggered.

Stopping timer

After triggering the stop function, the timer stops counting, the state gets reset to stopped and the progress to 0.

Listening to timer ticks

The onTick function is triggered every time the timer updates. It shows the seconds left in the first field immediately after the timer changes. The function needs to be started once by being triggered to begin listening to the timer once the app is running. The resetting of the timer when it reaches 0 and a stopped timer will not register as a tick. You can use the first field just like any output field.

Listening for when the timer reaches zero

To listen for when the timer has reached its end, you can use onTimeup. On time up, this function fills its first field with an event that can be used as an input to other functions. Just like onTick, this function needs to be started by being triggered once the app is running.

Currently, the event that gets filled in the listener field is empty. It can still be used by dragging it on a trigger and changing the trigger mode to on output update.

create
create
delete
Creating a timer
Deleting a timer
Location of timer instances
Setting the timer to 33 seconds
Getting the total timer duration in seconds
Getting the number of seconds left in the timer
Getting the number of seconds already counted in the timer
Getting the timer state
Starting a timer
Stopping a timer