Open Diagnostic on LIN.vi

Automotive Diagnostic Command Set Toolkit Help

Edition Date: November 2018

Part Number: 372140J-01

»View Product Info
Download Help (Windows Only)

Purpose

Opens a diagnostic session on an NI-XNET LIN port. Communication to the ECU is not yet started.

Format

diagram

Input

stringInterface specifies the LIN interface on which the diagnostic communication should take place, and points to the corresponding database cluster. The values for the XNET hardware interface names are LIN1, LIN2, and so on.

The Automotive Diagnostic Command Set supports NI-XNET LIN devices for LIN communication only. To use your NI-XNET interface, define your interface under NI-XNET Devices in MAX and pass the NI-XNET interface name that the Automotive Diagnostic Command Set will use. To do this, add @nixnet to the protocol string (for example, LIN1@nixnet). The interface name is related to the NI-XNET hardware naming under Devices and Interfaces in MAX.

The Automotive Diagnostic Command Set requires valid assignments to a LIN database such as LDF or FIBEX. To communicate with hardware products on the external network, applications must understand how that hardware communicates in the actual embedded system, such as the vehicle. This embedded communication is described within a standardized file, such as FIBEX (.xml) or LDF (.ldf) for LIN. Within NI-XNET, this file is referred to as a database. The database contains many object classes, each of which describes a distinct entity in the embedded system.

For LIN, select a LIN database and cluster to assign all settings from the selected cluster automatically, such as the LIN Baudrate, Master Request Frame, Slave Response Frame, or LIN Diagnostic Schedule.

Using NI-XNET hardware, the Interface string should look like the following examples:
  • LIN1@nixnet:XNET_LIN_Database—Uses LIN interface 1 of an NI-XNET device and assigns properties such as baudrate automatically from the XNET alias XNET_LIN_Database.
  • LIN2@nixnet:XNET_LIN_Database—Uses LIN interface 2 of an NI-XNET device and so on, with the form LINx.
Refer to the NI-XNET Hardware and Software Manual to assign a database cluster alias.
stringMasterReqFrame selects the Master Request Frame from an LDF or FIBEX database. If you assign an empty string (default) as MasterReqFrame, the name as defined in the LIN MasterReq standard is used.
stringSlaveRespFrame selects the Slave Response Frame from an LDF or FIBEX database. If you assign an empty string (default) as SlaveRespFrame, the name as defined in the LIN SlaveResp standard is used.
long unsigned integerBaud Rate is the diagnostic communication baud rate. The default is –1, which reuses the baudrate of the selected LIN cluster from the assigned FIBEX or LDF database. To change the baudrate from the database, select a valid LIN baudrate.
byte unsigned integerNAD is the address of the slave node being addressed in a request. NAD also indicates the source of a response. NAD values are 1–127 (0x7F), while 0 (zero) and 128 (0x80)–255 (0xFF) are reserved for other purposes.
cluster error in is a cluster that describes error conditions occurring before the VI executes. If an error has already occurred, the VI returns the value of the error in cluster to error out.
boolean status is TRUE if an error occurred. This VI is not executed when status is TRUE.
long signed integer code is the error code number identifying an error. A value of 0 means success. A negative value means error: the VI did not execute the intended operation. A positive value means warning: the VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
string source identifies the VI where the error occurred.

Output

numeric clusterDiag Ref Out is a cluster containing all necessary information about the diagnostic session. Wire this output as a handle to all subsequent diagnostic VIs, and close it using Close Diagnostic.vi.
cluster error out describes error conditions. If the error in cluster indicated an error, the error out cluster contains the same information. Otherwise, error out describes the error status of this VI.
boolean status is TRUE if an error occurred.
long signed integer code is the error code number identifying an error. A value of 0 means success. A negative value means error: the VI did not execute the intended operation. A positive value means warning: the VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
string source identifies the VI where the error occurred.

Description

Open Diagnostic on LIN.vi opens a diagnostic LIN communication channel to an ECU. The LIN port specified as input is initialized, and a handle to it is stored (among other internal data) in the diag ref out cluster, which serves as reference for further diagnostic functions.

A possible example of selections for the interface parameter for the NI-XNET hardware targets is:

  • LIN1@nixnet:[LIN Cluster]—Uses LIN interface 1 of an NI-XNET device and settings of the LIN database of [LIN Cluster] alias as defined by NI-XNET.
Note Note  No communication to the ECU takes place at this point. To open a diagnostic session on the ECU, call StartDiagnosticSession.vi or UDS DiagnosticSessionControl.vi. Open Diagnostic on LIN.vi supports only NI-XNET LIN hardware. A valid LIN cluster of a LDF or FIBEX database must be assigned also.

WAS THIS ARTICLE HELPFUL?

Not Helpful