Difference between revisions of "Extensions.ComInterface.CreateComChannelFromComInterface"
(Created by Ngoc Tran.) |
(→OTL Examples: Edited by Ngoc Tran.) |
||
Line 38: | Line 38: | ||
/// Local Declarations | /// Local Declarations | ||
− | ComInterface ComInterface1; | + | ComInterface.ComInterface ComInterface1; |
DiagCom.ComChannel ComChannel1; | DiagCom.ComChannel ComChannel1; | ||
String String1; | String String1; | ||
Line 49: | Line 49: | ||
ComInterface.ConnectComInterface(ConInterface1); | ComInterface.ConnectComInterface(ConInterface1); | ||
− | ComChannel1 = ComInterface.CreateComChannelFromComInterface( | + | ComChannel1 = ComInterface.CreateComChannelFromComInterface(ComInterface1, String1, String2, String3); |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== See also == | == See also == |
Latest revision as of 10:54, 11 October 2019
Contents
Classification
Name | CreateComChannelFromComInterface |
Short Description | Create a communication channel to an ECU on the specified communication interface. |
Class | Term |
Extension | OTX ComInterface extension |
Group | ComInterface related Terms |
Exceptions | LossOfComException UnknownTargetException |
Checker Rules | |
Standard Compliant | Yes |
OTL Syntax
ComChannelTerm ComInterface.CreateComChannelFromComInterface(ComInterfaceTerm comInterface, StringTerm identifier, StringTerm ecuVariantName, String ressource);
Description
This term will create a communication channel to an ECU on the specified communication interface. The term is needed, because the diagComPlus:GetComChannelFromInterface term does not guarantee, that the communication is not started. For exchangeability the usage of this term is recommended instead of diagComPlus:GetComChannelFromInterface, if the user wants to set communication parameters before starting communication.
![]() |
Important: The channel is created at the time this term is executed. |
![]() |
Important: If the ComChannel already exists, the state of the diag:ComChannel will not be changed by this term. |
![]() |
Important: In case an ODX/MVCI system is used, a StartCommunication on the logical link is not executed. In this case the logical link state is ONLINE. |
The term CreateComChannelFromInterface will always return a handle to the same ComChannel for a given ECU. It is possible to manually control the lifecycle of a ComChannel object by closing a ComChannel handle using the diag: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 appropriate MVCI system operation is MCDProject::createLogicalLink.
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 ECU. |
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.
| |||||||
ressource | String | Term | - | [0..1] | The MVCI communication channel.
MCDProject::createLogicalLinkByVariantAndInterfaceResource() will called if the EcuVariantName parameter and the Resource parameter are defined.
|
OTL Examples
/// Local Declarations
ComInterface.ComInterface ComInterface1;
DiagCom.ComChannel ComChannel1;
String String1;
String String2;
String String3;
/// Flow
// ... activities another ...
ComInterface.ConnectComInterface(ConInterface1);
ComChannel1 = ComInterface.CreateComChannelFromComInterface(ComInterface1, String1, String2, String3);