Difference between revisions of "Extensions.DiagCom.GetDiagServiceFromEvent"

From emotive
Jump to navigation Jump to search
Line 1: Line 1:
 
{{DISPLAYTITLE:OTX '''GetDiagServiceFromEvent'''}}[[Category:DiagCom]]
 
{{DISPLAYTITLE:OTX '''GetDiagServiceFromEvent'''}}[[Category:DiagCom]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | GetDiagServiceFromEvent | Diagnostics service event handler source | [[Term]] | [[Extensions.DiagCom|OTX DiagCom extension]] | [[Event related terms]] | [[Core.Actions.Throw.Exception.TypeMismatchException|TypeMismatchException]] | - }}
+
{{ClassificationActivity | GetDiagServiceFromEvent | Gets a handle to the '''DiagService''' object that caused the event| [[Term]] | [[Extensions.DiagCom|OTX DiagCom extension]] | [[Extensions.DiagCom#Terms|Event 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;">
DiagServiceTerm = DiagCom.GetDiagServiceFromEvent(EventTerm);
+
DiagServiceTerm = DiagCom.GetDiagServiceFromEvent(EventValue);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The '''GetDiagServiceFromEvent''' term returns associated with the event handling source Diagnostics Service, see [[Event Library]]. Thus, this term is the opposite of [[Extensions.DiagCom.DiagServiceEventSource|DiagServiceEventSource]] term.
+
The '''GetDiagServiceFromEvent''' term accepts an '''EventValue''' term yielding an [[Extensions.EventHandling.Event|Event]] object that has been raised by the OTX runtime, as a result of declaring a [[Extensions.DiagCom.DiagService|DiagService]] object as an event source by using the term [[Extensions.DiagCom.DiagServiceEventSource|DiagServiceEventSource]]. It returns a handle to the [[Extensions.DiagCom.DiagService|DiagService]] object that caused the event (i.e. because a new ECU Result has been received after the [[Extensions.DiagCom.DiagService|DiagService]] has been executed). By using this term, an OTX sequence can wait for an [[Extensions.EventHandling.Event|Event]] raised by a [[Extensions.DiagCom.DiagService|DiagService]] receiving a new [[Extensions.DiagCom.Result|Result]] and then evaluate the [[Extensions.DiagCom.Result|Result]]/[[Extensions.DiagCom.Response|Response]] structure of that [[Extensions.DiagCom.DiagService|DiagService]].
  
{{TermReturnValue| [[Core.DataTypes.ComplexDataType.DiagService|DiagService]] | Diagnostics Service.}}
+
{{TermReturnValue| [[Extensions.DiagCom.DiagService|DiagService]] | The [[Extensions.DiagCom.DiagService|DiagService]] object that caused the event.}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Event | [[Extensions.EventHandling.Event|Event]] | [[Term]] | - | [1] | Represents the event that was raised by the [[Core.DataTypes.ComplexDataType.DiagService|DiagService]] that shall be retrieved.}}
+
{{TableRowPropertie1| Event | [[Extensions.EventHandling.Event|Event]] | [[Value]] | - | [1] | Represents the event that was raised by the [[Core.DataTypes.ComplexDataType.DiagService|DiagService]] that shall be retrieved.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
DiagCom.ComChannel myComCannel;
 
 
DiagCom.DiagService DiagService1;
 
DiagCom.DiagService DiagService1;
 
EventHandling.EventSource EventSource1;
 
EventHandling.EventSource EventSource1;
 
EventHandling.Event Event1;
 
EventHandling.Event Event1;
DiagCom.DiagService DiagService2;
+
DiagCom.DiagService DiagServiceFromEvent1;
 +
DiagCom.ComChannel ComChannel1;
  
myComCannel = DiagCom.GetComChannel("LL_AirbaUDS", null, false);
+
/// Flow
DiagService1 = DiagCom.CreateDiagServiceByName(myComCannel, "DiagnServi_ReadDataByIdentBasicSettiStatu");
+
 
 +
ComChannel1 = DiagCom.GetComChannel("LL_GatewUDS", "", false);
 +
DiagService1 = DiagCom.CreateDiagServiceByName(ComChannel1, "DiagnServi_DiagnSessiContr");
 
EventSource1 = DiagCom.DiagServiceEventSource(DiagService1);
 
EventSource1 = DiagCom.DiagServiceEventSource(DiagService1);
  
 
parallel
 
parallel
 
{
 
{
  lane
+
lane
  {
+
{
      DiagCom.ExecuteDiagService(DiagService1, {}, {}, false, false);
+
[#MetaData(RequestPdu), <#Data>10 01</#Data>]
  }
+
DiagCom.ExecuteDiagService(DiagService1, {}, {}, NULL, NULL, true, false);
  lane
+
}
  {
+
lane
      EventHandling.WaitForEvent({EventSource1}, Event1);
+
{
  }
+
EventHandling.WaitForEvent({EventSource1}, Event1);
 +
DiagServiceFromEvent1 = DiagCom.GetDiagServiceFromEvent(Event1);
 +
}
 
}
 
}
 
DiagService2 = DiagCom.GetDiagServiceFromEvent(Event1);
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== See also ==
 
== See also ==
 +
[[Extensions.DiagCom.GetComChannel|GetComChannel]] <br/>
 +
[[Extensions.DiagCom.CreateDiagServiceByName|CreateDiagServiceByName]] <br/>
 +
[[Extensions.DiagCom.ExecuteDiagService|ExecuteDiagService]] <br/>
 +
[[Extensions.EventHandling.DiagCom.WaitForEvent|WaitForEvent]] <br/>
 
[[Extensions.DiagCom.DiagServiceEventSource|DiagServiceEventSource]] <br/>
 
[[Extensions.DiagCom.DiagServiceEventSource|DiagServiceEventSource]] <br/>
 
[[Extensions.DiagCom.IsDiagServiceEvent|IsDiagServiceEvent]]
 
[[Extensions.DiagCom.IsDiagServiceEvent|IsDiagServiceEvent]]

Revision as of 11:06, 15 October 2018

Classification

Name GetDiagServiceFromEvent
Short Description Gets a handle to the DiagService object that caused the event
Class Term
Extension OTX DiagCom extension
Group Event related terms
Exceptions TypeMismatchException
Checker Rules -
Standard Compliant Yes

OTL Syntax

DiagServiceTerm = DiagCom.GetDiagServiceFromEvent(EventValue);

Description

The GetDiagServiceFromEvent term accepts an EventValue term yielding an Event object that has been raised by the OTX runtime, as a result of declaring a DiagService object as an event source by using the term DiagServiceEventSource. It returns a handle to the DiagService object that caused the event (i.e. because a new ECU Result has been received after the DiagService has been executed). By using this term, an OTX sequence can wait for an Event raised by a DiagService receiving a new Result and then evaluate the Result/Response structure of that DiagService.

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
DiagService The DiagService object that caused the event.

Properties

Name Data Type Class Default Cardinality Description
Event Event Value - [1] Represents the event that was raised by the DiagService that shall be retrieved.

OTL Examples

DiagCom.DiagService DiagService1;
EventHandling.EventSource EventSource1;
EventHandling.Event Event1;
DiagCom.DiagService DiagServiceFromEvent1;
DiagCom.ComChannel ComChannel1;

/// Flow

ComChannel1 = DiagCom.GetComChannel("LL_GatewUDS", "", false);
DiagService1 = DiagCom.CreateDiagServiceByName(ComChannel1, "DiagnServi_DiagnSessiContr");
EventSource1 = DiagCom.DiagServiceEventSource(DiagService1);

parallel
{
	lane
	{
		[#MetaData(RequestPdu), <#Data>10 01</#Data>]
		DiagCom.ExecuteDiagService(DiagService1, {}, {}, NULL, NULL, true, false);
	}
	lane
	{
		EventHandling.WaitForEvent({EventSource1}, Event1);
		DiagServiceFromEvent1 = DiagCom.GetDiagServiceFromEvent(Event1);
	}
}

See also

GetComChannel
CreateDiagServiceByName
ExecuteDiagService
WaitForEvent
DiagServiceEventSource
IsDiagServiceEvent