Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:sw:01-mervis:task-definition-hidden [2024/04/23 13:31] – [Defining a task] avsetulaen:sw:01-mervis:task-definition-hidden [2024/04/23 15:07] (current) – [Task categories] avsetula
Line 14: Line 14:
 </WRAP> </WRAP>
 <WRAP half column 100%> <WRAP half column 100%>
-In the Mervis system, it is possible to define the tasks to be run in the controller (RT). A task is a definition of conditions for running a selected / mapped program or several different programs in a specified order. +In the Mervis system, it is possible to define the tasks to be run in the controller (RT). A task is a definition of conditions for running a selected/mapped program or several different programs in a specified order. 
  
 In the **simple mode** of the solution, one task is always defined that repeatedly executes the **main.program.fbd** program and this cannot be changed. If [[en:sw:01-mervis:multiple-controllers-hidden|multiple controllers in the project]] are desired, run multiple different programs, or condition the execution of a program, it is necessary to have the solution in [[en:sw:01-mervis:creating-new-project-hidden?tns#switching_to_full_mode|full mode]].  In the **simple mode** of the solution, one task is always defined that repeatedly executes the **main.program.fbd** program and this cannot be changed. If [[en:sw:01-mervis:multiple-controllers-hidden|multiple controllers in the project]] are desired, run multiple different programs, or condition the execution of a program, it is necessary to have the solution in [[en:sw:01-mervis:creating-new-project-hidden?tns#switching_to_full_mode|full mode]]. 
Line 27: Line 27:
 ===== Task properties description ===== ===== Task properties description =====
  
-Double-clicking the PLC name in the Solution will display a list of defined tasks with their properties.+Double-clicking the controller name in the left panel of the solution will display a list of defined tasks with their properties.
  
 {{ .:task-definition:advanced_task_definition_03_open_task_list.png?direct |}} {{ .:task-definition:advanced_task_definition_03_open_task_list.png?direct |}}
  
-The default state of the PLC tasks list (creation in **Simplified mode**):+Default list of controller tasks (created in **Simple mode**):
  
 {{ .:task-definition:advanced_task_definition_04_task_details.png?direct |}} {{ .:task-definition:advanced_task_definition_04_task_details.png?direct |}}
Line 57: Line 57:
 ---- ----
  
-**NormalOperationTask** - Normal operation, default option for every task. The task runs according to the specified type and parameters+**NormalOperationTask** - Normal operation, default option for each task. The task is executed according to the specified type and parameters.
  
 **ExecutionError** - Triggers in case of a critical //NormalOperationTask// error (e.g. division by zero). If a job with this category is created, the job ID is automatically changed to the last (highest) ID. There can be only one job with this category. **ExecutionError** - Triggers in case of a critical //NormalOperationTask// error (e.g. division by zero). If a job with this category is created, the job ID is automatically changed to the last (highest) ID. There can be only one job with this category.
  
 <WRAP center round info 90%> <WRAP center round info 90%>
-Mervis IDE allows you to create multiple NormalOperationTask categories, provided that the first one is of the Freewheeling type, +Mervis IDE allows you to create multiple NormalOperationTask categories, provided that the first one is of the Freewheeling type, or Cyclic and the other tasks in this category will be of type Event only. The task types are described in detail [[#tasks_types|below]]. 
-or Cyclic and the other tasks in this category will be of type Event only. The task types are described in detail [[#tasks_types|below]].+</WRAP> 
 + 
 +<WRAP center round important 90%> 
 +If running the program continuously is a higher priority than running without errors and logging them, it is possible to disable the **Stop on Exception** option in the controller properties and never run a job of type ExecutionError: 
 + 
 +{{.:task-definition:stop-on-except.png?direct|}}
 </WRAP> </WRAP>
  
 ==== Program mapping ==== ==== Program mapping ====
  
-By clicking in the box under **Program Mapping** the table will be displayed: +By double-clicking in the box under **Program Mapping** the window will be displayed:
  
 {{ .:task-definition::advanced_task_definition_06_program_mapping.png?direct |}} {{ .:task-definition::advanced_task_definition_06_program_mapping.png?direct |}}
  
-In this table, desired program is selected by clicking on it and added by clicking the **Add →** button.+In this windowthe desired program is selected by clicking on it and added by clicking the **Add →** button.
  
 {{ .:advanced-task-definition:advanced_task_definition_07_program_mapping_window.png?direct |}} {{ .:advanced-task-definition:advanced_task_definition_07_program_mapping_window.png?direct |}}
Line 82: Line 87:
 ==== Task types ==== ==== Task types ====
  
-Task type defines the way of its execution.+Task type defines how the task is executed.
  
 {{ .:task-definition:advanced_task_definition_08_task_types.png?direct |}} {{ .:task-definition:advanced_task_definition_08_task_types.png?direct |}}
Line 88: Line 93:
 |< 100% 20% 80%>| |< 100% 20% 80%>|
 ^ Type         ^ Meaning                                                                  ^ ^ Type         ^ Meaning                                                                  ^
-| Freewheeling | Normal execution, pause between cycles according to % setting            | +| Freewheeling | Normal execution, pause between cycles according to ''%'' setting            | 
-| Cyclic       | The task is started periodically according to the defined interval in ms |+| Cyclic       | The task is started periodically according to the defined interval in ''ms'' |
 | Event        | The task is executed if the defined condition is met                     | | Event        | The task is executed if the defined condition is met                     |
  
Line 96: Line 101:
 <html><span class="kbBlueText">1. Freewheeling</span></html> <html><span class="kbBlueText">1. Freewheeling</span></html>
  
-Setting the Freewheeling type means that the selected task will be executed over and over again, according to the PLC's capabilities. The **Sleep Ratio** parameter specifies the time to wait for the next computation cycle. The time is given as a fraction of the time of the last computation cycle. Example: if one computation cycle takes 10 ms and Sleep Ratio will be set to 30%, controller will run the next cycle after 3 ms.+Setting the Freewheeling type means that the task will be executed over and over again, according to the controller's capabilities.  
 + 
 +The **Sleep Ratio** parameter specifies the sleep time before the next cycle starts. The time is given as a percentage of the duration of the last cycle. Example: if one cycle takes 10 ms and Sleep Ratio will be set to 30%, controller will run the next cycle after 3 ms.
  
 ---- ----
Line 102: Line 109:
 <html><span class="kbBlueText">2. Cyclic</span></html> <html><span class="kbBlueText">2. Cyclic</span></html>
  
-If the Cyclic type is set, the job will be executed every fixed period [ms]. For longer periods, it is convenient to use the ST syntax, for example, when setting period of 2 h and 30 min, we write the value "t#2h30minstead of the number "8400000" (data type TIME).+If the Cyclic type is set, the job will be executed every fixed period [ms].  
 + 
 +For longer periods, it is convenient to use the ST syntax, for example, when setting the period of 2 h and 30 min, write the value **t#2h30m** (TIME data type) instead of the number 8400000.
  
 ---- ----
Line 108: Line 117:
 <html><span class="kbBlueText">3. Event</span></html> <html><span class="kbBlueText">3. Event</span></html>
  
-The Event setting offers conditional execution of task that can be executed either once or repeatedly in response to selected variable. There are 4 options in total:+The Event type setting provides conditional execution of the task that can be executed one or repeatedly in reaction to the selected variable value. There are 4 options in total:
  
 ^ Trigger condition  ^ Meaning                                    ^ ^ Trigger condition  ^ Meaning                                    ^
Line 118: Line 127:
 {{ .:task-definition:advanced_task_definition_09_trigger_conditions.png?direct |}} {{ .:task-definition:advanced_task_definition_09_trigger_conditions.png?direct |}}
  
-After expanding the **variable** parameter, a table with a list of variables appears, the desired variable can be added by selecting it and clicking the **Add** button.+After expanding the **variable** parameter, a window with a list of variables appears, the desired variable can be added by selecting it and clicking the **Add ->** button.
  
 {{ :en:sw:01-mervis:advanced-task-definition:event-assign-en.png?direct |}} {{ :en:sw:01-mervis:advanced-task-definition:event-assign-en.png?direct |}}
  
 <WRAP center round important 90%> <WRAP center round important 90%>
-If you want to use *commerror variablesyou must use it in the main program - it is enough to connect it to itself, otherwise even will not be ran.+To run a task of the event type, it is necessary to select as the trigger variable a variable that is used in the main program. To use a variable in FBD, just connect it to itself
  
 {{ :cs:sw:01-mervis:advanced-task-definition:commerrror-fix.png?direct |}} {{ :cs:sw:01-mervis:advanced-task-definition:commerrror-fix.png?direct |}}
 +
 +The same rule applies to commerror and other attributes. 
 </WRAP> </WRAP>
  
Line 155: Line 166:
 <html><span class="kbBlueText">1. Example of a safe condition of the device "Sawmill"</span></html> <html><span class="kbBlueText">1. Example of a safe condition of the device "Sawmill"</span></html>
  
-The device operating the saw. When a program error occurs, the **NormalOperation** task is stopped and the **ExecutionError** task is started, which stops the saw blade and feed. This error condition treatment avoids potential injury to workers or saw damage.+The device operating the saw. When a program error occurs, the **NormalOperation** task is stopped and the **ExecutionError** task is started, which stops the saw blade and feeder. This error condition treatment avoids potential injury to workers or saw damage.
  
 <html><span class="kbBlueText">2. Example of a safe condition of the equipment "Cement Plant"</span></html> <html><span class="kbBlueText">2. Example of a safe condition of the equipment "Cement Plant"</span></html>
  
-Equipment operating a filler in a cement plant. When a program error occurs, the **NormalOperation** task stops and the **ExecutionError** task starts, which closes the bin flaps. This error condition treatment avoids unnecessary material loss.+A machine operating a filler in a cement plant. When a program error occurs, the **NormalOperation** task stops and the **ExecutionError** task starts, which closes the hopper flaps. This error condition treatment avoids unnecessary material loss.