Эта страница является
переводом страницы
IRidium studio 2019 Routines. Перевод выполнен на 58%.
Routines
A routine is automatically launched when a certaiin event happens: data are received from equipment, or a scheduled event happens
Routines work only on iRidium server
Routines work with two types of schedules Advanced and Simple:
- Advanced are advanced (basic) schedules. Advanced schedules allow to set in the studio the following parameters beforehand: the time and date of event start and end, and the repetition period of an event. Advanced schedules also work with TimeTable item.
- Simple - are simplified schedules. Simple schedules allow to work with editable routines from a launched panel proejct.
Read a detailed description of settings and work with schedules here.
The routines window contains the following settings up:
- Name - routine name;
- Description - description;
- Active (Active on Server) - turn on / off the routine on the server;
- Edit from panel - turn routines editing on / off from the control panel.
Routines: conditions, actions
Routines work is based on event logic:
- Condition for routine work (WHEN) is an event that caused commands, set in THEN, to be done, but only in case conditions set in BUT ONLY IF are fulfilled.
- Feedback is a driver variable. It works once, them moment a variable changes from the current value to the one set in the condition. The next assignment of the same variable value does not cause the condition to work (it must be reset and assigned again).
- Operation is comparison operators -:
- Start/Finish - a routine is acitated by the start/finish of a schedule (Advanced),
- Timer - a routine is activated by the start or finish of a schedule (Simple),
- == - a routine is actiated if Feedback = Value.
- Value is a feedback value that activates a routine.
- Edit - editing an event in a panle project (except schedules of "Advanced" type).
- Public name is the name of an event (to display in a panel project).
- Actions when a routine works (THEN) are all commands set in THEN, they will be done one after another starting with the top of the list.
- Feedback - commands that are done:
- Send number - send a number,
- Send text - send text,
- Send data - send data in 16-bit format,
- Send token - send a token,
- Delay - a delay,
- Script call - activation of a script function.
- Edit - editing actions in a panel project (except Send data, Script call and Send tag).
- Public name - th name of an action (to display in a panel project).
- Excluding conditions (BUT ONLY IF) - if they are not done, commands in THEN won't work. If there are several conditions, all of them must be done.
- Feedback - a driver variable or a schedule (must be equal to a set value).
- Operation - comparison operators:
- ==, !=, <, >, <=, >= - comparison of values in a channel with set values,
- Active / Inactive - activation of a schedule of Advanced type.
- Value - a value to compare with Feedback.
- Edit - editing conditions for channel values in a panel project.
- Public name - the name of a condition (to display in a panel project).
Activating Routine from Control Panel
A Routine can be started from a control panel by pressing a button .
To set it, do the following:
1 Create a pair virtual channel + virtual tag in a server project for each routine.
2 Set data exchange between a virtual channel and a corresponding tag.
3 Set the change of a virtual tag as a condition to activate a routine in the settings of a Routine.
4 Synchrinize a panel and a server project, assign a virtual channels to a graphic item (button).
5 Send a value to a corresponding virtual channel by pressing button in a panel project.
Setting Editable Routines
Editable routines are routines created in iRidium Studio, which parameters can be edited by an end-user in a launched project.
1 Create a required number of server routines in a server project and set parameters ( that later on can be edited from a panel proejct).
Editable routines work only with schedules of Simple type.
2 Synchronize a server project with a panel one with the help of iRidium Server driver.
3 Drag'n'drop onto an item in a panel project a command that calls an interface to edit a routine.
Use of Editable Routines in a Project
To edit server routines in a panel project, it's required to press a button to which a command on opening an editor window was assigned (p.3 Setting editable routines). The editor window will appear on the screen:
The editor window allows to:
- activate or deactivate a parameter or the whole routine (Enable),
- change a comparison operator (==, <, > etc.),
- change a parameter value or the time of routine activation,
- Reset a routine to default settings (Set Default Routine Settings).