Tasks and Events

System Builder’s tasking language is very similar to assembly code, and enables you to build custom functions and behaviours, tailoring the Dynalite system to the needs of even the most demanding projects.

Although you can write tasks in any text editor, System Builder includes a Task Editor in which to write, debug, and compile your code.

Tasking is one of the most advanced features of the Dynalite system. The following pages are provided as an overview and reference, but are not a substitute for proper commissioning training.

This section is under active development, and currently contains the following:

  • Task Syntax - Overview of basic task structure with some examples of variables, commands, and conditional/sequential tasks.

  • Tasking Reference - A comprehensive list of available commands, operators, flags, and registers.

Task Editor

The Task Editor is used to create system tasks. Devices with tasks are marked with a green tick in the System view tree.

Tasks are stored in the memory of a device, and each device can hold 64 control tasks. There are two methods that can be combined to create a task:

  • Sequential tasking runs from top to bottom through the code and executes each command in a fixed sequence.

  • Conditional tasking executes commands based on variables such as time of day, day of week, or current system status.

To access the Task editor window, select a device in System view, open the Tasks tab and and click the sb icon edit task event Edit icon in the toolstrip.

sb task editor padpe

The following actions are available in the Task editor:

  • sb icon new Create New - Create a new Event file.

  • sb icon open Reload from Job - Reload the Event source file from the Job file. The compiled file in the device cannot be reloaded.

  • sb icon save Save to Job - Save the task to the SB Job file.

  • sb icon save to device Save to job and write to device - Save the task to the SB Job file and save the compiled file to the device.

  • sb icon decompile task data Decompile task data - Decompile the task data and display in the editor.

  • sb icon delete Clear all tasks - Removes all task data in the editor.

  • sb icon import from file Import from File - Load an Event file.

  • sb icon export to file Export to File - Save to an Event File.

  • sb icon print Print File - Print the Event File.

  • sb icon test compile Test Compile - The task engine will test the written code for errors.

  • sb icon compiler errors View Compiler Errors - Display error details found by the task engine in the lower pane.

  • sb icon task event runner View Task and Event Runner - Viewing pane allows compiled tasks to be run. Enables Task and Event Runner toolbar:

    • sb icon goto Goto

    • sb icon task event start Start

    • sb icon task stop Stop

    • sb icon task pause Pause

  • sb icon compiler output View Compiler Output - Viewing Pane displaying compiled data. Special option available with Engineer license.

  • sb icon led calculator LED Calculator - Calculate the hexadecimal code to for displaying a button LED.

  • sb icon area linking calculator Area Linking Calculator - Calculate the hexadecimal code for linking areas.

  • sb icon oled simulator OLED Simulator - Used for creating the text and animations for the OLED range of panels.

  • sb icon cut Cut - Cut the selection and copy to the clipboard

  • sb icon copy Copy - Copy the selection to the clipboard.

  • sb icon paste Paste - Paste the selection from the clipboard.

  • sb icon undo Undo

  • sb icon redo Redo

  • sb icon find Find - Find the specified text in the Event file.

  • sb icon find replace Find and Replace - Find the specified text in the Event file.

  • sb icon find next Find Next - Find the next log entry matching the specified text.

  • sb icon find previous Find Previous - Find the previous log entry matching the specified text.

  • sb icon goto Goto Line - Put the cursor on the specified line number.

  • sb icon find  clear all Clear Find All - Remove the highlight from entries found with the Find All function.

  • sb icon toggle comment selection Toggle Comment Selection - Convert code into comment text and back again.

  • sb icon bookmark toggle Toggle Bookmark - Add and Remove bookmark on selected line. Bookmarks are saved in Event files.

  • sb icon bookmark next Next Bookmark - Find the Next bookmark.

  • sb icon bookmark previous Previous Bookmark - Find the previous bookmark.

  • sb icon bookmark delete all Delete All Bookmarks - Remove all bookmarks from the current Event file.

Task Templates

A task template is a special properties editor in SB that appears on the Tasks Editor of a device and can be customized for an application. Task Templates provide a way to easily configure frequently used tasks.

By default, the task will recompile automatically whenever you change a parameter. To make entering data more responsive you can select whether to compile automatically or manually.

sb tasks toolbar

A task template can be exported to the Task Template Library or saved as a standard .evt file. When you click sb icon task select template Select Task Template on the Tasks Editor you can then select either a system- or user-defined task template.

Parameter values are saved in the task template, so if a task is to be reused many times with the same values the task can be exported with these values using the sb icon task export to new template Export to a New Task Template icon.

Selecting a task template will overwrite all tasks and events in the device.

Event Editor

The Event Editor is used to create reoccurring events to trigger actions in your system. These events are stored in the memory of the timeclock device (this includes dedicated timeclocks as well as some load controllers and ethernet gateways). The memory in each timeclock can hold up to 250 control tasks.

To access the Event Editor window, select a timeclock device in System view, open the Tasks and Events tab, and click the sb icon edit task event Edit button in the toolstrip.

You can access more advanced event scheduling features in System Manager or the Ethernet Gateway > Schedules editor.

The Event Editor works together with the Task Editor in the timeclock to provide a graphical representation of a time-based task. The timeclock is preprogrammed with the local time zone information including sunrise, sunset and daylight savings switchover dates and times.

You can use the Event Editor to:

  • sb icon add Add events

  • sb icon delete Remove events

  • sb icon decompile event Decompile Events Only

  • sb icon task event start Start events

  • sb icon event enable Enable / sb icon event disable Disable events

Sunrise, sunset, and daylight savings information are specified in the Tools > Set Location and Time Zone menu.
Program an Event:
  1. Click the sb icon add Add button.

  2. Enter an event Name.

  3. Select a Time when the event will occur compared to:

    1. Absolute Time

    2. Before Sunrise

    3. After Sunrise

    4. Before Sunset

    5. After Sunset

  4. Tick the required sb icon checkbox tick checkboxes to select the valid Days and Months for the event

  5. Select the Date for a specific day of the month or select All.

  6. Select an action from the Action type dropdown list.
    sb event action types

  7. Enter the required properties for the selected action.

  8. Click sb icon save to device Write to Device to save the compiled file to the device.

sb event editor ddtc001