Extensions.Measure.GetDeviceServiceNameFromEvent

From emotive
Jump to navigation Jump to search

Classification

Name GetDeviceServiceNameFromEvent
Short Description Gets the device and service name of the device and service that caused the event.
Class Term
Extension OTX Measure extension
Group Event related terms
Exceptions TypeMismatchException
Checker Rules -
Standard Compliant Yes

OTL Syntax

StringTerm Measure.GetDeviceServiceNameFromEvent(EventValue event);

Description

The GetDeviceServiceNameFromEvent term accepts an EventValue term and returns a string which contains the device and service name of the device and service that caused the event. By using this term, an OTX sequence can wait for an Event raised by a device receiving a new result and then evaluate which service of that device caused the event.

The returned string value will be composed out of two parts: "devicename.servicename", where "devicename" and "servicename" are the names as given by the corresponding DeviceSignature.

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
String The string that contains the name of the device and services.

Properties

Name Data Type Class Default Cardinality Description
Event Event Value - [1] Represents the event that was raised after executing a device service.

OTL Examples

/// Signatures

package Measure.DeviceSignature DeviceSignature1
{
	Measure.DeviceServiceSignature Add(in Integer a, out Measure.Measurement Measurement);
}

/// Global Declarations

public procedure main()
{
	/// Local Declarations

	Measure.Measurement Measurement1;
	Integer a1 = 10;
	EventHandling.EventSource EventSource1;
	EventHandling.Event Event1;
	String String1 = "";

	/// Flow

	EventSource1 = Measure.DeviceEventSource(DeviceSignature1);

	parallel
	{
		lane
		{
			Measure.ExecuteDeviceService(DeviceSignature1, Add, {a = a1, Measurement = Measurement1}, false, false);
		}
		lane
		{
			EventHandling.WaitForEvent({EventSource1}, Event1);
		}
	}

	String1 = Measure.GetDeviceServiceNameFromEvent(Event1);
}

See also

DeviceEventSource
IsDeviceEvent