Difference between revisions of "Extensions.EventHandling.ThresholdExceededEventSource"
Jump to navigation
Jump to search
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE: '''ThresholdExceededEventSource'''}}[[Category:EventHandling]] | {{DISPLAYTITLE: '''ThresholdExceededEventSource'''}}[[Category:EventHandling]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | ThresholdExceededEventSource | Create an Event Source for changes outside area | [[Term]] | [[Extensions.EventHandling|OTX EventHandling extension]] | [[Event source related terms]] | - | [[Extensions.EventHandling.EventChk001|Event_Chk001]] <br/> [[Extensions.EventHandling.EventChk002|Event_Chk002]] }} | + | {{ClassificationActivity | ThresholdExceededEventSource | Create an Event Source for changes outside area | [[Term]] | [[Extensions.EventHandling|OTX EventHandling extension]] | [[Extensions.EventHandling#Terms|Event source related terms]] | - | [[Extensions.EventHandling.EventChk001|Event_Chk001]] <br/> [[Extensions.EventHandling.EventChk002|Event_Chk002]] }} |
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | MonitorChangeEventSource EventHandling.ThresholdExceededEventSource(Variable variable, SimpleTerm lowerThreshold, SimpleTerm upperThreshold); | |
</syntaxhighlight> | </syntaxhighlight> | ||
== Description == | == Description == | ||
− | The OTX '''ThresholdExceededEventSource''' term creates an | + | The OTX '''ThresholdExceededEventSource''' term creates an ''event source'' that monitors the value of a variable and an event triggers when the value goes outside a certain range. If the value of start is already outside the specified range, the event will be triggered. Event queue will start immediately as soon as the ''event source'' is created. |
This ''event source'' is to apply only for the data types on which an order relation can be defined, namely the simple type data types. | This ''event source'' is to apply only for the data types on which an order relation can be defined, namely the simple type data types. | ||
− | {{ | + | {{Important| A '''ThresholdExceededEventSource''' which is applied to an uninitialized variable will also count as threshold exceeded event and does NOT pose an error.}} |
{{TermReturnValue| [[Extensions.EventHandling.EventSource|EventSource]] | The '''Event Source''', the changes in the value of a variable monitored within the value range.}} | {{TermReturnValue| [[Extensions.EventHandling.EventSource|EventSource]] | The '''Event Source''', the changes in the value of a variable monitored within the value range.}} | ||
Line 20: | Line 20: | ||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{ | + | {{TableRowPropertie2| Variable | - | [[Variable]] | - | [1] | Represents the variable that will be monitored.}} |
− | {{ | + | {{TableRowPropertie1| LowerThreshold | [[Simple]] | [[Term]] | - | [1] | Represents a value to compare against. If the value of the monitored variable becomes less that this value, the event will be fired.}} |
− | {{ | + | {{TableRowPropertie2| UpperThreshold | [[Simple]] | [[Term]] | - | [1] | Represents a value to compare against. If the value of the monitored variable becomes greater than this value, the event will be fired.}} |
|} | |} | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | Float LowerThreshold1 = 1; | + | /// Local Declarations |
+ | |||
+ | Float LowerThreshold1 = 1.0; | ||
Float UpperThreshold1 = 99.9; | Float UpperThreshold1 = 99.9; | ||
EventHandling.EventSource EventSource1; | EventHandling.EventSource EventSource1; | ||
− | Float Variable1 = 8; | + | Float Variable1 = 8.0; |
EventHandling.Event Event1; | EventHandling.Event Event1; | ||
+ | |||
+ | /// Flow | ||
EventSource1 = EventHandling.ThresholdExceededEventSource(LowerThreshold1, UpperThreshold1, Variable1); | EventSource1 = EventHandling.ThresholdExceededEventSource(LowerThreshold1, UpperThreshold1, Variable1); | ||
Line 37: | Line 41: | ||
parallel | parallel | ||
{ | { | ||
− | + | lane | |
− | + | { | |
− | + | while (true) : WhileLoop1 | |
− | + | { | |
− | + | Variable1 = Variable1 + 1; | |
− | + | } | |
− | + | } | |
− | + | lane | |
− | + | { | |
− | + | EventHandling.WaitForEvent({EventSource1}, Event1); | |
− | + | terminateLanes; | |
− | + | } | |
− | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 55: | Line 58: | ||
== See also == | == See also == | ||
[[Extensions.EventHandling.WaitForEvent|WaitForEvent]] <br/> | [[Extensions.EventHandling.WaitForEvent|WaitForEvent]] <br/> | ||
+ | [[Extensions.EventHandling.IsThresholdExceededEvent|IsThresholdExceededEvent]] <br/> | ||
[[Extensions.EventHandling.TimerExpiredEventSource|TimerExpiredEventSource]] | [[Extensions.EventHandling.TimerExpiredEventSource|TimerExpiredEventSource]] |
Latest revision as of 10:37, 12 September 2019
Contents
Classification
Name | ThresholdExceededEventSource |
Short Description | Create an Event Source for changes outside area |
Class | Term |
Extension | OTX EventHandling extension |
Group | Event source related terms |
Exceptions | - |
Checker Rules | Event_Chk001 Event_Chk002 |
Standard Compliant | Yes |
OTL Syntax
MonitorChangeEventSource EventHandling.ThresholdExceededEventSource(Variable variable, SimpleTerm lowerThreshold, SimpleTerm upperThreshold);
Description
The OTX ThresholdExceededEventSource term creates an event source that monitors the value of a variable and an event triggers when the value goes outside a certain range. If the value of start is already outside the specified range, the event will be triggered. Event queue will start immediately as soon as the event source is created.
This event source is to apply only for the data types on which an order relation can be defined, namely the simple type data types.
![]() |
Important: A ThresholdExceededEventSource which is applied to an uninitialized variable will also count as threshold exceeded event and does NOT pose an error. |
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
EventSource | The Event Source, the changes in the value of a variable monitored within the value range. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Variable | - | Variable | - | [1] | Represents the variable that will be monitored. |
LowerThreshold | Simple | Term | - | [1] | Represents a value to compare against. If the value of the monitored variable becomes less that this value, the event will be fired. |
UpperThreshold | Simple | Term | - | [1] | Represents a value to compare against. If the value of the monitored variable becomes greater than this value, the event will be fired. |
OTL Examples
/// Local Declarations
Float LowerThreshold1 = 1.0;
Float UpperThreshold1 = 99.9;
EventHandling.EventSource EventSource1;
Float Variable1 = 8.0;
EventHandling.Event Event1;
/// Flow
EventSource1 = EventHandling.ThresholdExceededEventSource(LowerThreshold1, UpperThreshold1, Variable1);
parallel
{
lane
{
while (true) : WhileLoop1
{
Variable1 = Variable1 + 1;
}
}
lane
{
EventHandling.WaitForEvent({EventSource1}, Event1);
terminateLanes;
}
}
See also
WaitForEvent
IsThresholdExceededEvent
TimerExpiredEventSource