ECU Measurement and Calibration Toolkit C API Reference

Content Type
Programming Language
Current manual
Table of Contents

MC Set Property.vi

MC Set Property.vi

Purpose

Sets a property for the specified A2L database file, Measurement Task or Characteristic referenced by the reference in terminal. The poly VI selection determines the property to set.

Format

diagram

Input

string Name is not used, and can be left unwired. This parameter may be used for further extensions.
long unsigned integer Reference in specifies a valid task handle depending on the information which has to be set. If a generic property has to be set, a db ref handle is needed. If a Measurement property has to be set, a valid DAQ ref handle has to be wired into reference in. If an ECU property has to be set, a valid ECU ref handle has to be wired into reference in.
polymorphic Value is a poly output value that specifies the property value. You select the property to set as value by selecting the poly VI type. The data type of value is also determined by the poly VI selection. For information about the different properties provided by MC Set Property.vi, refer to the Poly VI Types section. To select the property, right-click the VI, go to Select Type, and select the property by name.
cluster Error in is a cluster which 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 unsigned integer code is the error code number identifying an error. A value of 0 means success. A negative value means error: VI did not execute the intended operation. A positive value means warning: 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

long unsigned integer Reference out is a copy of the reference in terminal which can be wired through subsequent ECU M&C VIs.
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: VI did not execute the intended operation. A positive value means warning: 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

There are four types of properties which can be modified in the poly input value: ECU-specific properties, DAQ-specific properties, Characteristic-specific properties, and Measurement-specific properties.

ECU-Specific Properties

ECU-specific properties relate to the setting of the ECU. If you need to change a property of the ECU you need a valid ECU reference, but the ECU should not be connected. First, call MC ECU Open.vi, followed by MC Set Property.vi and then MC ECU Connect.vi. If you have already connected to the ECU, you can change an ECU property by calling MC ECU Disconnect.vi, followed by MC Set Property.vi, and then MC ECU Connect.vi again. Refer to the ECU-Specific Properties table below for a list of ECU-specific properties that can be used to define the poly input value.

DAQ-Specific Properties

You cannot set a property while the task is running. If you need to change a property prior to starting the task, call MC DAQ Initialize.vi, followed by MC Set Property.vi and then MC DAQ Start Stop.vi. After you start the task, you also can change a property by calling MC DAQ Start Stop.vi, followed by MC Set Property.vi, and then restart the task with MC DAQ Start Stop.vi. Refer to the DAQ-specific Properties table for a list of DAQ-specific properties that can be used to define the poly input value.

Poly VI Types

ECU-Specific Properties

TypeHierarchySub-HierarchyParameterDescription
Sub 1Sub 2
long unsigned integerECUCCPCRO IdSets the CRO ID, which is used to send commands and data from the host to the slave device. If bit 31 (hex 0x80000000) of the value is set, the value is considered an extended CAN identifier (29-bit).
long unsigned integerECUCCPBaud RateSets the Baud Rate used by the CAN interface with CCP protocol. This property applies to all tasks initialized with the Interface. You can specify the following basic baud rates as the numeric rate: 33333, 83333, 100000, 125000, 200000, 250000, 400000, 500000, 800000, and 1000000. You also can specify advanced (custom) baud rates depending on the interface type. Refer to the NI-XNET or NI-CAN Help for more information.
booleanECUCCPTerminationFor all XNET devices, the termination is software selectable. XNET provides the option of 120 Ω between Bus Plus and Bus Minus or no termination. The Termination property configures the onboard termination of the NI-XNET interface CAN connector (port). The Boolean property supports two values: TRUE = Termination ON and FALSE = Termination Off. However, different CAN or LIN hardware has different termination requirements, and the termination values have different meanings. Refer to the Termination attribute in the XNET API for more details. (This property is supported for NI-XNET devices only.)
long unsigned integerECUCCPStation AddressSets the Station Address of the slave device. CCP is based on the idea that several ECUs can share the same CAN Arbitration IDs for CCP communication. To avoid communication conflicts, CCP defines a Station Address that has to be unique for all ECUs sharing the same CAN Arbitration IDs. Unless an ECU has been addressed by its Station Address, the ECU must not react to CCP commands sent by the CCP master.
stringECUCCPSeedKey Cal NameSets the filename of the SeedKey DLL used for Calibration purposes. For Remote Seedkey access (refer to the LabVIEW examples), set the name to RSK:<server ip address>,<port>.
stringECUCCPSeedKey DAQ NameSets the filename of the SeedKey DLL used for DAQ purposes. For Remote Seedkey access (refer to the LabVIEW examples), set the name to RSK:<server ip address>,<port>.
stringECUCCPSeedKey Prog NameSets the filename of the SeedKey DLL used for programming purposes. For Remote Seedkey access (refer to the LabVIEW examples), set the name to RSK:<server ip address>,<port>.
long unsigned integerECUCCPDTO IdSets the DTO ID, which is the CAN identifier for the Data Transmission Object (DTO). The DTO is used by the CCP slave devices to return data and status information to the application. If bit 31 (hex 0x80000000) of the value is set, the value is considered an extended CAN identifier (29-bit).
byte unsigned integerECUCCPMaster IdSets the identifier of the CCP master that is used by the CCP command EXCHANGE_ID as a parameter. This ID information is optional and specific to the ECU implementation. For more information about the CCP master ID, refer to the documentation for the ECU.
booleanECUCCPSingle Byte DAQ List?Sets the ECU to support single-byte or multi-byte DAQ list entries.
booleanECUCCPOptional CommandsCLEAR MEMORYSets whether the ECU supports the optional ASAM CCP Command CLEAR_MEMORY.
booleanECUCCPOptional CommandsDNLOAD 6Sets whether the ECU supports the optional ASAM CCP Command DNLOAD_6.
booleanECUCCPOptional CommandsSHORT UPSets whether the ECU supports the optional ASAM CCP Command SHORT_UP.
booleanECUCCPOptional CommandsPROGRAMSets whether the ECU supports the optional ASAM CCP Command PROGRAM.
booleanECUCCPOptional CommandsPROGRAM 6Sets whether the ECU supports the optional ASAM CCP Command PROGRAM_6.
booleanECUCCPOptional CommandsMOVESets whether the ECU supports the optional ASAM CCP Command MOVE.
booleanECUCCPOptional CommandsBUILD CHKSUMSets whether the ECU supports the optional ASAM CCP Command BUILD_CHKSUM.
booleanECUCCPOptional CommandsGET ACTIVE CAL PAGESets whether the ECU supports the optional ASAM CCP Command GET_ACTIVE_CAL_ PAGE.
booleanECUCCPOptional CommandsSELECT CAL PAGESets whether the ECU supports the optional ASAM CCP Command SELECT_CAL_PAGE.
booleanECUCCPOptional CommandsGET S STATUSSets whether the ECU supports the optional ASAM CCP Command GET_S_STATUS.
booleanECUCCPOptional CommandsSET S STATUSSets whether the ECU supports the optional ASAM CCP Command SET_S_STATUS.
booleanECUCCPOptional CommandsGET SEEDSets whether the ECU supports the optional ASAM CCP Command GET_SEED.
booleanECUCCPOptional CommandsUNLOCKSets whether the ECU supports the optional ASAM CCP Command UNLOCK.
booleanECUCCPOptional CommandsSTART STOP ALLSets whether the ECU supports the optional ASAM CCP Command START_STOP_ALL.
booleanECUCCPOptional CommandsTESTSets whether the ECU supports the optional ASAM CCP Command TEST.
booleanECUCCPOptional CommandsACTION SERVICESets whether the ECU supports the optional ASAM CCP Command ACTION_SERVICE.
booleanECUCCPOptional CommandsDIAG SERVICESets whether the ECU supports the optional ASAM CCP Command DIAG_SERVICE.
booleanECUCCPMiscSkip EXCHANGE IDSets whether or not the CCP command EXCHANGE_ID should be suppressed during connection to the ECU.
long unsigned integerECUCCPTimeoutT_stdSets the timeout value (in milliseconds) for most of the CCP commands. For details of which timeout applies to a specific command, refer to the CCP standard. Default: 40. Standard: 25. The default is chosen slightly higher to allow for slower ECUs.

Note that the Timing Factor property may modify this value.
long unsigned integerECUCCPTimeoutT_pgmSets the timeout value (in milliseconds) for the CCP programming commands. For details of which timeout applies to a specific command, refer to the CCP standard. Default: 120. Standard: 100. The default is chosen slightly higher to allow for slower ECUs.

Note that the Timing Factor property may modify this value.
long unsigned integerECUCCPTimeoutT_memSets the timeout value (in milliseconds) for the CCP memory commands. For details of which timeout applies to a specific command, refer to the CCP standard. Default and Standard: 30000.

Note that the Timing Factor property may modify this value.
long unsigned integerECUCCPTimeoutT_diagSets the timeout value (in milliseconds) for the CCP DIAG_SERVICE command. Default and Standard: 500.

Note that the Timing Factor property may modify this value.
long unsigned integerECUCCPTimeoutT_actSets the timeout value (in milliseconds) for the CCP ACTION_SERVICE command. Default: 500. Standard: 5000.

Note that the Timing Factor property may modify this value.
long unsigned integerECUXCPCANDTO IdSets the DTO ID, which is used by the ECU to respond to XCP commands and to send data and status information to the XCP master. If bit 31 (hex 0x80000000) of the value is set, the value is considered an extended CAN identifier (29-bit).
long unsigned integerECUXCPCANCRO IdSets the CRO ID, which is used to send commands and data from the host to the slave device. If bit 31 (hex 0x80000000) of the value is set, the value is considered an extended CAN identifier (29-bit).
long unsigned integerECUXCPCANBaud RateThis is a legacy property and should no longer be used. Use the ECU:XCP:CAN:Baud Rate 64 instead.
quad unsigned integerECUXCPCANBaud Rate 64Sets the baud rate used by the CAN Interface with XCP protocol. Basic baud rates such as 125000 and 500000 are specified as numeric values. Advanced (or custom) baud rates are specific to the CAN interface in use. You can find the documentation for the NI-XNET custom baud rate in NI-XNET Hardware and Software Help under Interface:64bit Baud Rate.

The default value for the property is the baud rate value defined by the XCP_ON_CAN declaration within the A2L database, including the indicated sampling point.

You can read that value using MC Get Property.vi.

quad unsigned integerECUXCPCANFD Baud Rate 64Sets the CAN FD baud rate value (used for the data part of transmission).

If CAN FD is used, Baud Rate 64 specifies the baud rate for the arbitration part of the CAN message, while this property (Baud Rate 64) specifies the baud rate for the data part of the CAN message.

Basic baud rates such as 500000 and 2000000 are specified as numeric values. Information about the advanced (or custom) baud rates can be found in the NI-XNET Hardware and Software Help under Interface:CAN:64bit FD Baud Rate

The default value for the property is the baud rate set in the CAN_FD section of the A2L database used for the application, including the defined sampling point. Transceiver Delay Compensation defined by the A2L is not used while calculating the custom baud rate value, as the value is specific to hardware implementation and the value found in the database may not match the NI-XNET specification.

You can read the current value using MC Get Property.vi

long unsigned integerECUXCPCANCAN I/O ModeSets the CAN I/O mode property.

Determines whether an XNET interface is running in CAN 2.0 mode (supports frames with payload up to 8 bytes), CAN FD mode (supports frames up to 64 bytes), or CAN FD+BRS mode (CAN FD with baud rate switching). CAN I/O Mode is only supported with XNET interfaces.

The default value is determined by the A2L database used by the application. The user can change the mode using this property to overwrite the mode set in the A2L database.

Valid values are CAN, CAN_FD, CAN_FD+BRS, and ECU Determined. The A2L database supports only CAN and CAN FD+BRS modes. You can also read the I/O Mode property using MC Get Property.vi

In ECU Determined mode, the master can communicate with ECUs using either traditional CAN or CAN FD frames. The master starts the communication with a traditional CAN 2.0 frame; if the ECU responds in any mode, this mode is selected for further communication. If the ECU does not respond to the CAN 2.0 frame, the master repeats (after timeout) the first command using a CAN FD frame. In ECU Determined mode, the NI-XNET interface runs in CAN FD BRS mode, so the CAN FD baud rate must be set before using this mode. In CAN FD+BRS mode, the NI-XNET interface can receive and transmit CAN 2.0, CAN FD, and CAN FD+BRS frames.

0CAN 2.0
1CAN FD
2CAN FD+BRS
3ECU Determined
Note Note  CAN FD is only supported with NI-XNET version 17.0.1 or later.
booleanECUXCPCANUse CAN Max DLCSets the Use CAN Max DLC property value.

This property determines if the master in CAN 2.0 mode transmits frames with the actual used payload length or if it always transmits the maximum number of bytes (8 bytes).

The default value of this property is retrieved from the A2L database based on the MAX_DLC_REQUIRED keyword within the XCP_ON_CAN section.

long unsigned integerECUXCPCANCAN FD Max DLCDetermines the number of bytes transmitted by the master when the property ECU:XCP:CAN:Use CAN FD Max DLC is set to TRUE.

The default value of this property is retrieved from the A2L database based on the MAX_DLC keyword within the CAN_FD section.

The max value of this property is 64.

booleanECUXCPCANUse CAN FD Max DLCDetermines if the master in CAN FD mode transmits frames with the actual used payload length or if it always transmits the maximum number of bytes, defined by the ECU:XCP:CAN FD Max DLC setting (8…64 bytes).

The default value of this Boolean property is being retrieved from the A2L database based on the MAX_DLC_REQUIRED keyword within the CAN_FD section.

booleanECUXCPCANTerminationFor all XNET devices, the termination is software selectable. XNET provides the option of 120 Ω between Bus Plus and Bus Minus or no termination. The Termination property configures the onboard termination of the NI-XNET interface CAN or LIN connector (port). The Boolean property supports two values: TRUE = Termination ON and FALSE = Termination Off. However, different CAN or LIN hardware has different termination requirements, and the termination values have different meanings. Refer to the Termination attribute in the XNET API for more details. (This property is supported for NI-XNET devices only.)
stringECUXCPEthernetIP AddressSets the IP address of the slave device. A slave device connected by Ethernet and TCP/IP or UDP/IP protocol is addressed by its IP Address and Port number.
word unsigned integerECUXCPEthernetIP PortSets the IP Port number of the slave device. A slave device connected by Ethernet and TCP/IP or UDP/IP protocol is addressed by its IP Address and Port number.
stringECUXCPEthernetIP Source AddressSets the IP address of the host Ethernet interface. Use this property if your system has more than one Ethernet interface and you want to use a non-primary interface. Empty string (default) indicates using of the primary interface.
word unsigned integerECUXCPEthernetIP Source PortSets the source port (XCP master port) used for Ethernet communication. The default value is -1, which indicates that the source port will be chosen by the operating system. Valid port values are 0 to 65535. Note that port 0 is reserved and typically should not be used.
stringECUXCPEthernetIP XNET Stack NameSets the name of the XNET IP Stack for this session. The XNET IP stack must already exist. Refer to NI-XNET Hardware and Software Help for information about creating and configuring an XNET IP stack. You can directly use the XNET IP stack reference wire. If this parameter is empty string (default), the native operating system IP stack will be used.
stringECUXCPEthernetIP XNET Local InterfaceSets the name of the local interface used with the specified XNET IP Stack for this session; the XNET IP stack can contain multiple virtual interfaces. Refer to NI-XNET Hardware and Software Help for more information on this parameter. This property is ignored for the native operating system IP stack.
stringECUXCPTransport Layer InstanceSets the transport layer instance. Empty string will select either a single unnamed transport layer instance in the IF_DATA XCPplus or XCP block. Use MC Get Names.vi to identify valid values.

Note that setting this property triggers a reinitialization. Most properties will be reverted to the default values read from the database. This property cannot be set while there is an active connection to the ECU.

stringECUXCPSeedKey DllSets the file name of the XCP SeedKey DLL. For Remote Seedkey access (refer to the LabVIEW examples), set the name to RSK:<server ip address>,<port>.
byte unsigned integerECUXCPCompression MethodSets the selected compression method used for MC Program.vi.

0—data is uncompressed.

0x80...0xFF—User defined.

byte unsigned integerECUXCPEncryption MethodSets the selected encryption method used for MC Program.vi.

0—data is not encrypted.

0x80...0xFF—User defined.

byte unsigned integerECUXCPProgramming MethodSets the selected programming method used for MC Program.vi.

0—Sequential programming.

0x80...0xFF—User defined.

byte unsigned integerECUXCPAccess MethodSets the selected access mode:

0x00—Absolute Access Mode (default). The MTA uses physical addresses.

0x01—Functional Access Mode. The MTA functions as a block sequence number of the new flash content file.

0x80...0xFF—User defined. It is possible to use different access modes for clearing and programming.

booleanECUXCPMeas Split AllowedSets the Meas Split Allowed property value.

For measurements in DAQ List mode, the master creates DAQ lists which determine frames with data transmitted by the ECU. The first byte in this frame (ODT) is a PID identifier, the remaining bytes in the frames are used for measurement data (e.g. with CAN 2.0, 7 bytes can be used for data).

Depending on the type of measurement data, not all bytes of frames can be used. For example, measuring seven 32-bit values in the ECU requires transmitting seven frames per sampling point as only one 4-byte value can be placed in one frame. The remaining 3 bytes are unused.

The Meas Split Allowed property allows splitting the measurements across CAN frames, so the seven values can be packed into only four frames (4 frames * 7 bytes = 28 data bytes for DAQ data).

The default value for the property is read from the A2L database (keyword MEASUREMENT_SPLIT_ALLOWED within the XCP_ON_CAN block).

NoteCaution  You can only use this feature when the ECU guarantees the value consistency across ODTs (frames), otherwise you might receive unexpected values.
long unsigned integerECUXCPTimeoutT1,
T2,
T3,
T4,
T5,
T6,
T7
Sets one of the seven timeout values (in milliseconds) defined in the XCP standard for the various XCP commands. For details of which timeout applies to a specific command, refer to the XCP standard. The values are typically read from an A2L file but may be overridden manually.

Note that the Timing Factor property may modify this value.
long unsigned integerECUByte OrderSets the Byte Order of the CCP slave device.

0—MSB_LAST

The CCP slave device uses the MSB_LAST (Intel) byte ordering.

1—MSB_FIRST

The CCP slave device uses the MSB_FIRST (Motorola) byte ordering.

long unsigned integerECUCommand Byte OrderSets the Byte Order of the XCP or CCP commands.

0—MSB_LAST

The CCP slave device uses the MSB_LAST (Intel) byte ordering.

1—MSB_FIRST

The CCP slave device uses the MSB_FIRST (Motorola) byte ordering.

stringECUSeedkey/Checksum DLL PathThis property determines the directory where the ECU M&C Toolkit expects to find the Seedkey or Checksum DLL. If the property is an empty string (default), the ECU M&C Toolkit expects the DLLs in the same directory as the A2L file. If your DLLs are in a different directory, set this property pointing to this directory.
stringECUChecksum DLL NameSets the file name of the Checksum DLL used for verifying the checksum.
file pathECULogfile PathSets a filename (full path) where the XCP or CCP protocol traffic is logged in ASCII format for debugging purposes. Setting this parameter to an empty path disables logging (default). Note that on RT and cRIO systems, the logfile is created on the target system and must be transferred to the host after logging has been completed.

Note that no additional CAN port is used for the logging, which makes this method superior to any other method such as running a bus monitor parallel.
16-bit integerECUMappingModeAddress mapping mode to be used when accessing the ECU memory by addresses.
0No Mapping: Original addresses from the A2L database are used.
1Defined Pages: This mode requires setting the source and target pages. The memory pages are defined in the A2L database in the DEFINED_PAGES section. The source and target pages can be set either by the page name or by the logical page number (the last Set Property call defines the page).

If the original address takes place within the source page, it will be re-mapped to the target page with the same offset to the beginning of the page.

2ADDR_MAPPING: Use address mapping defined in the A2L database in the ADDR_MAPPING section.
stringECUMappingSource NameName of the source page to be used for the address mapping in Defined Pages mode.
16-bit integerECUMappingSourceLogical page number of the source page to be used for the address mapping in Defined Pages mode.
stringECUMappingTarget NameName of the target page to be used for the address mapping in Defined Pages mode.
16-bit integerECUMappingTargetLogical page number of the target page to be used for the address mapping in Defined Pages mode.
long unsigned integerECUMiscTiming FactorSets the timing factor to increase the XCP or CCP Command timeouts by this value. For details on the default Command Timeout values, refer to the XCP or CCP Protocol Specification.

Measurement-Specific Properties

TypeHierarchySub-HierarchyParameterDescription
Sub 1Sub 2
long unsigned integerMeasurementByte OrderSets the specified byte order of the selected Measurement:

0—Intel format

Bytes are in little-endian order, with least-significant bit first.

1—Motorola format

Bytes are in big-endian order, with most-significant bit first.

Characteristic-Specific Properties

TypeHierarchySub-HierarchyParameterDescription
Sub 1Sub 2
long unsigned integerCharacteristicByte OrderSets the specified byte order of the entire Characteristic:

0—Intel format

Bytes are in little-endian order, with least-significant bit first.

1—Motorola format

Bytes are in big-endian order, with most-significant bit first.

1D arrayCharacteristicX AxisSets the X-axis values on which the Characteristic is defined. The Characteristic dimension must be at least 1.
1D arrayCharacteristicY AxisSets the Y-axis values on which the Characteristic is defined. The Characteristic dimension must be 2.

DAQ-Specific Properties

TypeHierarchySub-HierarchyParameterDescription
Sub 1Sub 2
long unsigned integerDAQModeSets the selected I/O mode for the M&C Measurement task.

0—DAQ List

The data is transmitted from the ECU in equidistant time intervals as defined in the A2L database. The data can be read back with the MC DAQ Read.vi as Single point data using sample rate = 0, or as a waveform using a sample rate > 0. Input channel data is received from the DAQ messages. Use MC DAQ Read.vi to obtain input samples as single-point, array, or waveform.

1—Polling

In this mode the data from the Measurement task is uploaded from the ECU whenever MC DAQ Read.vi is called.

double-precision, floating-pointDAQSampleRateSampleRate specifies the timing to use for the samples of the (NI-CAN) task. The sample rate is specified in Hertz (samples per second). A sample rate of zero means to sample immediately.

For a DAQMode of mcDAQModeDAQList, SampleRate of zero means that MC DAQ Read.vi returns a single sample from the most recent messages received, and greater than zero means that MC DAQ Read.vi returns samples timed at the specified rate. For DAQMode of mcDAQModePolling, SampleRate is ignored.

stringDAQEvent Channel NameSets the event channel name to which the Measurement task is assigned. If there is no event channel name defined in the A2L file, you can set the Event Channel Number manually by passing a decimal number as a string.
word unsigned integerDAQPrescalerSets the prescaling factor, which reduces the desired transmission frequency of the associated DAQ list.
long unsigned integerDAQCCPDTO IdSets the DTO ID, which is used by the ECU to send DAQ list data to the CCP master. If bit 31 (hex 0x80000000) of the value is set, the value is considered an extended CAN identifier (29-bit).
long unsigned integerDAQXCPTiming SourceSets the DAQ Timing Source property value. The default is Automatic.

NoteNote  The Timing Source property is only supported with XCP protocol.

Values are:

0Automatic

The default method (1, 2, or 3, below) is selected.

1Host Timing

Timestamps are generated from the host system time whenever a frame arrives.

This mode is always available.

This is the default for XCP on TCP/UDP if the ECU does not support timestamps.

2CAN Timing

Timestamps are generated from the network interface hardware (e.g. NI-XNET hardware).

This mode is available only if the network hardware generates timestamps.

This is the default for XCP on CAN if the ECU does not support timestamps.

3ECU Timing

Timestamps are taken from the ECU data. The Start Time is taken from the host, and increments are taken from the ECU.

This mode is only available if the ECU generates timestamps; in this case, it is default.

Was this information helpful?