Tutorial6

From HSYCO
Jump to navigation Jump to search

This tutorial describes how to create an "user" button and how to write a simple Events logic code.

To access the Project Editor enter the following URL in your Web Browser:

https://192.168.0.50/hsycoserver/manager

If you need more information about the first login to Hsyco please read first this: Tutorial1

Add an user button

Open the "Project Editor". Select the "Objects" tab and scroll it until you see the "user" object. Add an "user" object to the the project named "test".

Tutorial6-1.png

Assign the folllowing values to the attributes of the object:

Tutorial6-2.png

Write a simple Events logic

Open the "File Manager" by clicking this icon in the Manager main menu: Tutorial6-3.png

Open and edit the file Tutorial6-4.png

Add the following line in events.txt file and click the save icon to confirm:

user action = 1 : io dummy.light.1 = flip

Note EVENTS programming uses the simple syntax:

event : action

This Events logic can be read like this: every time an user button with name=action and param=1 is pressed then the datapoint "dummy.light.1" changes its state. If the state is 1 the new state is 0, if the state is 0 the new state is 1.