Skip to main content

Timer Overview

  1. Navigate to HSYCO Manager

  2. Click here.

  1. Click here.

  1. Click "add"

  1. Add a "Timer"

  1. Go back to "edit" mode

  1. You can align the object by clicking "Align" and then "Center Vertically"

  1. Change the "Timer ID" to "timer1", which is the ID of the timer defined in the settings

Tip: Now we'll add a button that links to a datapoint to see that, when the timer turns on, also the light turns on

  1. Click "add"

  1. Add a "Button"

  1. Click "edit"

  1. Align the botton to the right of the timer object

  2. Change the "Label" to "Dummy Light 1"

  1. Change the "Action" to "datapoint"

  1. Change the "Datapoint" to "dummy.light.1"

  1. Click "Save" to save the project

Tip: Now we'll write some code to capture the TIMER event and change the status of the dummy light

  1. Open the "File Manager"

  1. Navigate into the "events" folder

  1. Click "New File"

  1. Give it a name ("timer1.txt" for example) and click "New File"

**21. Copy the following code and save:

timer timer1 = on : io dummy.light.1 = 1
timer timer1 = off : io dummy.light.1 = 0

What this does is it turns on and off the dummy light 1 when the timer turns on or off**

  1. Now go back into the "Project Editor", click "Run" and then "Default" to launch the application

  1. The page should look like this:

  1. Select a starting and end time

25. Check the days of the week in which you want to use this timer. The option "every day" checks all days of the week

  1. Click "enabled" to activate it

  1. Click "Ok" to confirm

  1. As you can see, when "16:05" ticked, the dummy light turned on

  1. And then when "16:10" ticked the light turned off