Extensions.ComInterface.GetComChannelFromComInterface

From emotive
Jump to navigation Jump to search

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.

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 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.
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.
Icons Note.png The appropriate MVCI system operation is MCDProject::createLogicalLinkByNameAndInterface() will called if all optional parameters of this term are not set.
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.

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.

If the ecuVariantName element is defined, the PerformVariantSelection element will be omitted or set to false.

Icons Note.png The related MVCI system methods are MCDProject::createLogicalLinkByVariantAndInterface() will called if only the EcuVariantName parameter is defined.

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

Default.png Default: If this parameter is not transmitted,, no variant selection takes place.
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.
⎯ The vehicle communication component is able to explicitly perform an ECU variant identification operation on a communication channel to an ECU.
⎯ The required logic and data for performing the variant identification is intrinsic to the vehicle communication component, i.e. there is no additional external information required for the communication component to perform the ECU variant identification.
⎯ After an ECU variant has been identified, the vehicle communication component is able to explicitly associate the communication channel to that ECU with the specific data set for that ECU variant, effectively switching the communication channel from the old variant data set to a new one.
⎯ The IdentifyAndSelectVariant action tells the runtime system to perform the variant identification operation on the provided communication channel and then switch the data set associated with that channel to the one fitting the newly identified variant (if any).
⎯ The diag: GetComChannel term tells the runtime system to create a new communication channel, immediately perform the variant identification operation on the new communication channel and then switch the data set associated with that channel to the one fitting the newly identified variant (if any).

Icons Note.png In case an ODX/MVCI system is used, the exact semantics of Variant Identification and Selection are specified by the ISO ODX and MVCI standards.

If the PerformVariantSelection element is set to true, the EcuVariantName element must be omitted.

Icons Note.png The appropriate MVCI system operations are MCDProject::createLogicalLinkByNameAndInterface() will called if all optional parameters of this term are not set.

MCDProject::createLogicalLinkByNameAndInterfaceResource() will called if only the Resource parameter is defined.
MCDLogicalLink::gotoOnline()
MCDLogicalLink::open()
MCDLogicalLink Control Primitive MCDStartCommunication
MCDLogicalLink Control Primitive
MCDVariantIdentificationAndSelection

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;
	Boolean Boolean1;

	/// Flow

	// ... activities another ...

	ComInterface.ConnectComInterface(ConInterface1);
	ComChannel1 = ComInterface.GetComChannelFromComInterface(ComInterface1, String1, String2, Boolean1, String3);

See also

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