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

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

the documentation is updated 17.3.2017


Description

iRidium for Modbus is a set of tools for creating interfaces to control homes or offices on the basis of equipment compatible with Modbus.

iRidium connects to the controller as Modbus Master, the controller is always Slave. Supported Modbus protocols: TCP, RTU, ASCII (it is possible to work via RS232). To connect to the OPC server you can use the Modbus Server driver which enables work in the Slave moe. But this mode does not work with PLC.


Licensing of iRidium for Modbus: in details


Connection

Equipment configuration and settings required for iRidium to control PLCs compatible with Modbus.


Ways of connection to PLC

Different ways of connection to PLC require selection of different drivers in iRidium.

Modbus Comm Scheme.png

1. Modbus TCP / Modbus TCP Server

Modbus Comm SchemeRTU-ASCII.png

2. Modbus TCP / Modbus TCP to RTU / Modbus TCP to ASCII

1. Connection using the client-server model where i3 pro is Master initiating transactions to the Slave controller. To work with the controller you do not need any additional hardware as the controller had the Ethernet interface.

2. The same model of data transfer is used but it is required to havу a converter from the TCP/IP protocol into the Modbus RTU/ASCII protocol. Any gateway of the indicated type (Moxa, ICP-DAS, etc.) can be a converter.


If you selected work using the Modbus protocol consider its features:

PLCs often have a limited number of concurrent connections. Make sure your controller supports the number of connections you require.

Do not add registers which are not set up for the PLC in the project as it will lead to delays of control

Increase the value of Update Time for the controller if it starts to work worse when connecting with iRidium

iRidium sends fc5 and fc6 (single coil, single register) commands to Coil and Holding registers . If the controller does not support these commands it has to response with error 01 (illegal function). After that iRidium automatically switches for sending fc15 and fc16 (multiple coils, multiple registers) commands. If the controller does not return error 01, there will be no switch for fc15 and fc16! Set up the controller for working with fc5 and fc6 (single coil, single register) functions if register control does not work but there is feedback from the controller.


Modes of communication:

  • Modbus TCP - the driver for direct connection to the controller via Modbus TCP without any additional hardware or software. iRidium - Master, the controller - Slave
  • Modbus TCP to RTU and Modbus TCP to ASCII - the drivers for connection to the controller via the converter from TCP/IP to Modbus RTU (ASCII). iRidium - Master, the controller - Slave
  • Modbus RTU and Modbus ASCII - the drivers for connection to the controller via Modbus RTU or ASCII using RS232/RS485 serial networks. When using these drivers the iRidium application can be launched only on the device physically connected to the controller by the serial port of data transfer. iRidium - Master, the controller - Slave
  • Modbus Server - for connecting iRidium to the ОРС server using the Modbus TCP protocol, iRidium - Slave, the ОРС server - Master. It cannot be used with a standard PLC as at each iRidium launch there is reset of Modbus variables on the Slave side (it is necessary to provide protection of PLC from reset of variables at the application launch)

Contact iRidium technical support team to get more detailed recommendations.


Import of Modbus addresses in iRidium

The Modbus protocol in iRidium enables control of any number of controllers by different manufacturers. The universal system of data import allows you to create the list of commands and feedback channels for the Modbus driver in the Exel table. This table is saved in the CSV format and can be imported in iRidium projects as a new driver:

Modbus import file.png


  • In the block marked blue, indicate the IP-address, port and frequency of transactions for connection to the controller via Modbus TCP. If you use another driver, copy its name from iRidium Studio and indicate it in the first string of the template instead of MODBUS TCP (TCP)
  • In the block marked green, the list of commands (Commands) which you need to create in the project device tree is formed. Each string is a command with the name and a number of settings (you can see more information in the section "Sending Commands and Reading Data by the Modbus protocol")
  • In the block marked orange, the list of feedback channels (Feedbacks) which you need to create in the project device tree is formed. Each string is a channel with the name and a number of settings (you can see more information in the section "Sending Commands and Reading Data by the Modbus protocol")


When the list of commands and channels is formed save the Exel table in the *.CSV format:

Modbus import file CSV.png

As a result you will have the file ready for importing in iRidium. Go to iRidium Studio, create a new project and use File > Import. Select the created CSV file and confirm import of data to your project.


Commands & Feedbacks

As a result we have two levels of PLC settings:

  • Modbus TCP - the driver unites the list of PLC registers
  • Commands and Feedbacks - the commands and feedbacks inside devices. They enable control of Modbus registers. The commands are registers available for writing, the channels are registers available for reading.

Commands and feedback channels have to be assigned to project graohic items to control equipment:

  • Commands are assigned to graphic items indicating the value to be sent to registers when clicking on the items
  • Feedback channels are assigned to graphic items to display the register state


To assign commands or channels to graphic items use the drag&drop method.

Below you can see examples of commands for control of different types of registers.


iRidium supports the following registers and functions:

  • Coil Register (0x05, 0x0F, 0x01) - flag registers, one bit, reading and writing
  • Holding Register (0x06, 0x10, 0x03) - registers for storing, 16-bit word, reading and writing
  • Discrete Inputs (0x02) - discrete inputs, one bit, reading only
  • Input Register (0x04) - input registers, 16-bit word, reading only


Word Size - the size of words sent to the controller, it can be up to 32 bit:

  • Word (16-bit) - 16-bit word corresponding to the standard Modbus protocol
  • DWord (32-bit) - 32-bit word consisting of two standard Word registers
  • Float (32-bit) - 32-bit word, it supports values with floating point


Content Type - classificagtion by the sequence of data writing:

  • Low Endian - the sequence of bytes typical for the standard Modbus protocol. The data writing begins with the lower byte and ends with the higher byte (b1, b2, b3, b4)
  • Big Endian - the data writing begins with the higher byte and ends with the lower byte (b4, b3, b2, b1)
  • Swapped Low Endian and Swapped Big Endian - the sequence of bytes corresponds to the definitions above but bits in each word are written in the reversed order (n,...,1)


Sending and receiving data are performed by the driver on the basis of the list of commands (Commands) and channels (Feedbacks) it has. Transaction frequency is indicated when setting up the connection.


Setting up connection to PLC

Select the connection settings by default. They can be changed while working with the project.


Modbus TCP / Modbus TCP to RTU / Modbus TCP to ASCII / Modbus TCP Server:

Modbus Connection TCP.png
  • Host - the PLC IP-address (IPv4)
  • Port - the ТСР port of connection to PLC (usually 502)
  • Update time (ms) - the frequency of sending requests to the PLC to update data about its state


To work via the Internet, indicate the public IP-address of the router to which the controller is connected and set up Port Forwarding.

You can see the public IP-address of the router here

Modbus RTU / Modbus ASCII:

Modbus Connection RTU-ASCII.png
  • Port - the number of the СОМ-port to which the controller is connected
  • Update Time (ms) - the frequency which which iRidium will request information about status changes of controller variables. Recommended values - 1000...2000 ms
  • Baud Rate - the speed of data exchange with the controller
  • Data Bits - the number of information bits in a frame
  • Parity - parity control
  • Stop Bits - the stop bit in a frame


The RS232 protocol will work only on devices which are physically connected to PLC (СОМ-port) or have one virtual СОМ-port for connection to PLC


Change of connection settings

You need the possibility to change connection properties when you disconnect from the Wi-Fi network of the automation object and start using 3G or another Wi-Fi network. To maintain control of the object you need to switch from the local to public IP-address of the Internet router.

The switch is not automatic. You have to select the connection mode. For remote acces you have to make ports for controlling the automation system public. In order to do that you have o set up the Port Forwarding service on your Internet router. VPN can provide protected connection.


1 Download the template (*.js) (right-click button: "Save object as ..."), add the template in the script editor with the buttonIcon Scripts.png (+) Add Script from file


2 Set up script properties as it is shown in the example:

function Internal_1() {
IR.GetDevice("Modbus TCP").SetParameters({Host: "192.168.0.100", Port: 502, UpdateTime: 1000});
}
function External_1() {
IR.GetDevice("Modbus TCP").SetParameters({Host: "215.110.10.10", Port: 502, UpdateTime: 1000});
}

Copy the driver name from Projeсt Device Panel - the list of properties has to be copied from the example.


3 Select the button which will be responsible for the switch of Internal and External properties. Open Macros Editor for the Press event (Object Properties > Programming), select the Script Call command and add it by double-clicking on it. Select the name of the function which will be activated by the button:

Script call internal-external.png

Now each pressing on the button will apply the corresponding connection properties.


PLC features

Insyte Spyder II

To work with a Spyder II controller via the Modbus TCP protocol, activate the possibility of work with this protocol in the network settings of the controller, the Ethernet tab. Example of configuration:

Insyte Ethernet Config.png

Make sure your Spyder II controller has firmware 1.40 or later. Otherwise, there can be big delays of connection with the controller and problems in work with Coil registers.

When creating commands, shift the addressing by "-1" in relation to Insyte: in Spyder II register addresses start with 1, and in iRidium - with zero.

To refer to Spyder II VARIABLES use the formula:

Address = 1000 + [slot number]*2

Each variable has a slot number. It is seen when you point the mouse cursor on the variable. Type: Holding Register, Word Size: Dword(32-bit)

For sending IR commands use:

Address = the number of IR emitter

Value = the number of IR command


Beckhoff

Modbus/ADS memory card for Beckhoff CX8090:

Modbus areas Modbus address (HEX) Modbus address (DEC) ADS area
Digital inputs 0x0000 - 0x7FFF 0 - 32767 Index group:
0xF021 - process image of physical inputs (bit access)
Index offset:
0x0
0x8000 - 0x80FF 32768 - 33023 Name of the variables in PLC program:
.mb_Input_Coils
Data type:
ARRAY [0..255] OF BOOL
Digital outputs (coils) 0x0000 - 0x7FFF 0 - 32767 Index group:
0xF031 - process image of physical outputs (bit access)
Index offset:
0x0
0x8000 - 0x80FF 32768 - 33023 Name of the variables in PLC program:
.mb_Output_Coils
Data type:
ARRAY [0..255] OF BOOL
Input registers 0x0000 - 0x7FFF 0 - 32767 Index group:
0xF020 - process image of physical inputs
Index offset:
0x0
0x8000 - 0x80FF 32768 - 33023 Name of the variables in PLC program:
.mb_Input_Registers
Data type:
ARRAY [0..255] OF WORD
Output registers 0x0000 - 0x2FFF 0 - 12287 Index group:
0xF030 - process image of physical outputs
Index offset:
0x0
0x3000 - 0x5FFF 12288 - 24575 0x4020 - PLC memory area 0x0
0x6000 - 0x7FFF 24576 - 32767 0x4040 - PLC data area 0x0
0x8000 - 0x80FF 32768 - 33023 Name of the variables in PLC program:
.mb_Output_Registers
Data type:
ARRAY [0..255] OF WORD

Read/Write Holding Registers:

  • iPad1 AT %MB0 : WORD; (*address 12288*)
  • iPad2 AT %MB1 : WORD; (*address 12289*)


Read/Write Coils. It is required to create global_var in the array mb_Output_Coils:

  • mb_Output_Coils AT %QB1000 : ARRAY[0..255] OF BOOL;
  • Create the variables:
    • iPad1 AT %QX1000.0 : BOOL; (*address 32768*)
    • iPad2 AT %QX1001.0 : BOOL; (*address 32769*)
    • iPad3 AT %QB1002 : ARRAY[0..5] OF BOOL; (*address 32770-32775*)
    • iPad3 AT %QB1007 : ARRAY[0..5] OF BOOL; (*address 32775-32780*)


Modbus/ADS memory card for Beckhoff BC9хх0:

Calculation of the Modbus address Read/Write Holding Registers is performed using the formula:

  • Address = 16384 + 12 - 1 = 16395
    • 16384 - the beginning of the area  %MB (0x4000-0x47FF)
    • 12 – the variable index (it can be seen in the variable properties)
    • 1 – takes into account counting from zero



ОВЕН

When setting up the controller, in the FIX property it is required to add the ТСР Port of conenction to the controller. It is 502 by default. One port contains one connection of ТСР Master (the iRidium client).

Numbers of Modbus registers can see by such addresses as%QB7.1.5:

Address = %QB7.1.5 - 1 = 5 - 1 = 4

The last number of the address minus one - it is the register number which is indicated in iRidium.

Alligning of CoDeSys variables when placing them in the Modbus memory area:

Variables with sizes 8 bits, 2 bytes and 4 bytes should be located only at particular addresses. The address of a 4-byte variable is devisable by 4, the address of a 2-byte variable is devisable by 2 and the address of a 1-byte variable is devisable by 1. The addresses can be in any point of the memory space. I.e. if the first variable has the “byte” type it will be located at the address 0х00, the following - at 0х01 and etc. If a 4-byte variable goes next, it has to be located at the address 0х04 and etc. At that if a 1-byte variable took the place devisable by 4, the next 4-byte variable takes the next free place devisable by 4. The way of adding variables is random but the alignment puts the variables on the places which are devisable by their length. As a consequence, there are memory places which are not taken by anything. They should be considered by the user when the status of the device is requested. It should be done at the point of adding the variables.



Control of registers

To control equipment you need to set up commands (Commands) and feedback channels (Feedbacks). To send a command you need to drag it on the graphic item and indicate the value (Value) to be sent. To display feedback you need to drag the feedback channel and indicate where the value (Value) has to be output

SendValue.png

Possible settings of commands, channels and graphic items are presented below:


Coil

Command:

Device ID 0 .. n the PLC identifier (Slave ID)
Type Coil the flag register available for reading and writing
Address 0 .. n the register address in the decimal format
Value * value
0 .. 1 0 = Off, 1 = On

* - indicate when dragging the command on graphic items


Feedback:

The settings are similar to commands. Values come to Feedback and they can be used for displaying the status of registers on items


Control:

With the help of graphic items you can write the value: 1 or 0 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



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)


Holding

Command:

Device ID 0 .. n the PLC identifier (Slave ID)
Type Holding Register the register for storing, available for reading and writing
Address 0 .. n the register address in the decimal format
Word Size Word(16 bit) 16-bit word corresponding to the standard Modbus protocol
DWord (32-bit) 32-bit word consisting of two standard Word registers
Float (32-bit) 32-bit word with floating point
Content Type Low Endian writing begins with the lower byte and ends with the higher byte (b1, b2, b3, b4)
Big Endian the writing begins with the higher byte and ends with the lower byte (b4, b3, b2, b1)
Swapped Low Endian, Swapped Big Endian bits in each word are written in the reversed order (n,...,1)
Value * Word Size value
0 .. 65535 Word(16 bit) unsigned 2 bytes
-32768 .. 32767 Word(16 bit) signed 2 bytes
0 ... 4294967295 Dword(32 bit) unsigned 4 bytes
-2147483648 .. 2147483647 Dword(32 bit) signed 4 bytes
-2147483648.0 .. 2147483647.0 Float(32 bit) 4 bytes with floating point

Feedback:

The settings are similar to commands. Values come to Feedback and they can be used for displaying the status of registers on items


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)


Control of the RGB led strip with the help of Modbus Holding registers:


RGB lighting

Control of the RGB strip is performed on the basis of Holding registers.

RGB LED strips are controlled with the help of DMX controllers and have one of the following configuration:

  • Red, Green, Blue - three channels for controlling the LED strip color. Decrease of brightness is performed by decreasing brightness of separate channels.
  • Red, Green, Blue, Alpha - four channels for controlling the LED strip color and brightness


Variant 1 Control RGB strips with the help of three (four) Level items.


You create 3 (4) Unsigned 8-bit (Subtupe: VALUE) variables in the project. The variables are controlled in the range 0...255, value increase in the channel corresponds to the increase brightness of the respective color.

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


Variant 2 Control of RGB strips with the help of palette


You can use any colored item as a palette - you will be able to send commands of setting up the selected color to equipment by moving a finger on the item.

It requires adding a special script - RGB libraries - in your project. The script has to be added only once. Then you will be able to use it to control RGB strips of any built-in iRidium drivers.

2.1 Create a palette and auxiliary items. You can use any colored image as a palette.

  • Set up the palette like Joystick with the range 0...100 for Х and Y coordinates
  • Set up an inactive item Button which will display the color selected on the palette
  • If it is required set up active Button items which will change the strip brightness step-by-step
RGBPalette.png

2.2 Download the file RGB_Library.js

This file enables color control with the help of JavaScript. Add the file in your visualization project: open the project in iRidium Studio, click Icon Scripts.png, select the item ( + ) "Add Script From File"

2.3 Create an empty script file: ( + ) "New Script" to add the description of your RGB palette in it:

Describe the palette and the item for displaying the selected color in the script file:
///////// Copy this function to make one more RGB palette ///////
RGB_player(
         "Driver",                                            // Driver in project
         "Channel Red",                                       // Name of Red Channel
         "Channel Green",                                     // Name of Green Channel 
         "Channel Blue",                                      // Name of Blue Channel
         255,                                                 // Top limit for RGB channel (100 or 255)
         IR.GetItem("Page 1").GetItem("Item Color Picker 1"), // Item "Color Picker"
         /////// optional parameters ///////////////////////////
         IR.GetItem("Page 1").GetItem("Item Display 1"),      // Item "Display"
         )

The extended version has buttons for controlling brightness:

Palette, displaying the color and the button +/- for controlling brightness

///////// Copy this function to make one more RGB palette ///////
RGB_player(
         "Driver",                                            // Driver in project
         "Channel Red",                                       // Name of Red Channel
         "Channel Green",                                     // Name of Green Channel 
         "Channel Blue",                                      // Name of Blue Channel
         255,                                                 // Top limit for RGB channel (100 or 255)
         IR.GetItem("Page 1").GetItem("Item Color Picker 1"), // Item "Color Picker"
         /////// optional parameters ////////////////////////////
         IR.GetItem("Page 1").GetItem("Item Display 1"),      // Item "Display"
         IR.GetItem("Page 1").GetItem("Up 1"),                // Item "Up"
         IR.GetItem("Page 1").GetItem("Down 1"),              // Item "Down"
         10                                                   // Increment step for "Up" and "Down"
         )


In the description indicate where the palette is and to what equipment it sends data:

  • IR.GetDevice("Driver") - the name of the diver to which you will send RGB commands. Copy the driver name in PROJECT DEVICE PANEL
  • "Channel Red", "Channel Green", "Channel Blue" - the names of the variables (Commands) which are responsible for control of red, green and blue color components. Copy the names in PROJECT DEVICE PANEL. The Commands names have to be the same as the names of Feedbacks from where information about the current color of the RGB strip comes.
    HDL-Buspro, Domintell - they have a special way of writing names. For them you need to indicate <the device name in the network>:<the channel name>, for example "Dimmer in Bedroom:Channel 1"
  • 255 - the maximum brightness value for each color. For the majority of equipment brightness is regulated in the range from 0 to 255 but there are drivers which control color brightness in the range 0...100 (for example, HDL). For HDL-Buspro indicate value 100 for this property.
  • IR.GetItem("Page 1").GetItem("Item Color Picker 1") - the page name ("Page 1") and the item on it ("Item Color Picker 1") which you will use as a palette
  • IR.GetItem("Page 1").GetItem("Item Display 1") - the page name ("Page 1") and the item on it ("Item Display 1") which you will use for displaying the color selected on the palette
  • IR.GetItem("Page 1").GetItem("Up 1") - the page name ("Page 1") and the item on it ("Up 1") which will increase brightness of the selected color on pressing
  • IR.GetItem("Page 1").GetItem("Down 1") - the page name ("Page 1") and the item on it ("Down 1") which will decrease brightness of the selected color on pressing
  • 10 - the value on which brightness of the selected color will increase/decrease when clicking Up and Down


2.3 Click "OK" to save the palette description. Start Emulator to test its work.

Errors which can appear at incorrect palette description are displayed in the log window (F4)



Discrete Inputs

Feedback:

Device ID 0 .. n the PLC identifier (Slave ID)
Type Discrete Inputs the discrete register available for reading only
Address 0 .. n the register address in the decimal format
Value * value
0 .. 1 0 = Off, 1 = On

* - Values come to Feedback and they can be used for displaying the status of registers on items


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)


Input Register

Feedback:

Device ID 0 .. n the PLC identifier (Slave ID)
Type Input Register the input register, available for reading
Address 0 .. n the register address in the decimal format
Word Size Word(16 bit) 16-bit word
DWord (32-bit) 32-bit word consisting of two standard Word registers
Float (32-bit) 32-bit word with floating point
Content Type Low Endian the writing begins with the lower byte and ends with the higher byte (b1, b2, b3, b4)
Big Endian the writing begins with the higher byte and ends with the lower byte (b4, b3, b2, b1)
Swapped Low Endian, Swapped Big Endian bits in each word are written in the reversed order (n,...,1)
Value * Word Size value
0 .. 65535 Word(16 bit) unsigned 2 bytes
-32768 .. 32767 Word(16 bit) signed 2 bytes
0 ... 4294967295 Dword(32 bit) unsigned 4 bytes
-2147483648 .. 2147483647 Dword(32 bit) signed 4 bytes
-2147483648.0 .. 2147483647.0 Float(32 bit) 4 bytes with floating point

* - Values come to Feedback and they can be used for displaying the status of registers on items


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)


Emulator: project testing

Emulator - an application launched in iRidium Studio to test the project work.

An Emulator works only when you authorized with login and password from iRidium Mobile web site

Emulator work modes see in iRidium Studio > Tools > Options > Emulator:

  • Client Fullscreen - start the Emulator in Full Screen mode (press Alt+F4 to Exit)
  • Client Sound On - switch sound in app
  • Show log at Emuator Start - open the log window automatically at Emulator start (you can also use F4)


Path to the license.png

Hot keys:

  • F4 - open the debug log
  • F5 - launch Emulator
  • F7 - open the app Menu to manage account and download projects from iRidium Cloud
  • F8 - open the settings (password: 2007)


Synchronization with control panels

Upload and launch of the iRdidium project on the control panel is performed with the help of the iRidium Transfer application, installed on your PC. You can also upload the project on the panel from the editor via Transfer.


Use i3 pro for iOS, Android, Windows, Mac in Test Mode by downloading projects via iRidium Transfer (the possibility is available for integrators):


iRidium Transfer settings


Commercial use of iRidium is possible only at download of visualization projects with the help of the iRidium Cloud service on the iRidium Mobile web site (see the instructions).

iRidium Cloud can be set up only by a registered integrator. After the setting up he can invite end-users to control the automation object.