Extensions.ComInterface.CreateComChannelFromComInterface

From emotive
Jump to navigation Jump to search

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.

Exclamation.png Important: The channel is created at the time this term is executed.
Exclamation.png Important: If the ComChannel already exists, the state of the diag:ComChannel will not be changed by this term.
Exclamation.png 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.

Icons Note.png The appropriate MVCI system operation is MCDProject::createLogicalLink.

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
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.
Icons Note.png In case a MVCI/ODX system is used the identifier specifies the SHORT-NAME of the MCDLogicalLink to be used for communication.
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 <ecuVariantName> element can be used to directly create a ComChannel to a specific ECU variant without needing to perform the ECU variant identification step.

Icons Note.png In case a MVCI/ODX system is used the <ecuVariantName> element specifies the SHORT-NAME of the MCDDbEcuVariant to be associated with the logical link.
ressource String Term - [0..1] The MVCI communication channel.
Icons Note.png The related MVCI system methods are MCDProject::createLogicalLinkByNameAndInterfaceResource() will called if only the Resource parameter is defined.

MCDProject::createLogicalLinkByVariantAndInterfaceResource() will called if the EcuVariantName parameter and the Resource parameter are defined.

Default.png Default: the standard resource selected by runtime system.

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);

See also

CloseComInterface
ConnectComInterface
DeactivateEthernet
GetBatteryVoltageFromComInterface
GetComChannelFromComInterface
GetComInterface
GetComInterfaceNameListFromEthernet
GetComInterfaceProperties
GetComInterfaceResourceNameList
GetIgnitionStateFromComInterface
IsEthernetActivated
IsInterfaceConnected
GetComInterfaceNameList
GetDefaultComInterfaceName