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 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 Edit icon in the toolstrip.
The following actions are available in the Task editor:
-
Create New - Create a new Event file.
-
Reload from Job - Reload the Event source file from the Job file. The compiled file in the device cannot be reloaded.
-
Save to Job - Save the task to the SB Job file.
-
Save to job and write to device - Save the task to the SB Job file and save the compiled file to the device.
-
Decompile task data - Decompile the task data and display in the editor.
-
Clear all tasks - Removes all task data in the editor.
-
Import from File - Load an Event file.
-
Export to File - Save to an Event File.
-
Print File - Print the Event File.
-
Test Compile - The task engine will test the written code for errors.
-
View Compiler Errors - Display error details found by the task engine in the lower pane.
-
View Task and Event Runner - Viewing pane allows compiled tasks to be run. Enables Task and Event Runner toolbar:
-
Goto
-
Start
-
Stop
-
Pause
-
-
View Compiler Output - Viewing Pane displaying compiled data. Special option available with Engineer license.
-
LED Calculator - Calculate the hexadecimal code to for displaying a button LED.
-
Area Linking Calculator - Calculate the hexadecimal code for linking areas.
-
OLED Simulator - Used for creating the text and animations for the OLED range of panels.
-
Cut - Cut the selection and copy to the clipboard
-
Copy - Copy the selection to the clipboard.
-
Paste - Paste the selection from the clipboard.
-
Undo
-
Redo
-
Find - Find the specified text in the Event file.
-
Find and Replace - Find the specified text in the Event file.
-
Find Next - Find the next log entry matching the specified text.
-
Find Previous - Find the previous log entry matching the specified text.
-
Goto Line - Put the cursor on the specified line number.
-
Clear Find All - Remove the highlight from entries found with the Find All function.
-
Toggle Comment Selection - Convert code into comment text and back again.
-
Toggle Bookmark - Add and Remove bookmark on selected line. Bookmarks are saved in Event files.
-
Next Bookmark - Find the Next bookmark.
-
Previous Bookmark - Find the previous bookmark.
-
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.
A task template can be exported to the Task Template Library or saved as a standard .evt file. When you click 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 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 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:
-
Add events
-
Remove events
-
Decompile Events Only
-
Start events
-
Enable / Disable events
Sunrise, sunset, and daylight savings information are specified in the Tools > Set Location and Time Zone menu. |
-
Click the Add button.
-
Enter an event Name.
-
Select a Time when the event will occur compared to:
-
Absolute Time
-
Before Sunrise
-
After Sunrise
-
Before Sunset
-
After Sunset
-
-
Tick the required checkboxes to select the valid Days and Months for the event
-
Select the Date for a specific day of the month or select All.
-
Select an action from the Action type dropdown list.
-
Enter the required properties for the selected action.
-
Click Write to Device to save the compiled file to the device.