Difference between revisions of "Extensions.EventHandling.GetNewValue"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
{{DISPLAYTITLE: '''GetNewValue'''}}[[Category:EventHandling]] | {{DISPLAYTITLE: '''GetNewValue'''}}[[Category:EventHandling]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | GetNewValue | Return the value that was stored in the given event | [[Term]] | [[Extensions.EventHandling|OTX EventHandling extension]] | [[Event source property related terms]] | [[Core. | + | {{ClassificationActivity | GetNewValue | Return the value that was stored in the given event | [[Term]] | [[Extensions.EventHandling|OTX EventHandling extension]] | [[Extensions.EventHandling#Terms|Event source property related terms]] | [[Core.DataTypes.ComplexDataType.TypeMismatchException|TypeMismatchException]] | - }} |
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | Term = EventHandling.GetNewValue(EventTerm); | |
</syntaxhighlight> | </syntaxhighlight> | ||
== Description == | == Description == | ||
− | The OTX '''GetNewValue''' term | + | The OTX '''GetNewValue''' term shall only be applied to events which were fired by a '''MonitorChangeEventSource''' or one of its descendants. The term shall return the value which was stored in the given Event; that value represents a snapshot of the monitored variable's new value at the time when the event was fired. The term is useful to find out which new value a variable had after it changed. |
− | + | If the specified event has not been raised by a '''MonitorChangeEventSource''' or one of its descendants, the [[Core.DataTypes.ComplexDataType.TypeMismatchException|TypeMismatchException]] exception will be thrown. | |
− | {{TermReturnValue| [[ | + | {{Note|IMPORTANT — Because of it the data type of the variable, the ''monitor change by event source'' depends was monitored, the return type is '''getNewValue''' usually not known at the authors. Therefore, type-safety of this term not be verified statically. Runtime exceptions can occur if the results of that term in the wrong place, for example when using. ''otx:ToInteger'' to a value that can not be converted to integer.}} |
+ | |||
+ | {{TermReturnValue| [[Term]] | The value that was stored in the given event.}} | ||
== Properties == | == Properties == | ||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie1| Event | [[Extensions.EventHandling.Event|Event]] | [[Term]] | - | [1] | | + | {{TableRowPropertie1| Event | [[Extensions.EventHandling.Event|Event]] | [[Term]] | - | [1] | Represents the monitor change event from which the new value of the formerly monitored variable at the time of value change shall be returned.}} |
|} | |} | ||
Revision as of 09:12, 26 September 2018
Contents
Classification
Name | GetNewValue |
Short Description | Return the value that was stored in the given event |
Class | Term |
Extension | OTX EventHandling extension |
Group | Event source property related terms |
Exceptions | TypeMismatchException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
Term = EventHandling.GetNewValue(EventTerm);
Description
The OTX GetNewValue term shall only be applied to events which were fired by a MonitorChangeEventSource or one of its descendants. The term shall return the value which was stored in the given Event; that value represents a snapshot of the monitored variable's new value at the time when the event was fired. The term is useful to find out which new value a variable had after it changed.
If the specified event has not been raised by a MonitorChangeEventSource or one of its descendants, the TypeMismatchException exception will be thrown.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Term | The value that was stored in the given event. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Event | Event | Term | - | [1] | Represents the monitor change event from which the new value of the formerly monitored variable at the time of value change shall be returned. |
OTL Examples
EventHandling.Event Event1;
String Variable1 = "String";
String Result1;
EventHandling.EventSource EventSource1;
EventSource1 = EventHandling.MonitorChangeEventSource(Variable1);
parallel
{
lane
{
EventHandling.WaitForEvent({EventSource1}, Event1);
}
lane
{
Variable1 = "String changed";
}
}
Result1 = EventHandling.GetNewValue(Event1);
See also
IsMonitorChangeEvent
IsThresholdExceededEvent
IsTimerExpiredEvent