Difference between revisions of "Extensions.EventHandling.Sleep"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
{{DISPLAYTITLE: '''Sleep'''}}[[Category:EventHandling]] | {{DISPLAYTITLE: '''Sleep'''}}[[Category:EventHandling]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | Sleep| | + | {{ClassificationActivity | Sleep| Suspends the current thread| [[Action]]| [[Extensions.EventHandling|OTX EventHandling extension]] | [[Extensions.EventHandling#Actions|EventHandling related actions]] | [[Core.DataTypes.ComplexDataType.OutOfBoundsException|OutOfBoundsException]] | - }} |
== OTL Syntax == | == OTL Syntax == | ||
− | |||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | EventHandling. | + | EventHandling.Sleep(NumericTerm); |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
== Description == | == Description == | ||
− | + | The OTX '''Sleep''' activity suspends the current thread for the specifies amount of time in milliseconds. This can be useful for waiting on an external application or task. It does not cause CPU usage during the pause. | |
− | |||
− | The OTX ''' | ||
− | |||
− | |||
== Properties == | == Properties == | ||
− | |||
− | |||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{ | + | {{TableRowPropertie2| TimeOut | [[Numeric]] | [[Term]] | - | [1] | This element specifies an [[Core.DataTypes.SimpleDataType.Integer|Integer]] value that is interpreted as a time in milli-seconds to wait. [[Core.DataTypes.SimpleDataType.Float|Float]] values shall be truncated.}} |
− | |||
|} | |} | ||
− | + | ||
== OTL Examples == | == OTL Examples == | ||
− | |||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | /// Local Declarations | |
+ | |||
+ | Integer Integer1; | ||
EventHandling.EventSource EventSource1; | EventHandling.EventSource EventSource1; | ||
− | EventSource1 = EventHandling.MonitorChangeEventSource( | + | /// Flow |
+ | |||
+ | Integer1 = 12; | ||
+ | EventSource1 = EventHandling.MonitorChangeEventSource(Integer1); | ||
+ | |||
parallel | parallel | ||
{ | { | ||
− | + | lane | |
− | + | { | |
− | + | EventHandling.WaitForEvent({EventSource1}); | |
− | + | } | |
− | + | lane | |
− | + | { | |
− | + | EventHandling.Sleep(500); | |
− | + | Integer1 = 13; | |
+ | } | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
== See also == | == See also == | ||
− | [[Extensions.EventHandling.WaitForEvent|WaitForEvent]] | + | [[Extensions.EventHandling.WaitForEvent|WaitForEvent]]<br/> |
+ | [[Extensions.EventHandling.CloseEventSource|CloseEventSource]] |
Revision as of 10:31, 24 October 2018
Classification
Name | Sleep |
Short Description | Suspends the current thread |
Class | Action |
Extension | OTX EventHandling extension |
Group | EventHandling related actions |
Exceptions | OutOfBoundsException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
EventHandling.Sleep(NumericTerm);
Description
The OTX Sleep activity suspends the current thread for the specifies amount of time in milliseconds. This can be useful for waiting on an external application or task. It does not cause CPU usage during the pause.
Properties
Name | Data Type | Class | Default | Cardinality | Description |
TimeOut | Numeric | Term | - | [1] | This element specifies an Integer value that is interpreted as a time in milli-seconds to wait. Float values shall be truncated. |
OTL Examples
/// Local Declarations
Integer Integer1;
EventHandling.EventSource EventSource1;
/// Flow
Integer1 = 12;
EventSource1 = EventHandling.MonitorChangeEventSource(Integer1);
parallel
{
lane
{
EventHandling.WaitForEvent({EventSource1});
}
lane
{
EventHandling.Sleep(500);
Integer1 = 13;
}
}