Материал из for iRidium developers
Перейти к: навигация, поиск
Эта страница является переводом страницы Editor Drivers. Перевод выполнен на 100%.

Other languages:
English • ‎русский

The interface editor "iRidium Studio" contains tools for setting up command and getting feedback from controlled equipment. It enables work with system information of the device where i3 pro is running and create internal project variables not connected with actual equipment.

The majority of operations on setting up equipment and project variables is performed in "Project Device Panel".

See more information on work with automation systems and AV in the section «Control of equipment».
This section presents general information.


iRidium drivers

Drivers provide data sending and receiving feedback from the equipment to which iRidium is connected. Each automation device corresponds to its driver which provides connection to the device and correct data exchange.

Setting up of visualization project drivers is performed in Project Device Panel.


Device Panel – the database which stores all drivers, devices and commands used to control equipment via TCP/IP, UDP, RS232, IR, HTTP.

Project Device Panel – the database which stores drivers added in your iRidium project and also global and system variables (Tokens).


Creation of drivers


manual creation

Add a driver from Device Panel into Project Device Panel with the help of the Drag&Drop method. Now the driver cn be set up - indicate Host, Port and other properties for connection to equipment.

Editor add custom driver.png

Each device has three types of channels grouped in folders:

  • Driver tokens - the information about driver work
  • Commands - the list of commands for sending to equipment
  • Feedbacks - the list of feedback channels for receiving data


Import from the configuration file

Editor project device panel import add drivers.png

iRidium supports import from files:

  • ETS Project (*.pr3, *.pr4, *.pr5, *.knxproj) - import of group addresses from ETS (KNX)
  • Simpl project (*.smw) - import of Crestron joins
  • Clipsal project (*.xml) - import of Clipsal groups
  • iRidium Archive Project (*.irpz) – import of drivers from iridium projects
  • iRidium Server Project (*.sirpz) – Import of the iRidium Server driver from iridium projects
  • Modbus CSV Files (*.csv) - import of Modbus registers from the csv table


Device search in the local network

Editor project device panel scan add drivers.png

iRidium supports scanning of the local network to find equipment of a certain type. The scanning enables fast creation of the devices list and commands for them:

  • HDL-BUS Pro Net (UDP) – equipment in the HDL-BUS Pro system
  • Lutron Net (UDP) – equipment in the Lutron system
  • DuoTecno (TCP) – equipment in the DuoTecno system
  • Domintell (UDP) – equipment in the Domintell system



Connection to equipment

The upper level of the device tree defines the address and type of the device you want to control.

Editor project device panel my device properties.png

Select the driver in the device tree and go to the Properties tab. Indicate settings for connection to the controlled equipment:

  • Name - the controlled device name, at random
  • Driver Type - the driver type, invariant
  • Connection - the settings fro connection to equipment



Commands to equipment

Clicking on a button and moving of the level slider send values to equipment. The display item displays the received data.

Use Drag&Drop to relate equipment with the visualization interface. The item type defines which commands can be sent from it.

Control:

With the help of graphic items you can write the selected value in the variable:

BUTTON

It is a graphic item with 1 or 2 states. Buttons depending on settings can be fixed or not. Each pressing on Button initiates sending of the same set of commands assigned to it.


1 Create a variable were a number or string has to be written. Set it up as it is shown in the instructions.

2 Create a button and set it up as follows (see all settings):

UImakeAbutton.png
Type Button
Feedback Reaction of the item on user pressings and receiving data from equipment
  • Momentary - the button sends values but does not display feedback
  • Channel - the button sends values and displays feedback
  • None - the button does not visually react on pressings or receiving of feedback
  • Invert Channel - the button sends values and dispalys feedback inversely (false - on, true - off)

3 Drag the variable on the button and indicate the following in the dialog window:

UIdragCommand.png
Action Send Number - write numbers in the variable. You can switch to Send String for sending ASCII strings
Event for Action Interface events connected to the button. When the event are activated the indicated value will be written in the variable
  • Press - send on pressing
  • Release - send on releasing the button
  • Hold - send in cycles on holding the button
  • Move - it does not work with Button


You can use several events together. For example, send [ 100 ] on pressing and [ 0 ] on releasing.

Value Values for writing in the variable. The button sends the same value written in Value
Add a feedback channel (Create a feedback channel) Tick this if you want the button not only to write values in the variable but also change its state when receiving data from tthe variable. The received value will affect the button state (on/off) and it can be displayed in the button text field.

4 Now the variable is connected to the button. You can see all relations in OBJECT PROPERTIES > Programming


TRIGGER BUTTON

Trigger switch with the help of the "Trigger Button" item allows to send 2 values indicated in Trigger Value 1 and Trigger Value 2 alternately. When there is feedback the trigger automatically takes the respective value and sends the value opposite to the current one on pressing. The trigger cannot be set up for working with 3 and more values.


1 Create a variable which has to be switched between 2 values. Set it up as it is shown in the instructions.

2 Create a button and set it up as follows (see all item settings):

UImakeAtriggerButton.png
Type Trigger Button
Feedback Reaction on pressings and receiving data from equipment
  • Channel - switches the value and displays feedback (other types are not used)
Trigger Value 1 / Trigger Value 2 the values which will be sent alternately when clicking the button, they depend on the variable type

3 Drag the variable on the trigger, in the dialog window indicate:

UIdragCommandToTrigger.png
Action Send Token - send to the variable Value indicated in the graphic item properties (Trigger Value 1 or Value 2 depending on the current trigger state)
Event for Action An interface event connected to the button. When the event is activated the indicated value will be sent to the variable
  • Press - send on press
  • Release - send on release



For Trigger button you can use only one event at a time

Add a feedback channel (Create a feedback channel) Tick this field as it is required for the button to know its current value and change it when receiving data from the variable and on clicking.

4 Now the variable is connected to the trigger. You can see all relations in OBJECT PROPERTIES > Programming


LEVEL

Pressing on the level or moving of the slider sends to the variable the value corresponding to the current slider position.

1 Create a variable which has to be regulated. Set it up as it is shown in the instructions.

2 Create a level and set it up as follows (see all settings):

UImakeAlevel.png
Type Level
Feedback the level reaction on user's pressings and receiving data from equipment
  • Channel - to send values and display feedback (the slider moves when receiving data)
Min / Max the limits of level regulation: they define the value range in which the slider moves
Invert Range to swap the top and bottom level parts. i.e. the regulation from 0 to 100 will be performed not from the bottom upwards (when the level is vertical) but from top downwards.

3 Drag the variable to the level, indicate in the dialog window:

UIdragCommandToLevel.png
Action Send Token - to send to the variable Value, taken as the current slider position in the Min...Max range
Event for Action the event interface connected to the button. When the event is activated the indicated value will be written in the variable
  • Press - to send Value on pressings
  • Release - to send Value on releasing
  • Move - to send all intermediate Values when moving the slider.
    add Delay (100) before commands for the Move event to avoid overload of equipment (with the Delay command Move will work once in 100 ms)



You can use all three events together.

Add a feedback channel (Create a feedback channel) Tick it for the slider to move in accordance with the actual variable state

4 Now the variable is connected to the level. You can see all relations in OBJECT PROPERTIES > Programming

UP/DOWN BUTTON

A graphic item has 2 states. At that each clicking changes the current value by "Up/Down Value", but within the "Max/Min Value" range. The calculated value is sent by the variable: thus the step increment/decrement of the variable is implemented. It is required to have feedback from the variable in real time to work with the item.


1 Create a variable which has to be incremented/decremented. Set it up as it is shown in the instructions.

2 Create a level and set it up as follows (see all settings):

Editor window Object Properties General Up Down.png
Type Up/Down Button
Feedback Reaction of the level on user's clickings and receiving data from equipment
  • Momentary - the button has to be clicked visually right away, it does not display feedback visually
Up/Down Value the increment/decrement step (it can be more or less than zero)
Min/Max Value the increment/decrement limits (minimum limit for decrement and maximum limit for increment)
Hold Value the increment/decrement step when the Hold event is activated. Commands for controlling equipment can be assigned using both Press and Hold - then the value will be incremented/decremented when you hold the button pressed
Hold Time time of holding the button for the Hold event to be activated
Repeat Time frequency of repeating the On Hold events

3 Drag the variable on the button and in the dialog window indicate:

Editor drag to UDB.png
Action Send Token - send to the variable Value calculated as a sum of the current values and the increment step
Event for Action The interface event connected to the button. When the event is activated the calculated increment value will be written in the variable
  • Press - send on pressing
  • Hold - increment the value with the indicated frequency on holding



You can use two events at a time.

Add a feedback channel (Create a feedback channel) Tick this field as it is required for the increment to be calculated in accordance with the actual variable state

4 Now the variable is connected to the level. You can see all relations in OBJECT PROPERTIES > Programming

RADIO BUTTONS

Radio Button - an interface item which allows to select one of the preset options. In iRidium Radio Buttons are not separated as an item type as they can be set up on the basis of Trigger Button. The task of Radio Buttons: to send to the variables values from different buttons from which you can select only one.

Settings and behavior of Radio Button depend on the variable you work with. You can find several examples below.


Variant 1 Radio Buttons for controlling one variable with the possibility to receive feedback. Values are written in one variable: equipment returns the current state of this variable.

  1. Set up the Trigger Button items (see the image) in a number equal to the number of Radio Buttons. In the fieldsTrigger Value 1 and 2 indicate the same values corresponding to those which have to be sent to the controlled variable by each button
  2. Drag the command for controlling the variable on all Radio Buttons. Select the Press or Release events for sending, tick Add A Feedback Channel to display the variable status


RadioButtons-MainSettings.png
RadioButtons-DragCommand.png

the set up button will go to State 2 only when the variable takes the value indicated in Trigger Value 1 and 2


Variant 2 Radio Buttons for controlling variables with possibility to receive feedback. ON/OFF values are written in different variables; equipment returns the current state of these variables. The variables are not synchronized by automation equipment for working in the Radio Buttons mode (inactive modes on the side of iRidium have to be off)

  1. Set up the items Type: Trigger Button, Feedback: Channel, indicate Trigger Value 1 = inactive, Trigger Value 2 = the variable active state (for example 0/1, 0/100)
  2. Drag the commands for controlling the variables on graphic items. By the example of the first item of the group:
    1. Send zeros to all variables in the Radion Buttons group to deactivate the current active mode. In order to do that select Action: Send Number in the dialog window for command sending
    2. Add Delay(50) ms through the macros editor of the Press event to give equipment time to deactivate the active mode
    3. Drag the command for controlling the variable corresponding to Radio Button on the item. Leave Action: Send Token. Value on the Press (or Release) event, tick Add a Feedback Channel


RadioButtons-MainSettings-Septd.png
RadioButtons-DragCommand-Septd.png

If the equipment working modes are synchronized on the automation equipment side (when activating one of the modes the rest are automatically deactivated) you do not need to send zeros to the deactivated variables. Execute only article 2.3 of the settings.


Displaying states:

Graphic items can display values of variabls by changing their state or text:

CHANGE STATE

1 Set up the graphic item so it would display the received values:

SetUpItemToDisplayValue.png

Select in the General settings:

Feedback: Channel (if 0 = false) or
Feedback: Invert Channel (if 0 = true).

This feedback type enables the item to process data received from variables

2 Assign the equipment channel (Feedback) to the graphic item:

SetUpItemToDisplayValue2.png

Drag the feedback channel or the variable on the item, select In Text in the dialog window

For correct work the item needs 2 states. The first one corresponds to the zero value, the second - to any value different from zero.

The $V template added in the item text will enable output of received values in the item text.

DISPLAY IN TEXT

1 Drag the equipment channel (Feedback) to the graphic item:

DragChannelToDisplayTxt.png

Drag the feedback channel or the variable on the item, select In Text in the dialog window

The item can have any number of states and settings. The value will be output in the text field of all item states.

DragChannelToDisplayValue.png

Add $V in the item text. Drag the feedback channel or the variable on the item, select In Value in the dialog window. It will enable output of the received whole number and ass any text to it.

There are templates for outputting fractions and etc.:

LIST OF TEMPLATES

Template Function Template Function
$V the integer part of the current value $P the current value of Level in percentage of maximum
$F1 - 5 value with a floating point
From 1 to 5 - number of symbols after a point
$H the upper Level value
$S current Item state number $A current Level value minus the lower Level value
$R the Level range (the upper value minus the lower value) $L the lower Level value
$X the current value in the HEX type $$ the "dollar" symbol

A command (template) of incoming data processing and displaying is entered into the text field of a graphic Item and can be combined with other text or symbols (comments, units of measurement)



Feedback

Assign the feedback channel to the graphic item indicating which property of the item it has to affect:

  • In Value - to change the graphic item state switching it from inactive to active or moving the level slider
  • In Text - to substitute the default item text
  • More... - select any item property you want to affect, for example, opacity


Graphic items can display values of variabls by changing their state or text:

CHANGE STATE

1 Set up the graphic item so it would display the received values:

SetUpItemToDisplayValue.png

Select in the General settings:

Feedback: Channel (if 0 = false) or
Feedback: Invert Channel (if 0 = true).

This feedback type enables the item to process data received from variables

2 Assign the equipment channel (Feedback) to the graphic item:

SetUpItemToDisplayValue2.png

Drag the feedback channel or the variable on the item, select In Text in the dialog window

For correct work the item needs 2 states. The first one corresponds to the zero value, the second - to any value different from zero.

The $V template added in the item text will enable output of received values in the item text.

DISPLAY IN TEXT

1 Drag the equipment channel (Feedback) to the graphic item:

DragChannelToDisplayTxt.png

Drag the feedback channel or the variable on the item, select In Text in the dialog window

The item can have any number of states and settings. The value will be output in the text field of all item states.

DragChannelToDisplayValue.png

Add $V in the item text. Drag the feedback channel or the variable on the item, select In Value in the dialog window. It will enable output of the received whole number and ass any text to it.

There are templates for outputting fractions and etc.:

LIST OF TEMPLATES

Template Function Template Function
$V the integer part of the current value $P the current value of Level in percentage of maximum
$F1 - 5 value with a floating point
From 1 to 5 - number of symbols after a point
$H the upper Level value
$S current Item state number $A current Level value minus the lower Level value
$R the Level range (the upper value minus the lower value) $L the lower Level value
$X the current value in the HEX type $$ the "dollar" symbol

A command (template) of incoming data processing and displaying is entered into the text field of a graphic Item and can be combined with other text or symbols (comments, units of measurement)


Templates for data output

Template Function Template Function
$V the integer part of the current value $P the current value of Level in percentage of maximum
$F1 - 5 value with a floating point
From 1 to 5 - number of symbols after a point
$H the upper Level value
$S current Item state number $A current Level value minus the lower Level value
$R the Level range (the upper value minus the lower value) $L the lower Level value
$X the current value in the HEX type $$ the "dollar" symbol

A command (template) of incoming data processing and displaying is entered into the text field of a graphic Item and can be combined with other text or symbols (comments, units of measurement)


Macro commands

You can assign several commands to one graphic item. they will be sent to equipment one by one from top downward without any delay. The feedback channel can be assigned only once. Otherwise the incoming data will be processed incorrectly.

To assign several commands to one graphic item drag them one by one on the item. Select the corresponding events (Press, Release, Move) in the dialog window:

MacroCommands.png

Delay between commands (ms) is added through the macros editor. Select the Other folder, the Delay command. It is recommended to add delay for providing reliable processing of commands by equipment.

MacroAddDelay.png


Notifications about events in the system

A notification is a message, sound or action informing the user about changes in the system. Notifications work when the application is launched and opened on the control panel. They are set up with the help of iRidium Script and can perform any actions available in iRidium Script.

At the moment notifications for the background mode (when the application is minimized or closed) are not supported.

The iRidium notification system MUST NOT be used as the main one to inform the user about important and potentially dangerous situations! iRidium notifications can be used as an auxiliary system to SMS, e-mail, notifications of the security system, etc.

As a notification you can:

  • show a text message on a graphic item;
  • show a page/popup with a notification;
  • play a sound;
  • activate a command for the controlled system automatically (turn on/off lights, switch off the radio when receiving an Intercom call, etc.)


With the help of iRidium Script you will be able to form the list of any conditions and actions which you need to perform when the conditions are satisfied.


Example of use:

  • show the Intercom dialog window when receiving an incoming call;
  • show the notification when the leakage sensor is activated.


script in iRidium projects

Setting up notifications:

  1. Create a visualization project, set up its user interface and work with drivers (in accordance with the instructions for your equipment)
  2. Create a script file
  3. Form handlers for driver events at which notifications should appear in the script file.



Notify about connection to equipment (Online)

Event:

successful connection with equipment ("My Driver"). Equipment – any driver of the visualization project.

Action:

output text information about the event (for example, " System Online") and time of event initiation in the 24-hour format ("System.Time.24") on the graphic item ("Item 1") located on the page ("Page 1"). Change the color of the output text to green.

Example::

/***** online notification ****/
IR.AddListener(IR.EVENT_ONLINE, IR.GetDevice("My Driver"), function() 
   {
        // notification
        IR.GetItem("Page 1").GetItem("Item 1").Text = IR.GetVariable("System.Time.24") + " Online";
        // text color
        IR.GetItem("Page 1").GetItem("Item 1").GetState(0).TextColor = 0x00FF00FF;
   });


Notify about disconnecting from equipment (Offline)

Event:

disconnection from the equipment ("My Driver"). Equipment – any driver of the visualization project.

Action:

output text information about the event (for example, " System Offline") and time of event initiation in the 24-hour format ("System.Time.24") on the graphic item ("Item 1") located on the page ("Page 1"). Change the color of the output text to red.

Example:

/***** offline notification ****/
IR.AddListener(IR.EVENT_OFFLINE, IR.GetDevice("My Driver"), function() 
   {
        // notification
        IR.GetItem("Page 1").GetItem("Item 1").Text = IR.GetVariable("System.Time.24") + " Offline";
        // text color
        IR.GetItem("Page 1").GetItem("Item 1").GetState(0).TextColor = 0xFF0000FF;
   });


Automatic opening of the popup at channel activation

Event:

receiving values (1 and 2) from the channel ("Channel 10") of the driver ("My Driver"). Equipment - any driver of the visualization project.

Action:

1. When receiving 1 – open the popup ("Popup 1"), output event information (for example, " Lamp in Garden broken") and time of event initiation in the 24-hour format ("System.Time.24") in the text field ("Item_Display") of the popup.
2. When receiving 2 - open the popup ("Popup 1"), output event information (for example, " Lamp in Garden Response Failed. Please Check") and time of event initiation in the 24-hour format ("System.Time.24") in the text field ("Item_Display") of the popup.

Example::

/***** event notification (Tag Change) ****/
 
var old_value1 = -1;   // do not show notification if the previous state is the same  
var old_value2 = -1; 
 
IR.AddListener(IR.EVENT_START, 0, function()
{
	IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("My Driver"), function(name, value)
	{
		if (name == 'Channel 10' && value == 1 && value != old_value1) // Check the Value: 1 in "Channel 10"
		{
		  IR.ShowPopup("Notify_danger");
		  IR.GetItem("Popup 1").GetItem("Item_Display").Text = IR.GetVariable("System.Time.24") + " Lamp in Garden Broken";    
		  old_value1 = value;                     
		}
		else if (name == 'Channel 10' && value == 2 && value != old_value2)  // Check the feedback "Channel 10'"
		{	
			IR.ShowPopup("Notify_important");
			IR.GetItem("Popup 1").GetItem("Item_Display").Text = IR.GetVariable("System.Time.24") + " Lamp in Garden Failed";   
			old_value2 = value;                                            
		} 
	});			
});


Play a sound at channel activation

Event:

receiving any value (1) from the channel ("Channel 11") of the driver ("My Driver"). “Equipment” - any driver of the visualization project.

Action:

when receiving 1 – play the notification sound and output event information (for example, " Incoming Call") and time of event initiation in the 24-hour format ("System.Time.24") in the text field of the graphic item ("Item 5 ") on the ("Page 1").

Example:

/***** event notification (Tag Change) ****/
IR.AddListener(IR.EVENT_START, 0, function()
{
   IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("My Driver"), function(name, value)
{
     if (name == 'Channel 11' && value == 1) // Check the Value = 1 in Feedback "Channel 11"
   {
      IR.PlaySound('BEEP1.WAV',1,70); // Play Sound ('name',slot,volume)
      IR.GetItem("Page 1").GetItem("Item 5").Text = IR.GetVariable("System.Time.24") + " Incoming Call";
   }
});
});


iRidium variables (Tokens)

The special type of variables in the iRidium device tree. There are 3 token types:

  • System Tokens - system variables. They mainly work for reading only, but some of them can be written. They enable receipt of parameters of the controlled panel with running i3 pro: system time, battery charge, network status, etc.
  • Project Tokens - project variables. They can read and write. You can write a value, string or array in a token and then use it in the project. Tokens are not cleared at the restart of the project if you do not mark the "Clear Token" box in Project Properties.
  • Driver Tokens - driver variables. They can only read and receive driver parameters: the connection status, connection host and port, etc.


System Tokens

SystemTokenUsageinGUI.png

System Tokens are located in Project Device Panel. They return parameters of the device where your iRidium project is running. Some of them available for writing, the rest - for reading only.

Tokens can be assigned to graphic items




Project Tokens

Tokens 1.png

Project Tokens store data which are available for reading and writing. The writing and reading can be performed by graphic items, drivers or scripts.

  • Tokens are stored in the project device tree (Project Device Panel)
  • You can write numbers or strings in tokens (DEC or ASCII).
  • Tokens can be created, removed, copied, sorted and grouped in folders.
  • Data in tokens can be saved (or might not be saved) after closing the iRidium application.
  • You can write data to tokens with the help of commands from items, drivers or scripts


You can write data to Project Tokens with the help of the macro group Send to Token in Macros Editor of the graphic item:

Tokens 3.png
  • Send Number - write a decimal number in the token (the DEC format)
  • Send Text - write text in the token (the ASCII format)
  • Send Token - write data taken from graphic item properties in the token (Value, coordinates, size, etc. – running values defined by the current object properties)


You can read data from Project Tokens by dragging Tokens on graphic items:

Tokens 6.png
  • In Text - writing the token value in the item Text property. The data will be displayed on the item depending on their type (a string or number).
  • In Value - writing the token value in the item Value property. The graphic item will take the state (beginning with zero) depending on the number the token has. In this case the token is required to have a number.
If you write the template of value output $V in the item Text property, the token value will be also displayed on the item.
  • More - writing the token value in the random property of the graphic item selected by the user. In this case the token is required to have a number.


For example, the value of the Menu project token has to be written in the item Opacity property:

Tokens 7.png

Tokens can store data after closing the iRidium application.

If it is required for Project Tokens to cear their values after closing the application, go to Project / Project Properties / System and mark the Clear Token property.


Typical tasks:

  • relations between buttons without using drivers (equipment) or scripts
  • creation of the Radio Buttons menu
  • he project demo mode (commands and feedback channels are not assigned to real equipment)
  • storing useful data between project launches


EXAMPLE: setting up Radio Buttons

Example of creating the navigation menu with the help of Project Tokens (communication of Buttons will be performed as follows: only one of the items can be active at a time):

  • Create three graphic items and set up the following properties in the Programming tab of the Object Properties panel:
Tokens 8.png


  • Create the Menu token and drag it to the graphic item selecting In Value.
Tokens 9.png
  • For each graphic item create the Send Number macros writing the sequence number of the graphic item (1, 2, 3) in the Menu token.
Tokens 10.png




Driver Tokens

They display the status of connection to equipment and available for reading only. To use a token drag it on the graphic item as a feedback channel - the token value can be output in the item text field or it can be used to change the item state

GUI Descr Tokens.png
  • Online - the state of connection to the controlled system (Online/Offline = 1/0)
  • Status - the status of connection to the system (Offline/Connecting/Online/Waiting = 0...3)
  • Host - the domain name of the remote system
  • HostPort - a port of the remote system i3 pro is connected to
  • IP - the control panel IP-address
  • HostIP - the IP-address of the remote system i3 pro is connected to
  • Port - the local client port which the connection to the remote device is established through