- iRidi Studio 2019
- Rules (Routines)
Rules (Routines)
A routine starts automatically when a specified event occurs: data is received from equipment or a scheduled event is triggered
Routines work only on iRidi Server
Routines work with two schedule types: Advanced and Simple :
- Advanced - advanced (main) schedules. Advanced schedules let you preconfigure an event's start and end times and days, as well as its repetition interval, in Studio. Advanced schedules also work with the TimeTable item.
- Simple - simplified schedules. Simplified schedules let you work with editable routines from a running Panel Project.
- Schedule configuration and operation are described in detail here.

The routines window contains the following settings:
- Name - routine name;
- Description - description;
- Active (Active on Server) - enable or disable the routine on the server;
- Edit from panel - enable or disable routine editing from a control panel.
Routines: trigger conditions, actions, and restrictions
Routines use event-driven logic:
-
Trigger condition (WHEN) - an event that executes the commands in THEN, but only if the conditions in BUT ONLY IF are met.
- Feedback - a driver variable (feedback). Triggers once, when the variable changes from its current value to the value specified in the condition. Assigning the same value again does not trigger the condition: the value must first be reset and then assigned again.
- Operation - comparison operators:
- Start/Finish - activates the routine at the start or finish of an Advanced schedule,
- Timer - activates the routine at the start or finish of a Simple schedule,
- == - activates the routine if Feedback = Value.
- Value - the feedback value that activates the routine.
- Edit - edit the event in a Panel Project (except Advanced schedules).
- Public name - event name displayed in a Panel Project.
-
Actions on activation (THEN) - all commands configured in THEN execute sequentially, starting at the top of the list.
- Feedback - commands to execute:
- Send number - send a number,
- Send text - send text,
- Send data - send data in base16 (hexadecimal),
- Send token - send a token,
- Delay - delay (in ms),
- Script call - call a script function.
- Edit - edit actions in a Panel Project (except Send data, Script call, and Send tag).
- Public name - action name displayed in a Panel Project.
- Feedback - commands to execute:
-
Restricting conditions (BUT ONLY IF) - if these conditions are not met, the THEN commands do not execute. If there are several conditions, all must be met.
- Feedback - a driver variable (feedback) or schedule that must equal the specified Value.
- Operation - comparison operators:
- ==, !=, , = - compare channel values with the specified Value,
- Active / Inactive - activation of an Advanced schedule.
- Value - values to compare with Feedback.
- Edit - edit conditions for channel values in a Panel Project.
- Public name - condition name displayed in a Panel Project.
WHEN
THEN
BUT ONLY IF
- Release 1.3.62 adds the ability to insert a new action or condition below the selected row.
Activating a routine from a control panel
You can start a configured routine (Routines) manually by pressing a button on a control panel. To do so:
- In the server project, create a virtual channel + virtual tag pair for each routine.
- Configure the forwarding between the virtual channel and its corresponding tag.

- In the routine settings (Routines), specify a change in the virtual tag as the trigger condition.

-
Synchronize the Panel Project and server project, and bind the virtual channel to a graphic item (button).
-
In the Panel Project, send a value to the corresponding virtual channel when the button is pressed.
Configuring editable routines
Editable routines are created in iRidi Studio and have parameters that the end user can edit in a running Panel Project.
- Create the required number of server routines in the server project and set their initial parameters, which can later be edited from the Panel Project.
- Editable routines work only with Simple schedules.
- Synchronize the server project with the Panel Project using the iRidi Server driver.
- Drag the command that opens the routine-editing interface onto an item in the Panel Project.

Using editable routines in a project
To edit server routines, press the button in the Panel Project to which you assigned the command that opens the editor (step 3 in Configuring editable routines). The editor window appears:

In the editor, you can:
- Enable or disable a parameter or the entire routine (Enable),
- Change the comparison operator (==, and others),
- Change a parameter value or the routine's activation time,
- Reset the routine to its configured defaults (Set Default Routine Settings).

When editing a routine's execution time, you can select positive and negative offsets relative to sunset or sunrise.

Using editable routines in a project
Custom routine translations in an i3Pro project
Custom translation of routines and schedules in i3Pro lets users add independent translations that are not tied to the overall interface localization. This feature is available in the server project settings and supports translation into the 10 main languages used by Studio.

Setting the translation language

The Routines language field selects the main translation language from the available options, allowing independent translations of routine pages in i3Pro.
Important! The routine translation language does not depend on the currently selected Studio or i3Pro interface language: users can choose any available language.
Custom routines translate

Custom routines translate lets users customize translations of routine and schedule pages for each project. To activate it, enable this feature on the i3Pro tab in the Panel Project settings.
Important! Before configuring custom translations, run i3Pro at least once to load the standard translation templates. For example, use the emulator available in the program.
Editing a custom translation

Custom translation is based on standard translation templates. The Customise button opens a translation table where you can enter your own values. Filled fields replace the standard item translations, while empty fields continue to use standard translations in the selected language.
Copying translations from another project Use Copy from another project to transfer custom translation settings from another Panel Project. Select the required project in the browser window that opens.
After you configure and upload the project to i3Pro, the routine pages display the user's custom translation.