• Twitter

Dynalite:: Tasks

Dynalite programs are executed inside functions called “Tasks”.

Tasks can be triggered by various means:

Events (eg At 9pm every day, run the first Task);
By buttons in User Panels (eg Button 2 executes the seventh task);
DyNet traffic (eg “5c f3 53 10 37 00 00″ will trigger the fifty-fifth task in a D2Brg box 83);
Area Presets (eg Start(P=1,A=1));
Other Tasks (eg StartTask())

Tasks can also be stopped by similar means above. That means you can have a looping task, or a task that has long delays in it that can be “aborted” if you need. This comes in handy when you want to automate lighting changes after a long delay, unless something (like a motion detector) is triggered.

Task2()
{
// Monitor the Garage Movement Event
Name="MOVE Garage"
Start(P=36,A=255)
Delay(0.2)
Preset=17
Join=0xff
Fade=1.00
Preset(A=15)
}

Looking at the above, the first line shows we are declaring a Task. This is the second task within this event file, so it is written “Task2()”. Some devices are capable of more tasks then others, but most are able to store at least 8.

The Event Code supports comments, and they start with a double forward slash.

This task is triggered by area 255 going to preset 36. In our installs we use this area as a “Functional” zone.

Our automation panel sets area 255 to 36 whenever their is movement in the Garage area. Eg, the Garage Door is open, or the PIR’s are triggered.

In this example, all this task does is to set Area 15 to Preset 17 whenever it is triggered. This is the most elementary of tasks, and you could consider it some sort of a message relay.

Tasks are incredibly powerful, and through “Assembly” like constructs support variables, conditions etc. I will try and provide examples of these in other posts.

A slightly more powerful adaption of the above would be in the following situation. Assume you have several areas serviced by one User Panel. Your customer would like one button to turn the lighting on in those areas. You have selected Preset 3 as the preset you would like to apply to all the areas.

Task8()
{
// Entertainment Lighting
Name="Lower House Entertainment"
Preset=3
Join=0xff
Fade=4.00
Preset(A=3)
Delay(0.2)
Preset(A=5)
Delay(0.2)
Preset(A=6)
Delay(0.2)
Preset(A=7)
}

This code will set areas 3, 5, 6 and 7 to preset 3. The delay’s are important after each preset message to not bombard the network with too much traffic. The above could also be written:

Task8()
{
// Entertainment Lighting
Name="Lower House Entertainment"
Preset(A=3,P=3,F=4.00,J=0xff)
Delay(0.2)
Preset(A=5,P=3,F=4.00,J=0xff)
Delay(0.2)
Preset(A=6,P=3,F=4.00,J=0xff)
Delay(0.2)
Preset(A=7,P=3,F=4.00,J=0xff)
}

But given that we are setting several areas to the same preset, I feel the initial example is a little easier to read.

The above are examples for Dynalite / DyNet Event (.EVT) code. I have had no formal Dynalite Training, and this is based on the ~scarce~ information available online. Your comments about errors / omissions are encouraged.

Cheers, Troy

Those who share get better loving:
  • Digg
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks

Leave a Comment

You must be logged in to post a comment.


No Clean Feed - Stop Internet Censorship in Australia