Difference between revisions of "Extensions.EventHandling.ThresholdExceededEventSource"

From emotive
Jump to navigation Jump to search
Line 13: Line 13:
 
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.
  
{{Note|IMPORTANT — A '''ThresholdExceededEventSource''' which is applied to an uninitialized variable shall also count as threshold exceeded event and does NOT pose an error.}}
+
{{Important| A '''ThresholdExceededEventSource''' which is applied to an uninitialized variable shall 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.}}

Revision as of 10:52, 24 October 2018

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

EventSourceTerm = EventHandling.ThresholdExceededEventSource(SimpleTerm, SimpleTerm, Variable);

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 should be triggered. Event queue should 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.

Exclamation.png Important: A ThresholdExceededEventSource which is applied to an uninitialized variable shall also count as threshold exceeded event and does NOT pose an error.

Return Value

The Term returns the value, see table below.

Icons Note.png 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 shall 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 shall 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 shall be fired.

OTL Examples

Float LowerThreshold1 = 1;
Float UpperThreshold1 = 99.9;
EventHandling.EventSource EventSource1;
Float Variable1 = 8;
EventHandling.Event Event1;

EventSource1 = EventHandling.ThresholdExceededEventSource(LowerThreshold1, UpperThreshold1, Variable1);

parallel
{
   lane
   {
      while (true) : WhileLoop1
      {
         Variable1 = Variable1 + 1;
      }
   }
   lane
   {
      EventHandling.WaitForEvent({EventSource1}, Event1);

      terminate;
   }
}

See also

WaitForEvent
IsThresholdExceededEvent
TimerExpiredEventSource