Extensions.ComInterface.GetComChannelFromComInterface
Contents
Classification
Name | GetComChannelFromComInterface |
Short Description | A handle to the same ComChannel for a given ComInterface. |
Class | Term |
Extension | OTX ComInterface extension |
Group | ComInterface related Terms |
Exceptions | LossOfComException UnknownTargetException |
Checker Rules | |
Standard Compliant | Yes |
OTL Syntax
ComChannelTerm ComInterface.GetComChannelFromComInterface(ComInterfaceTerm comInterface, StringTerm identifier, StringTerm ecuVariantName, BooleanTerm performVariantSelection, StringTerm ressource);
Description
This term will return a communication channel from the ComInterface. It depends on the implementation of the OTX runtime system when the channel is actually created by the communication layer. There are three possible scenarios: The channel is created at the time this term is executed.
The channel already exists; no additional action is carried out by the execution of this term. The channel is created when it is first needed for actual diagnostic communication. No matter which approach is chosen, the term GetComChannelFromComInterface will always return a handle to the same ComChannel for a given ComInterface. It is possible to manually control the lifecycle of a ComChannel object by closing a ComChannel handle using the CloseComChannel action. This is up to the author of a diagnostic sequence, an OTX runtime system is expected to clean up open ComChannel handles at the end of a diagnostic session.
The OTX runtime will perform an ECU variant selection after opening of the channel if the term given by the optional element performVariantSelection yields true. This implies that when the next action on a communication channel is performed, the runtime system has identified the variant of the ECU actually present at runtime and configured the ComChannel accordingly. In case both an ecuVariantName is provided and performVariantSelection yields true, the channel is created to point at the desired ECU variant and variant selection is performed on the link afterwards. The variant identification functionality also exists as a separate action.
Return Value
The Term returns the value, see table below.
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
ComChannel | A handle to the same ComChannel for a given ComInterface. |
Properties
Name | Data Type | Class | Default | Cardinality | Description | ||||||||||
comInterface | ComInterface | Term | - | [1..1] | This element identifies the communication interface. | ||||||||||
identifier | String | Term | - | [1..1] | This element represents a string identifying the communication channel, which will be created.
| ||||||||||
ecuVariantName | String | Term | - | [0..1] | This optional element allows an OTX sequence to explicitly specify a particular ECU variant that the ComChannel will be associated with. It is provided in addition to the identifier attribute based on the assumption that the ComChannel identifier specifies a connection to a base variant of an ECU, the precise variant of which then can be implicitly or explicitly identified by the diagnostic application (compare the performVariantSelection element in this clause and the IdentifyAndSelectVariant action). The ecuVariantName element can be used to directly create a ComChannel to a specific ECU variant without needing to perform the ECU variant identification step.
If the ecuVariantName element is defined, the PerformVariantSelection element will be omitted or set to false.
MCDProject::createLogicalLinkByVariantAndInterfaceResource() will called if the ecuVariantName parameter and the Resource parameter are defined.
| ||||||||||
performVariantSelection | Boolean | Term | False | [0..1] | This optional element can be used by the OTX author to control whether an implicit variant selection will be performed. If performVariantSelection yields true at runtime, the variant selection is done automatically after the ComChannel is created. This standard cannot make assumptions about whether the vehicle communication component used by an OTX runtime supports the concept of ECU variant identification or about the behaviour of the communication component in case it does. The relevant parts of the OTX DiagCom standard are based on the following assumptions: ⎯ A communication channel to an ComInterface is associated with a data set describing diagnostic behaviour of a specific variant of that ECU.
If the PerformVariantSelection element is set to true, the EcuVariantName element must be omitted. | ||||||||||
ressource | String | Term | - | [0..1] | The MVCI communication channel.
|
OTL Examples
/// Local Declarations
ComInterface.ComInterface ComInterface1;
DiagCom.ComChannel ComChannel1;
String String1;
String String2;
String String3;
Boolean Boolean1;
/// Flow
// ... activities another ...
ComInterface.ConnectComInterface(ConInterface1);
ComChannel1 = ComInterface.GetComChannelFromComInterface(ComInterface1, String1, String2, Boolean1, String3);