Extensions.EventHandling.ThresholdExceededEventSource
Jump to navigation
Jump to search
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