Home

ECU Measurement and Calibration Toolkit User Manual

image

Contents

1. Extension Extension contains the extension part of the address DataType DataType sets the data type of the measurement task DataType Data Format Unsigned byte Signed byte Unsigned word Signed word Unsigned long Signed long Float 32 nun FF WN KF O National Instruments Corporation 6 85 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C DataSize Sets the size of the measurement data and corresponds to the selected DataType Data Format DataSize Unsigned byte Signed byte Unsigned word 1 1 2 Signed word 2 4 4 Unsigned long Signed long Float 32 4 ConversionName ConversionName identifies the referred conversion object that mcConversionCreate defines Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description Use mcMeasurementCreate to create a measurement object in memory instead of referring to a predefined measurement in the A2L database ECU M amp C Toolkit User Manual 6 86 ni com Chapter 6 ECU M amp C API for C
2. Purpose Retrieves the current status of the Calibration Session CCP only Format mcTypeStatus mcCCPGetSessionStatus mcTypeTaskRef ECURefNum u8 SessionStatus u8 StatusQualifier u8 AdditionalStatus Input ECURefNum ECURe fNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Output SessionStatus The current SessionStatus which is returned from the ECU StatusQualifier The additional StatusQualifier is manufacturer and or project specific and is not part of the CCP protocol specification AdditionalStatus If the StatusQualifier does not contain additional status information AdditionalStatus must be set to FALSE If AdditionalStatus is not FALSE it may be used to determine the type of the additional status information Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcCCPGetSessionStatus retrieves the current calibration session status of the ECU The return value SessionStatus is a bit mask that represents
3. mcMeasurementRead Purpose Reads a single Measurement value from the ECU Format mcTypeStatus mcMeasurementRead mcTypeTaskRef ECURefNum char MeasurementName 64 Value Input ECURef Num ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx MeasurementName MeasurementName is the name of a Measurement channel stored in the A2L database file from which a Measurement value is to be read Output Value Returns a single sample for the Measurement channel initialized in MeasurementName Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcMeasurementRead performs a single point read upload of a single Measurement from the selected ECU without opening a Measurement task National Instruments Corporation 6 87 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcMeasurementWrite Purpose Writes a single Measurement value to the ECU Format mcTypeStatus mcMeasurementWrite mcType
4. mcPropDAQ_ EventChannelName u32 mcPropDAQ_ Mode Returns the selected mode of an M amp 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 mcDAQRead as Single point data using sample rate 0 or as waveform using a sample rate gt 0 Input channel data is received from the DAQ messages Use mcDAQRead 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 mcDAQRead is called u32 mcPropDAQ NumChannels Returns the number of channels initialized in a DAQ channel list of a M amp C Measurement task This is the number of array entries required when using mcDAQRead ul6 mcPropDAQ_Prescaler Prescaler for the Measurement task on the ECU f64 mcPropDAQ_SampleRate Returns the selected Sample Rate in Hz for the M amp C Measurement task u32 mcPropDAQ_Samples Returns the number of samples available for Pending read in DAQ tasks defined with sample rate gt 0 If this property is queried before the DAQ list is started it always returns 0 Start the DAQ list first with mcDAQStart Stop before you query this property National Instruments Corporation 6 75 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 4 Values for PropertyID Continued Data
5. c ccccsccccesscccesseceeseeeesseeessneessseeesesseessseeessnesessneeeees 6 23 mcCCharacteristicRead ts i205 wives iii EEE E ew nee 6 25 mecCharacteristicReadSingle Value eee eeceeseeeeceeeeceseeaeeneesaeeeeeseeseees 6 26 mMcCharacteristiC Wit s 3 scshecieesteeciexki esa heel tient Anish 6 28 mecCharacteristic WriteSingle Value eee eee eseeseeeeeeseeeeeeseeseeeeeseeeeaeseeeeaees 6 29 MC Clear MeMOLY iiss haste cistessedeseestecendes ne E A ee ubeusee eevee s Sued R 6 31 mCConversioniCreates s ie s2cscssseige aa alee ene dhl aden 6 32 mcDA QC leat s 1 cited aries Wet es ee SR Sain GI eee hte 3 6 34 McDA Olnitiaht Zs eccl suena tadtintinlas Aviad EE 6 35 MmcDA OListlnirtaliZe se 0 2 e eos season hea ees sec etal 6 38 MCDA QRE Ad sc22se sett Siete Reino heel en ani nase ited 6 40 National Instruments Corporation ix ECU M amp C Toolkit User Manual Contents mcDAQReadTimestamped 00 cece ceececeseceeesseeeeeeseceeeeseeeecseesseeaeesaeeaeenaes 6 43 MCDAQStartS tOp EEE sso sadecceeestecescesegssteseseekestises devas veded cavessageadesesdeheasdpseaveddvees 6 46 MCDAQWte sees iol Meee E eed iste EERE RTE esta hi eh eee 6 48 MCD atabaseClosess ennn a sien Tarea an AEE A E E E RS 6 50 IMCDatabaseOPem isinisisi riiui oe ioen eonia E EEA EREKE EEE 6 51 mcDouble Ko D gt a EREE ET EA 6 52 mMmeDownlo d ios seene e E EAE a EE E E TE E EER 6 54 MECECUCoNieCtsin oan i R E A A EAS 6 56 mcECUCreatecne nei r aeia aair a a et
6. Start Yo 4 y def A C Read Read Read Figure 4 4 Example of Read With Sample Rate 0 National Instruments Corporation 4 11 ECU M amp C Toolkit User Manual Chapter 4 ECU M amp C Toolkit User Manual Using the ECU M amp C API sample rate gt 0 DAQ Read returns an array of samples for every channel in the DAQ Initialize list Each time the clock ticks at the specified rate a sample from the most recent message s is inserted into the arrays In other words the samples are repeated in the array at the specified rate until a new message is received By using the same sample rate with NI DAQ Analog Input channels or NI DAQmx Analog Input channels you can compare ECU DAQ and NI DAQ NI DAQmx samples over time Figure 4 5 shows an example of DAQ Read with a sample rate gt 0 A B and C represent messages for the initialized channels delta t represents the time between samples as specified by the sample rate def represents the default value 0 Start At Lge lt q oe lt gt a gt kt gt i gt a gt kt w lt v lt wD lt O kt O kt O je Figure 4 5 Example of Read With Sample Rate gt 0 DAQ Write If you are using XCP and the DAQ initialize mode is set to STIM list the application
7. Address is a cluster which contains the following values Address specifies the address part of the source address Extension contains the extension part of the source address Block size determines the size of the block for which the checksum must be calculated 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 status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred National Instruments Corporation 5 5 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Type of checksum returns the type of the calculated checksum If you are using the CCP protocol type of checksum is OxFF For XCP refer to the Description section Checksum returns the calculated checksum Error out describes error conditions If the Error in
8. Characteristic X Axis Returns X axis values on which the Characteristic is defined It is valid if the dimension of the selected Characteristic is 1 or 2 Characteristic Y Axis Returns Y axis values on which the Characteristic is defined It is valid if the dimension of the selected Characteristic is 2 Group Is Root Returns whether the selected Group is a root level Group entity National Instruments Corporation 5 111 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Sub Hierarchy Hierarchy Sub 1 Sub 2 Param Description DAQ Event Channel Name Returns the selected event channel name to which the Measurement task is assigned DAQ Mode Returns the selected I O mode for the M amp C Measurement task 0 DAQ List The data is transmitted by the ECU based on an event channel which can be equidistant in time or sporadic 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 gt 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
9. Description This VI implements the CCP SET_S_STATUS command and is used to keep the ECU informed about the current state of the calibration session The session status bits of an ECU can be read and written Possible conditions are reset on power up session log off and in applicable error conditions The calibration session status is organized as a bit mask with the following assignment status is TRUE if an error occurred 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 source identifies the VI where the error occurred Table 5 2 Bit Mask Assignment for Calibration Session Status Bit Name Description 0 CAL Calibration data initialized 1 DAQ DAQ list s initialized 2 RESUME Request to save DAQ set up during shutdown in CCP slave CCP slave automatically restarts DAQ after start up 3 Reserved 4 Reserved 5 Reserved 6 STORE Request to save calibration data during shut down in CCP slave 7 RUN Session in progress ECU M amp C Toolkit User Manual 5 28 ni com Chapter5 ECU M amp C API for LabVIEW MC Characteristic Read vi Purpose Read
10. ECU M amp C Toolkit User Manual 5 112 ni com Chapter 5 Table 5 5 Poly Values for Value Output Continued Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description DAQ Channels Returns the number of channels initialized in a DAQ channel list of a M amp C Measurement task This is the number of array entries required when using MC DAQ Read vi DAQ Prescaler Returns the prescaling factor which is used to reduce the desired transmission frequency of the associated DAQ list DAQ Sample Rate Returns the selected Sample Rate in Hz for the M amp C Measurement task which may be obtained with MC DAQ Initialize vi National Instruments Corporation 5 113 ECU M amp C Toolkit User Manual ECU M amp C API for LabVIEW Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description DAQ Samples Pending Returns the number of samples available to be read using MC DAQ Read vi If you set the number of samples to read input of MC DAQ Read vi to this value DAQ Read returns immediately without waiting This property applies only to tasks initialized with mode of Input and sample rate greater than zero For all other configurations it returns an error If this property is queried before the DAQ list is started
11. Figure 4 3 ECU Measurement Setup Flowchart National Instruments Corporation 4 9 ECU M amp C Toolkit User Manual Chapter 4 ECU M amp C Toolkit User Manual Using the ECU M amp C API DAQ Initialize The DAQ Initialize function initializes a list of Measurement channels as a single Measurement task The communication for that Measurement task is started by the first DAQ Read function The DAQ Initialize function is MC DAQ Initialize vi in LabVIEW or mcDAQInitialize in other languages The DAQ Initialize function uses the following input parameters Measurement list Specifies the list of channels for the task with one string for each channel ECU Reference handle Typically the ECU Reference handle is created by opening the ASAM MCD 2MC database using the ECU Open function then connecting to an ECU using the ECU Connect function Mode Specifies the input mode to use for the task This determines the data transfer for the task Polling DAQ list or STIM list SampleRate Specifies the sampling rate for a specific DAQ list or STIM list The sample rate is specified in Hertz samples per second For more information refer to the DAQ Read section DTO ID If you are using the CCP protocol the DTO ID Data Transmission Object is used by the ECU to respond to CCP commands and to send data and status information to the CCP master DAQ Start Stop The optional function DAQ Start Stop starts or stops
12. source identifies the VI where the error occurred National Instruments Corporation 5 31 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Characteristic 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 Characteristic value returns a single sample for the specified status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC Characteristic Read Single Value vi reads a value from a specified Characteristic on the ECU which is identified by the ECU Reference handle The value to be read is identified by the x and y indices If the Characteristic array has 0 or 1 dimensions y and or x can be left unwired ECU M amp C Toolkit User Manual 5 32 ni com Chapter5 ECU M amp C API for LabVIEW MC Characteristic Write vi Purpose Writ
13. Chapter 3 Application Development Debugging An Application NI 1 0 Trace The NI I O Trace formerly NI Spy tool monitors function calls to the ECU M amp C API to aid in the debugging of an application To launch this tool open the Software branch of the MAX configuration tree right click NI I O Trace and select Launch NI I O Trace If you have more than one National Instruments driver installed on your computer you can specify which APIs you want to monitor at any time By default all installed APIs are enabled To select the APIs to monitor select Tools Options select the View Selection tab and select the desired APIs under Installed API Choices CCP XCP Spy The CCP XCP Spy tool monitors CCP and XCP protocol communication to aid in the debugging of an application Launch this tool from the Start menu in Start Programs National Instruments ECU Measurement and Calibration Toolkit CCP and XCP Spy ECU M amp C Toolkit User Manual 3 6 ni com Chapter 3 Application Development E Logfite xig CCP XCP Sp File View Spy Help 0 d gt 8 2 Ref Protocol Time CCP CCP CCP CCP CCP CCP CCP CCP CCP CCP CCP CCP CCP CCP CCP CCP CCP 0 1 2 3 4 5 6 7 8 9 National Instruments Corporation 14 53 49 442 14 53 49 442 14 53 49 442 14 53 49 442 14 53 49 442 14 53 49 457 14 53 49 457 14 53 49 457 14 53 49 457 14 53 49 457 14 53 49 457 14 53 49 457 14 53 49 457 14 53 49 473 14 53
14. MC Cale Checksum vi Purpose Calculates the checksum of a data block in memory Format ECU ref in ECU ref out data checksum type of checksum error out error in Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Data is a byte array upon which the checksum calculation is performed Type of checksum specifies the kind of checksum which is calculated 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 HE E status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred ECU M amp C Toolkit User Manual 5 8 ni com Chapter5 ECU M amp C API for LabVIEW ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Checksum is the calculated checksum Error out
15. SeedKey DLL slave device identifier Station Address T task reference Glossary Object Descriptor Table A list of elements variables used for organization of data acquisition DAQ PacketID The first byte of a DTO corresponding to the ODT to which the DTO is assigned The values for DAQ list PIDs range from 0x00 OxFD The PIDs OxFE and OxFF are reserved for Event Messages and Command Return Messages A factor defined to allow reduction of the desired transmission rate The prescaler is applied to the Event Channel The prescaler value factor must be greater than or equal to 1 A Dynamic Link Library that implements a function to calculate a key toa given seed to unlock access to ECU resources An ECU specific array of bytes used by the master device to identify the ECU A property which specifies an address to generate a logical point to point connection with a selected slave station for the master slave command protocol One ECU may support several station addresses An identifier returned as an output parameter of Database ECU or Measurement initialization functions National Instruments Corporation G 5 ECU M amp C Toolkit User Manual Index A ECU Connect 4 6 ECU Disconnect 4 7 ECU Open 4 5 Measurement tasks 4 9 Baudrate property 4 6 accessing Characteristics 4 7 activating the ECU toolkit home computer use 2 4 moving software after installation 2 4 online activation 2 4 privacy p
16. Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description After calling mcGetNamesLength you can allocate an array of size SizeofNamesList then pass that array to mcGetNames using the same input parameters This ensures that mcGetNames will return all names without error If using mcGetNamesLength to query the length of the list of supported event channels on an ECU the event channels might be stored inside the ECU instead of the A2L file To query these event channel names from the ECU directly connect to the ECU using mcECUConnect before calling mcGetNamesLength National Instruments Corporation 6 71 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcGetProperty Purpose Retrieves a property of the driver the database the ECU a Characteristic a Measurement or a Measurement task Format mcTypeStatus mcGet Property mcTypeTaskRef RefNum cstr Name u32 PropertyID u32 SizeOfValue void Value Input RefNum RefNum is any ECU M amp C task reference which consists of a valid link to the opened A2L database DBRefNum a selected ECU ECURefNum or a Measurement task DAQRefNum RefNum must be valid for the related PropertyID type Name Specifies an individual name ECU name Measurement channel name or Characteristic name within the task PropertyID Selects the property to get For a description of each property includi
17. status is TRUE if an error occurred This VI is not executed when status is TRUE National Instruments Corporation 5 23 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC CCP Move Memory vi is used to move the memory
18. 6 Unused 7 The logical segment number is ignored The command applies to all segments Segment Segment specifies the selected logical data segment number Page Page specifies the logical data page number Output None ECU M amp C Toolkit User Manual 6 120 ni com Chapter 6 ECU M amp C API for C Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcXCPSetCalPage implements the XCP command SET_CAL_PAGE and sets the access mode for a calibration data segment if the slave device supports calibration data page switching A calibration data segment and its pages are specified by logical numbers Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request National Instruments Corporation 6 121 ECU M amp C Toolkit User Manual mcXCPSetRequest Purpose Performs a request to save session and device information to non volatile memory Format mcTypeStatus mcXCPSetRequest mcTypeTaskRef ECURefNum
19. CANO for CCP or XCP or UDP or TCP for XCP The protocol and interface input is required as this parameter is not defined in the A2L database The default baud rate for CCP or XCP on CAN or the IP address for XCP on UDP TCP may be defined in the A2L database but you can change it by setting the Interface Baud Rate or IP Address property with MC Set Property vi NI CAN The special CAN interface values 256 and 257 refer to virtual interfaces For more information about using virtual interfaces refer to the Frame to Channel Conversion section of Chapter 6 Using The Channel API in the NI CAN Hardware and Software User Manual NI XNET If you use NI XNET hardware and select the xxx yyy syntax the ECU M amp C Toolkit uses the XNET NI CAN compatibility library XCL internally if the XNET interface is defined in MAX under NI CAN Devices To force use of the native XNET API you must use the xxx yyy ni_genie_nixnet syntax The interface name is related to the NI XNET hardware naming under Devices and Interfaces in MAX 5 84 ni com Chapter5 ECU M amp C API for LabVIEW CompactRIO or R Series If using CompactRIO or R Series hardware you must provide a bitfile that handles the CAN communication between the host system and FPGA To access the CAN module on the FPGA you must specify the bitfile name after the for example CCP CANI MyBitfile lvbitx To specify a special RIO target you can specify that target by
20. Chapter 5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Description MC DAQ Clear vi must always be the final ECU M amp C VI called for a Measurement task If you do not use the MC DAQ Clear vi the remaining task configurations can cause problems in execution of subsequent ECU M amp C applications Because this VI clears the Measurement task the Measurement task reference is not wired as an output but is transferred into an ECU reference task handle To change properties of a running Measurement task use MC DAQ Start Stop vi to stop the task MC Set Property vi to change the desired DAQ property and then MC DAQ Start Stop vi to restart the Measurement task again ECU M amp C Toolkit User Manual 5 42 ni com Chapter5 ECU M amp C API for LabVIEW MC DAQ Initialize vi Purpose Initializes a Measurement task for the specified Measurement channel list Format measurement list ECU ref in mode sample rate error in DTO_ID DAQ ref out error out Input Measurement list is the array of channel nam
21. u32 Length char Id Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Type Type specifies the type of the requested identification Type Description 0 ASCII text 1 ASAM MC2 filename without path and extension ASAM MC2 filename with path and extension URL where the ASAM MC2 file can be found BRl_ wl rs ASAM MC72 file to upload128 255 User defined Output Length Length returns the string length of the Id string Id Id contains the queried identification string Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention ECU M amp C Toolkit User Manual 6 110 ni com Chapter 6 ECU M amp C API for C Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcXCPGet ID implements the XCP command GET_ID and returns session configuration or slave device identification information of the selected ECU slave device The supported types are implementation specific of the ECU slave device The identification string
22. 0x03 XCP_ADD_14 Add BYTE into a DWORD checksum ignore overflows 0x04 XCP_ADD_22 Add WORD into a WORD checksum ignore overflows blocksize must be modulo 2 0x05 XCP_ADD_24 Add WORD into a DWORD checksum ignore overflows blocksize must be modulo 2 National Instruments Corporation 5 9 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Type Name Description 0x06 XCP_ADD_44 Add DWORD into DWORD ignore overflows blocksize must be modulo 4 0x07 XCP_CRC_16 See CRC error detection algorithms 0x08 XCP_CRC_16_CITT See CRC error detection algorithms 0x09 XCP_CRC_32 See CRC error detection algorithms OxFF XCP_USER_DEFINED User defined algorithm in externally calculated function For a detailed description of the checksum algorithm refer to the MC Build Checksum vi or the XCP Part 2 Protocol Layer Specification For more detailed information about CRC algorithms refer to the following site http www repairfaq org filipg LINK F_crce_v34 html ECU M amp C Toolkit User Manual 5 10 ni com Chapter5 ECU M amp C API for LabVIEW MC CCP Action Service vi Purpose Calls an implementation specific action service on the ECU CCP only Format ECU ref in ECU ref out service no data type params result error in error out Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC EC
23. 2 2 ni com Chapter 2 Installation and Configuration 3 Launch the License Activation Wizard If you installed your software for the first time and the installer did not launch the License Activation Wizard for you perform the following steps a Launch the NI License Manager by selecting Start Programs National Instruments NI License Manager b Click the Activate button on the toolbar The wizard will guide you through the activation process 4 Save your activation code for future use optional You can reactivate your software at any time The activation wizard provides you with the option to receive an email confirmation of your activation code To apply this activation code in the future launch the Activation Wizard and choose to apply a 20 character activation code If you reinstall your software on the same computer the same activation code will work For more information on activation refer to your product documentation or visit ni com activate National Instruments uses activation to better support evaluation of our software to enable additional software features and to support license management in large organizations To find out more about National Instruments software licensing visit ni com activate to find frequently asked questions resources and technical support Terms Table 1 Definition of Activation Terms Serial Number A 9 character alphanumeric string that uniquely identifies your
24. 6 52 mcDownload 6 54 mcECUConnect 6 56 mcECUCreate 6 57 mcECUDeselect 6 60 mcECUDisconnect 6 61 mcECUSelectEx 6 62 mcEventCreate 6 65 mcGeneric 6 66 mcGetNames 6 68 mcGetNamesLength 6 70 mcGetProperty 6 72 options table 6 73 mcMeasurementCreate 6 85 mcMeasurementRead 6 87 mcMeasurementWrite 6 88 mcProgram 6 89 mcProgramReset 6 91 mcProgramStart 6 92 mcSetProperty 6 93 Characteristic specific options table 6 100 DAQ specific options table 6 100 ECU specific options table 6 94 Measurement specific options table 6 101 mcStatusToString 6 102 return codes table 6 102 mcUpload 6 104 mcXCPCopyCalPage 6 106 mcXCPGetCalPage 6 108 mcXCPGetID 6 110 mcXCPGetStatus 6 112 mcXCPProgramPrepare 6 116 mcXCPProgramVerify 6 118 mcXCPSetCalPage 6 120 mcXCPSetRequest 6 122 mcXCPSetSegmentMode 6 124 CAN calibration protocol CCP overview 1 2 A 1 version 1 2 ECU M amp C Toolkit User Manual CAN overview A 1 CCP functions 4 3 overview A 1 protocol definition A 3 scope A 2 Channel functions 4 2 Characteristic Read and Write 4 7 Characteristics accessing 4 7 reading 4 8 writing 4 8 checksum algorithm 4 21 definition 4 21 4 22 for VxWorks targets 4 23 example 4 23 choosing programming languages 3 1 CompactRIO application development on using NI 985x or NI 986x C Series module 3 4 computer ID xvi conventions used in the manual xiii CRO ID pro
25. ECURefNum or a Measurement task DAQRefNum RefNum must be valid for the related PropertyID type Name Name is not used and can be set to NULL This parameter maybe used for further extensions PropertyID Selects the property to set For a description of each property including its data type and PropertyId refer to the Properties section SizeOfValue Number of bytes allocated for the Value output This size normally depends on the data type listed in the description of the property Value Provides the property value PropertyId determines the data type of the value Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value National Instruments Corporation 6 93 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C 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 You cannot set
26. ProGraMming commands are protected with SEED amp Key mechanism Unused ECU M amp C Toolkit User Manual 6 114 ni com Chapter 6 ECU M amp C API for C Bit Number Flag Description 6 Unused 7 Unused The CAL PAG flags indicates that all commands of the CALibration PAGing group are protected and will return an ERR_ACCESS_LOCKED upon an attempt to execute the command without a previous successful GET_SEED UNLOCK sequence The PGM flags indicates that all the commands of the ProGraMming group are protected and will return a ERR_ACCESS_LOCKED upon an attempt to execute the command without a previous successful GET_SEED UNLOCK sequence The parameter SessionId contains the Session configuration ID The session configuration ID must be set by a prior mcXCPSetRequest call with STORE_DAQ_ REQ set This allows the master device to verify that automatically started DAQ lists contain the expected data transfer configuration National Instruments Corporation 6 115 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcXCPProgramPrepare Purpose Prepares the programming of non volatile memory Format mcTypeStatus mcXCPProgramPrepare mcTypeTaskRef ECURefNum mcAddress Address ul6 CodeSize Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Address Address is the task reference
27. StartStopMode ECU M amp C Toolkit User Manual mcDAQStartStop mcTypeTaskRef DAQRefNum u32 StartStopMode DAQRe Nun is the task reference from the previous Measurement task function The task reference is originally returned from mcDAQInitialize and then reused by subsequent Measurement task functions StartStopMode indicates the type of function to be performed 0 mcStartStopModeStop Configures the ECU to stop transmitting a DAQ task If stopped properties of the DAQ task can be changed using mcSetProperty This function is performed automatically before mcDAQClear 1 mcStartStopModeStart Configures the ECU to start sending data for a Measurement task Ensure that the DAQ list has not yet been transferred to the ECU first Once started properties of the DAQ list can no longer be changed using mcSet Property This function is performed automatically before the first read of the DAQ list with mcDAQRead 2 mcStartStopModeTransmitDAQ Transfers the DAQ list to the ECU but does not start it For example use this mode if you want to change the session status before starting the DAQ list For some ECUs this is necessary 6 46 ni com Chapter 6 ECU M amp C API for C Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected be
28. XCP CAN DTO Id Sets the DTO ID Data Transmission Object which is used by the ECU to respond to XCP commands and send data and status information to the XCP master National Instruments Corporation 5 141 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 6 ECU Specific Property Value Types for the POLY Input Value Continued Sub Hierarchy Type Hierarchy Sub1l Sub 2 Param Description ECU XCP Ethernet IP Address Sets 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 ECU XCP Ethernet IP Port Sets 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 ECU M amp C Toolkit User Manual 5 142 ni com Chapter5 ECU M amp C API for LabVIEW Table 5 7 DAQ Specific Property Value Types for the POLY Input Value Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description DAQ Event Channel Name Sets the event channel name to which the Measurement task is assigned DAQ Mode Sets the selected I O mode for the M amp 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 M
29. database file as 2 dimensional If the Characteristic is defined as 0 or 1 dimensional you can set Y to 0 Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value National Instruments Corporation 6 29 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Description mcCharacteristicWriteSingleValue writes a value to a named Characteristic on the ECU which is identified by the ECU Reference handle ECURef Num The location to which the value is written is identified by the x and y indices If the Characteristic array is 0 or 1 dimensional Y and or X can be set to 0 ECU M amp C Toolkit User Manual 6 30 ni com Chapter 6 ECU M amp C API for C mcClearMemory Purpose Clears the contents of the specified ECU memory Format mcTypeStatus mcClearMemory mcTypeTaskRef ECURefNum mcAddress Address u32 BlockSize Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Address Confi
30. error in error out Input Output ECU M amp C Toolkit User Manual ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 5 70 ni com Chapter5 ECU M amp C API for LabVIEW code is the error code number identifying an error A value of 0 means success A negative value means error V
31. it always returns zero Start the DAQ list first with MC DAQ Start Stop vi before you query this property DAQ Time Since Last Frame Indicates how much time has passed in seconds since the measurement session received the last DAQ frame You can reuse this property to restart the measurement when the value increases a threshold for example 0 5 seconds assuming the ECU stopped sending DAQ messages and must be restarted ECU M amp C Toolkit User Manual 5 114 ni com Table 5 5 Poly Values for Value Output Continued Chapter 5 ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description DAQ CCP DTO ID Returns the DTO ID Data Transmission Object which is used by the ECU to send DAQ list data to the CCP master DAQ CCP DTO Task Returns the NI CAN task reference for the DTO ID Data Transmission Object the CAN task reading frames from the slave device For example you might use this to set CAN properties for this task Handle with extreme care as those properties are usually set correctly by the ECU M amp C Toolkit itself DAQ List CAN ID Returns the CAN ID for the specified DAQ list if mcPropDAQList_ CANIdSelectMode CAN_ID_FIXED National Instruments Corporation 5 115 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIE
32. mcXCPProgramVeri fy can be used to verify the success of non volatile memory reprogramming With Mode set to 00 the master can request the slave to start internal test routines to check whether the new flash contents fits to the rest of the flash Only the result is of interest With Mode set to 01 the master can tell the slave that he will be sending a Verification value to the slave The definition of the Verification mode is project specific The master receives the Verification mode from the project specific programming flow control and passes it to the slave mcXCPProgramVerify implements the optional XCP PROGRAM_VERIFY command defined by the XCP specification For further information on how to program non volatile ECU memory refer to the ASAM XCP Part 2 Protocol Layer Specification National Instruments Corporation 6 119 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcXCPSetCalPage Purpose Sets a calibration page Format mcTypeStatus mcXCPSetCal Page mcTypeTaskRef ECURefNum u8 Mode u8 Segment u8 Page Input ECURefNum ECURe fNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Mode Mode is a bit mask described below Bit Description 0 The given page is used by the slave device application 1 The slave device XCP driver will access the given page 2 Unused 3 Unused 4 Unused 5 Unused
33. value of Bit Timing Register 1 BTR1 of the CAN controller chip For more information refer to the Interface Properties dialog in MAX The value of this property is originally set within MAX but it can be changed using MC Set Property vi ECU CCP CRO ID Returns the CRO ID Command Receive Object which is used to send commands and data from the host to the slave device National Instruments Corporation 5 99 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description ECU CCP CRO Task Returns the NI CAN task reference for the CRO Command Receive Object the CAN task writing frames to the slave device For example you might use this to set CAN properties for this task Handle with extreme care as those properties are usually set correctly by the ECU M amp C Toolkit itself ECU CCP DTO ID Returns the DTO ID Data Transmission Object which is used by the ECU to respond to CCP commands and send data and status information to the CCP master ECU CCP DTO Task Returns the NI CAN task reference for the DTO ID Data Transmission Object the CAN task reading frames from the slave device For example you might use this to set CAN properties for this task Handle with extreme care as those properties are usually
34. verification value error out error in Input Verification mode specifies the type of the requested identification Type Description 0 Request to start internal routine 1 Send a Verification Value stored in Verification value EE ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Verification type specifies the Verification Type of the requested program verification The Verification Type is a bit mask described below Verification Type Description 0x0001 Calibration area s of the flash 0x0002 Code area s of the flash 0x0004 Complete flash content 0x0008 Ox0080 Reserved 0x0100 OxFFOO User defined National Instruments Corporation 5 161 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Verification value contains the selected verification value if Mode 1 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 int
35. 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 source identifies the VI where the error occurred National Instruments Corporation 5 93 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Description 3 MC Get Names vi is used to query the names contained within an A2L file The ECU name terminal is ignored if a valid ECU reference is connected to the reference in terminal In that instance MC Get Names vi will report the names of all objects of the specified type inside the referenced ECU If type 1 type 2 or type 3 the corresponding ECU name must be referenced in order to access ECU specific properties If type 6 type 7 or type 8 the corresponding Group name must be referenced in order to access the group properties If using MC Get Names vi to query the list of supported event channels on an ECU the event channels might be stored inside the ECU instead of the A2L file To query these event channel names from the ECU directly connect to the ECU using MC ECU Connect vi before using MC Get Names vi If using MC Get Names vi to query the Group names and related hierarchy to build for example a tree user control to quer
36. 19 MC CCP GetCrV CESION Vii lt 5 asides re A AA cohes evtheas cote E ees 5 21 MC CCP Move Memory Vissiin oniinn eiia ir a 5 23 MC CCP Select Cal Page Viscas aisian nennen n 5 25 MC CCP Set Session Status Vi cccccccccccssssscccceesssceecceesssseeeeecessseeececeessaeeeeees 5 27 MC Characteristic Read 2Vivc3s T a cB aad dal ie 8 Dees oe 5 29 MC Characteristic Read Single Value vi oo eee seeeeseeseeeseeseeeseeneeeaeenes 5 31 MC Characteristic Wit Vi cccccecscccccessssseccceesssececceesssceecesessseeeeceestseeeeees 5 33 MC Characteristic Write Single Value vi oo eee eeeceseeseceseeeeneeeseeeneeaes 5 35 MG Clear Memory svie scsccsscesssciesctedeossecgcebiaciceab ave S E E EN ANAE EENE 5 37 MC Conversion Create Vvi cccccccccccssssscccecesssccecceecsssseeccecesssceececeeessseeeceeeeseeeees 5 39 ORDINON Clea ra A E E E E Se eh etn Bs 5 41 ME DAO Initialize Vi ssn a a a a i a a ia 5 43 MEDAQ List Initialize V ie hehehe ehh E ae an 5 46 MC DAQ RE Advi cccccccccessssccceessssececeesensceeeccesesseeeceeeeeaseeeceeeeesseeeseceeetseeeeees 5 49 MC DAQ Start StoP Vienan eE a ei N E Enaisi 5 55 MEDA O MTE a E E N E 5 57 MC Database OO E T E A sk a iE 5 60 MC Database Open vi visc isccicsssciedecesicese sees eo ia ieisoasa serpa ianei siaii nE ioste 5 62 MC Double to LTeExtVI e a e levied ats versace a e a e 5 64 MG Download Vi rrera a a ami eesti E 5 66 MC ECU Cl se Viena e n eae i aa ee SE ee E 5 68 MC ECU Connect Vio ecc
37. 2 ASAM MCD 2MC ASAP2 Version 1 51 Release 2003 03 11 Applications Systems Standardization Working Group XCP Version 1 0 The Universal Measurement and Calibration Protocol Family Association for Standardization of Automation and Measuring Systems Partl Overview Part2 Protocol Layer Specification Part3 XCP on CAN Transport Layer Specification Part3 XOP on Ethernet Transport Layer Specification Part4 Interface Specification NI CAN Hardware and Software Manual xiv ni com Activating Your Software This section describes how to use the NI Activation Wizard to activate your software How Do Activate My Software Use the NI Activation Wizard to obtain an activation code for your software You can launch the NI Activation Wizard two ways e Launch the product and choose to activate your software from the list of options presented e Launch NI License Manager by selecting Start All Programs National Instruments NI License Manager Click the Activate button in the toolbar 3 Notes If your software is a part of a Volume License Agreement VLA contact your VLA administrator for installation and activation instructions NI software for Mac OS X and Linux operating systems does not require activation What is Activation Activation is the process of obtaining an activation code to enable your software to run on your computer An activation code is an alphanumeric string that verifies
38. 49 473 14 53 49 473 14 53 49 473 a Command Parameters Command Counter CONNECT Station 0x0051 00 gt OK 00 EXCHANGEID CCP Master ID 00 00 00 00 00 00 01 gt OK CAL DAQ PROGRAM 01 GET_SEED CAL 02 gt OK protected Seed DE DD 00 00 02 UNLOCK Key DE DE E3 0B FF 00 03 gt OK CAL DAQ PROGRAM 03 GET_SEED DAQ 04 gt OK protected Seed 74 DO 00 00 04 UNLOCK Key 74 D1 E3 0B FF 00 05 gt OK CAL DAQ PROGRAM 05 06 06 07 Sender Master ECU Master ECU Master ECU Master ECU Master ECU Master ECU Master ECU Master ECU Master GET_SEED PROGRAM gt OK protected Seed A0 69 00 00 UNLOCK Key A0 6A E3 0B FF 00 gt OK CAL DAQ PROGRAM 07 UPLOAD Size 5 08 Figure 3 1 CCP XCP Spy CCP XCP Spy is an application that monitors records and displays CCP and XCP communication commands and parameters called by your ECU M amp C application using the CCP or XCP protocol Use CCP XCP Spy to analyze your application s communication and to verify that the communication with your ECU slave is correct You can use this application on Windows only when the ECU M amp C master also is running on Windows CCP XCP Spy may slow down the performance of your application communication to your ECU slave and the entire system You should use CCP XCP Spy only while you are debugging or when performance is not critical For further information about the displayed CCP or XCP commands and parameters r
39. Address Specifies the address part of the target address Extension Extension contains the extension part of the address Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcCCPSelectCalPage implements the CCP command SELECT_CAL_PAGE This command sets the beginning of the calibration data page to the specified address within the ECU ECU M amp C Toolkit User Manual 6 22 ni com Chapter 6 ECU M amp C API for C mcCCPSetSessionStatus Purpose Updates the ECU with the current state of the calibration session CCP only Format mcTypeStatus mcCCPSetSessionStatus mcTypeTaskRef ECURefNum u8 SessionStatus Input ECURef Num ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx SessionStatus SessionStatus contains the new status to be set in the ECU Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function execute
40. Address 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 must 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 u32 mcPropGen_Version_ Returns the build number of the ECU M amp C Build software This number applies to Development Alpha and Beta phase only and should be ignored for Release phase str mcPropGen_Version_ Returns a comment string for the ECU M amp C Comment software If you received a custom release of ECU M amp C from National Instruments this comment often describes special features of the release u32 mcPropGen_Version_ Returns the number of bytes to be allocated if Comment_Size you call mcGet Property with the parameter mcPropGen_Version_Comment u32 mcPropGen_Version_ Returns the major version of the ECU M amp C Major software such as the 1 in version 1 2 5 ECU M amp C Toolkit User Manual 6 80 ni com Chapter 6 Table 6 4 Values for PropertylID Continued Data Type Name Description u32 mcPropGen_Version_ Minor Returns the minor version of the ECU M amp C software such as the 2 in version 1 2 5 u32 mcPropGen_Version_ Update Returns the update version of the ECU M amp C software such as
41. BUILD CHECKSUM Returns a Boolean value that indicates whether the ECU supports the optional CCP Command BUILD_CHKSUM ECU CCP Optional Commands CLEAR MEMORY Returns a Boolean value that indicates whether the ECU supports the optional ASAM CCP Command CLEAR MEMORY ECU CCP Optional Commands CLEAR MEMORY Returns a Boolean value that indicates whether the ECU supports the optional CCP Command CLEAR_MEMORY ECU CCP Optional Commands DIAG SERVICE Returns a Boolean value that indicates whether the ECU supports the optional CCP Command DIAG_SERVICE National Instruments Corporation 5 103 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description ECU CCP Optional DNLOAD 6 Returns a Boolean value Commands that indicates whether the ECU supports the optional CCP Command DNLOAD_6 ECU CCP Optional GET ACTIVE Returns a Boolean value Commands CAL PAGE that indicates whether the ECU supports the optional CCP Command GET_ACTIVE_CAL_ PAGE ECU CCP Optional GETS Returns a Boolean value Commands STATUS that indicates whether the ECU supports the optional CCP Command GET_S_STATUS ECU CCP Optional GET SEED Returns a Boolean value Commands that indicates whether the ECU s
42. C Toolkit User Manual 5 166 ni com Chapter5 ECU M amp C API for LabVIEW ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs memory together with the information requested by the Mode parameter 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 Session ID is a session configuration ID that is stored in non volatile status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred code is the
43. If an error is detected you should close all ECU M amp C handles and exit the application If a warning is detected you can display a message for debugging purposes or simply ignore the warning The following piece of code shows an example of handling ECU M amp C status during application debugging status ncDatabaseOpen TestDataBase A2L amp MyDbHandle PrintStat status mcOpenDatabase where the function PrintStat has been defined at the top of the program as void PrintStat mcTypeStatus status char source char statusString 300 if status 0 mcStatusToString status sizeof statusString statusString printf n s nSource s n statusString source if status lt 0 mcDatabaseClose MyDbHand1le exit 1 In some situations you may want to check for specific errors in the code For example when mcCharacteristicRead times out you may want to continue communication rather than exit the application To check for specific errors use the constants defined in niemc h These constants have the same names as described in this manual For example to check for a function timeout use if status mcErrorTimeout National Instruments Corporation 6 103 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcUpload Purpose Uploads data from an ECU Format mcTypeStatus mcUpload mcTypeTaskRef ECURefNum mcAddress Address u32 BlockSize u8 Data Input ECURef
44. Instruments corporate logo and the Eagle logo are trademarks of National Instruments Corporation Refer to the Trademark Information at ni com trademarks for other National Instruments trademarks The mark LabWindows is used under a license from Microsoft Corporation Windows is a registered trademark of Microsoft Corporation in the United States and other countries Other product and company names mentioned herein are trademarks or trade names of their respective companies Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no agency partnership or joint venture relationship with National Instruments Patents For patents covering National Instruments products technology refer to the appropriate location Help Patents in your software the patents txt file on your media or the National Instruments Patent Notice at ni com patents Export Compliance Information Refer to the Export Compliance Information at ni com legal export compliance for the National Instruments global trade compliance policy and how to obtain relevant HTS codes ECCNs and other import export data WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS 1 NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM C
45. M amp C API ECU M amp C Toolkit User Manual a y No Optional XCP Program Prepare y Optional Set XCP Program Properties ia Clear Memory before Programming Clear Memory No al Program Program Reset Optional XCP Program Verify Figure 4 6 Memory Programming Process Decision Chart Program Start The Program Start function sets the ECU into the memory programming mode Note that in this mode specific features might be restricted for instance the ECU might refuse to change into the programming mode while a DAQ list is running The Program Start function is MC Program Start vi in LabVIEW and mcProgramStart in other languages 4 14 ni com Chapter 4 Using the ECU M amp C API Clear Memory It might be necessary to clear the memory before it is reprogrammed The details are ECU dependent The Clear Memory function performs the memory clearing operation It is MC Clear Memory vi in LabVIEW or mcClearMemory in other languages Program The Program function actually downloads the new code to the ECU It is MC Program vi in LabVIEW or mcProgran in other languages Program Reset The Program Reset function terminates a programming sequence Note that for the XCP protocol Program Reset performs a hardware reset of the ECU and causes a disconnect You have to reconnect to the ECU using the ECU Connect function to perform further operations The Progra
46. M amp C API to obtain a descriptive string for the return value Description mcXCPSetRequest implements the XCP command SET_REQUEST and is used to save session configuration information into non volatile memory in the ECU Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to setup a request National Instruments Corporation 6 123 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcXCPSetSegmentMode Purpose Sets the mode of a specified segment Format mcTypeStatus mcXCPSetSegmentMode mcTypeTaskRef ECURefNum u8 Segment u8 Mode Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Segment Segment specifies the logical data segment number Mode Mode specifies the mode for the segment Output None Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcXCPSetSegmentMode implements the XCP command SET_SEGMENT_MODE and sets the sel
47. Name ECU ref in fumas Address error in Data Type ECU ref out ai LAY error out Input Conversion Name identifies the referred conversion object defined by MC Conversion Create vi Measurement Name sets the measurement object name ECU ref in is the task reference that links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Create vi Address is a cluster that contains the following values H BEE Address specifies the address part of the source address Extension contains the extension part of the source address BE 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 H status is TRUE if an error occurred This VI will not execute when status is TRUE 7 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 El E El source identifies the VI where the error occurred ECU M amp C Toolkit User Manual 5 120 ni com Chapter5 ECU M amp C API for LabVIEW Data Type sets the measur
48. Programming Topics Get Names Set Get Properties ECU M amp C Toolkit User Manual The following sections provide information you can use to extend the basic programming model If you are developing an application that another person will use you may not want to specify a fixed channel list for a Measurement task or a fixed channel for a Characteristic in the application Ideally you want the end user to select the channels of interest from user interface controls such as list boxes The Get Names function queries an ASAM MCD 2MC database and returns a list of all channels in that database regarding the selected query mode You can use this list to populate user interface controls The user can then select channels from these controls avoiding the need to type in each name Once the user makes the selections the application can pass the resulting list to the appropriate function such as DAQ Initialize for an ECU Measurement channel list The Get Names function is MC Get Names vi in LabVIEW or mcGetNames in C If you need to change particular parameters within an application such as the DTO ID use the following sequence 1 Initialize the Measurement task as stopped The Initialize function is MC DAQ Initialize vi in LabVIEW or mcDAQInitialize in C 2 Use Set Property to specify the new value for the DTO_ID property The Set Property function is MC Set Property vi in LabVIEW or mcSetProperty in C 3 Start the Measurement ta
49. Purpose Creates a signal conversion object in memory Format Conversion Name ECU ref in Factor Offset error in Unit ECU ref out error out Input Conversion Name identifies the conversion object that handles the scaling of a measurement ECU ref in is the task reference that links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Create vi Factor configures the scaling factor used to convert raw measurement data in the message to from scaled floating point units The factor is the A in the linear scaling formula AX B where X is the raw data and B is the scaling offset E BE Offset configures the scaling offset used to convert raw data in the measurement message to from scaled floating point units The scaling offset is the B in the linear scaling formula AX B where X is the raw data and A is the scaling factor B 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 a status is TRUE if an error occurred This VI is not executed when status is TRUE 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 National I
50. Purpose Stops communication for the Measurement task and then clears the configuration Format one ECU ref out error in error out Input DAQ ref in is the task reference which links to the Measurement task This reference is originally returned from MC DAQ Initialize vi and then wired through subsequent VIs 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 status is TRUE if an error occurred Unlike other VIs this VI will execute when status is TRUE 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 source identifies the VI where the error occurred ECU ref out is the ECU reference upon which MC DAQ Initialize vi was called Wire this to subsequent ECU operations 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 status is TRUE if an error occurred National Instruments Corporation 5 41 ECU M amp C Toolkit User Manual
51. Standardization of Automation and Measuring Systems ASAM e V has specified the CAN Calibration Protocol CCP a protocol layer based on CAN to access the measurement and calibration data in an ECU To build on the functionality of the CAN Calibration Protocol CCP ASAM defined the new protocol specification XCP Universal Measurement and Calibration Protocol which can be considered an improved and generalized version of CCP The X represents the various transportation layers used by the members of the XCP protocol family for instance XCP on CAN XCP on TCP IP XCP on UDP IP XCP on USB etc The ECU M amp C Toolkit is particularly suited to the automotive industry and their component suppliers It provides a function set that can be used in the development or verification phase of an ECU Access to the data inside an ECU takes place based on information stored in an ASAM MCD 2MC A2L database file provided by the ECU supplier Selecting each signal by its name provides convenient access to the data inside an ECU The ECU M amp C Toolkit uses CCP and XCP as the fundamental communication protocols and to support ECU database A2L files You can easily switch between the CCP and XCP protocol layers through software National Instruments Corporation 1 1 ECU M amp C Toolkit User Manual Chapter 1 Introduction CAN Calibration Protocol CCP Overview The CAN Calibration Protocol is a CAN based master slave protocol for cali
52. Type Name Description f64 mcPropDAQ_TimeSince Indicates how much time has passed in LastFrame seconds since the measurement session received the last DAQ frame You can reuse this property to restart the measurement when the value increases a threshold for example 0 5 seconds assuming the ECU stopped sending DAQ messages and must be restarted str mcPropDB_Filename Returns the A2L Database file name with which the task has been opened The value of this property cannot be changed using mcSetProperty u32 mcPropDB_Filename_Size Returns the number of bytes to be allocated if you call mcGet Property with the parameter mcPropDB_Filename u32 mcPropDTOID Returns the DTO CAN Identifier Data Transfer Object for CCP or XCP on CAN which is used to send commands and data from the slave device to the host u32 mcPropECU_BaudRate Returns the baud rate in use u32 mcPropECU_ByteOrder Returns the byte order of the slave device O MSB_LAST The Slave device uses the MSB_LAST Intel byte ordering 1 MSB_FIRST The Slave device uses the MSB_FIRST Motorola byte ordering str mcPropECU_Checksum Returns the file name of the Checksum DLL used for verifying the checksum u32 mcPropECU_Checksum_ Returns the number of bytes to be allocated if Size you call mcGet Property with the parameter mcPropECU_Checksum ECU M amp C Toolkit User Manual 6 76 ni com Chapter 6 ECU M amp C API for
53. VI where the error occurred ECU M amp C Toolkit User Manual 5 90 ni com Chapter5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Error code describes the error returned from the ECU during the communication Return value may contain an array of bytes returned from the ECU as a response to the CCP command sent 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 IEEE status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC Generic vi implements any generic CCP or XCP command that can be used to execute user defined commands that are not defined in the CCP or XCP standard or not covered by the available LabVIEW CCP XCP VIs National Instruments Corporation 5 91 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Get Names vi Purpose Gets
54. VI where the error occurred status qualifier describes an additional status qualifier The additional status qualifier is manufacturer and or project specific and is not part of the CCP protocol specification ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task National Instruments Corporation 5 19 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW session status is the actual session status which is returned from the ECU 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred additional status describes an additional status qualifier If the status qualifier does not contain additional status information the additional status parameter must be set to FALSE If the additional status parameter is not FALSE it may be used to determine the type of the additional
55. View a list of commands cd ni rt system www Change to the desired directory dir View the files present get index htm c index htm Copy the file cd Change directory back to the root c cd d Change directories to the external compact flash ECU M amp C Toolkit User Manual 2 6 ni com Chapter 2 Installation and Configuration Table 2 1 Example of FTP Transfer Continued Command Result put c index htm index htm Copy the file from the FTP client machine to the target dir Verify the copied file on the target cdc Change directory back to the internal compact flash or hard drive quit Disconnect from the FTP server Web Browsers You can also use Internet Explorer or Netscape Navigator to ftp files to and from the controller This is an easier method of transfer since there is no need to learn ftp commands instead the files are simply copied and pasted as they would be in a Windows Explorer window The disadvantage of this method is that Internet Explorer sometimes caches old information so you will need to refresh occasionally If w x y z is the IP address of your RT target open Internet Explorer to access the hard drive or internal compact flash or type the following in the address field ftp w x y z If a username and password are required then use the following format ftp username password w x y 2z To access the external compact flas
56. XCP specification For further information on how to program non volatile ECU memory refer to the ASAM XCP Part 2 Protocol Layer Specification National Instruments Corporation 6 117 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcXCPProgramVerify Purpose Verifies the programming of non volatile ECU memory Format mcTypeStatus mcXCPProgramVeri fy mcTypeTaskRef ECURefNum u8 Mode ul6 VerType u32 VerValue Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Mode Mode describes the verification mode Value Description 0 Request to start internal routine 1 Send a Verification Value stored in VerValue VerType VerType specifies the Verification Type of the requested program verification The Verification Type is a bit mask described below Verification Type Description 0x0001 Calibration area s of the flash 0x0002 Code area s of the flash 0x0004 Complete flash content 0x0008 Ox0080 Reserved 0x0100 OxFFOO User defined VerValue VerValue contains the selected verification value if Mode 1 Output None ECU M amp C Toolkit User Manual 6 118 ni com Chapter 6 ECU M amp C API for C Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value spec
57. already occurred the VI returns the value of the error in cluster to error out status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred National Instruments Corporation 5 169 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI whe
58. amp C API for LabVIEW Description Use MC ECU Create vi to create an ECU object in memory instead of referring to an ECU object defined in the A2L database MC ECU Create vi provides an alternative in which you create the ECU and DAQ List configuration within the application without using an A2L database MC ECU Create vi creates an ECU reference handle linked to the selected ECU name MC ECU Create vi does not start communication This enables you to use MC Set Property vi to change the properties of an ECU task and to create an event channel object manually using MC Event Create vi create a measurement object using MC Measurement Create vi and create a conversion rule using MC Conversion Create vi After you change properties use MC ECU Connect vi to start communication for the task and logically connect to the selected ECU National Instruments Corporation 5 75 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC ECU Deselect vi Purpose Deselects an ECU and invalidates the ECU reference handle Format ECU ref in DB ref out error in error out Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 i
59. amp C API for LabVIEW 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 name reference in value error in reference out error out Input LEFI Pour ECU M amp C Toolkit User Manual Name is not used and can be left unwired This parameter may be used for further extensions Reference in specifies a valid task handle depending on the information which must be set If a generic property must be set a DB ref handle is needed If a Measurement property must be set a valid DAQ ref handle must be wired into reference in If an ECU property must be set a valid ECU ref handle must be wired into reference in Value is a poly input 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 on 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 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 status is TRUE if an error occurred This VI will n
60. an ECU property while the application is connected to the ECU If you need to change a ECU property prior to connecting call mcECUSelectEx followed by mcSetProperty and then mcECUConnect After you connect to the ECU you also can change a property by calling mcECUDisconnect followed by mcSet Property and then mcECUConnect to restart the task Table 6 5 contains a listing of ECU specific values for PropertyID DAQ Specific Properties You cannot set a DAQ property while a Measurement task is running If you need to change a property prior to starting a Measurement task call mcDAQInitialize followed by mcSetProperty and then mcDAQStartStop After you start the Measurement task you also can change a property by calling mcDAQStart Stop followed by mcSet Property and then mcDAQStartStop to restart the task Table 6 6 contains a listing of ECU specific values for PropertyID Properties Table 6 5 ECU Specific Value Types for the PropertylD Input Value Data Type Name Description u32 mcPropCANBaudRate Sets the CAN Baud rate for CCP or XCP on CAN which is used to send commands and data from the host to the slave device u32 mcPropCmd_EXCHANGE_ID Sets whether or not the EXCHANGE_ID command should be suppressed during connection to the ECU u32 mcPropCROID Sets the CRO CAN Identifier Command Receive Object for CCP or XCP on CAN which is used to send commands and data from the host to the slave devi
61. an array of ECU names Measurement names Characteristic names Event names Calibration page names or Group names from a specified A2L database file Format type reference in reference out ECU name names list out error in error out Input ECU M amp C Toolkit User Manual Type mode is an input that specifies the type of names to return The value of Type mode is an enumeration o ECU Names returns a list of ECU names You can write this list to MC ECU Select vi This is the default value 1 Measurement Names returns a list of Measurement names 2 Characteristic Names returns a list of Characteristic names 3 Event Channel Names returns a list of Event Channel names 4 Defined Pages Names returns a list of Calibration page names 5 Group Names returns a list of Group names 6 Group Subgroup Names returns a list of Subgroup names of the specified Group name 7 Group Measurement Names returns a list of Measurement names within the specified Group 8 Group Characteristic Names returns a list of Characteristic names within the specified Group Reference in must be an ECU M amp C task reference or an A2L database reference 5 92 ni com Chapter5 ECU M amp C API for LabVIEW ECU name If a valid A2L database reference is passed to the reference in terminal the ECU name terminal is used to select one of the ECUs inside the A2L database Then MC Get Names vi will report the names of a
62. and status information to the XCP master ECU M amp C Toolkit User Manual 5 108 ni com Table 5 5 Poly Values for Value Output Continued Chapter 5 ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU XCP Ethernet IP Address Returns 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 ECU XCP Ethernet IP Port Returns 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 Characteristic Address Returns the address of the selected Characteristic in the memory of the ECU Characteristic Byte Order Returns the specified byte order 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 Comment Returns the Comment string of the selected Characteristic National Instruments Corporation 5 109 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description Characteristic _ Data Type Re
63. buffer size to read the Path_Size mcPropECU_SeedChkD11Path property str mcPropECU_SeedKey_Cal Returns the file name of the SeedKey DLL used for Calibration purposes u32 mcPropECU_SeedKey_Cal_ Returns the number of bytes to be allocated if Size you call mcGet Property with the parameter mcPropECU_SeedKey_Cal str mcPropECU_SeedKey_DAQ Returns the file name of the SeedKey DLL used for DAQ purposes u32 mcPropECU_SeedKey_DAQ_ Returns the number of bytes to be allocated if Size you call mcGet Property with the parameter mcPropECU_SeedKey_DAQ str mcPropECU_SeedKey_Prog Returns the file name of the SeedKey DLL used for programming purposes National Instruments Corporation 6 79 ECU M amp C API for C ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 4 Values for PropertyID Continued Data Type Name Description u32 mcPropECU_SeedKey_ Returns the number of bytes to be allocated if Prog_Size you call mcGet Property with the parameter mcPropECU_SeedKey_Prog str mc PropECU_SeedKey_XCP Returns the file name of the SeedKey DLL for XCP u32 mcPropECU_SeedKey_XCP__ Returns the number of bytes to be allocated if Size you call mcGet Property with the parameter mcPropECU_SeedKey_XCP u8 mcPropECU_Single_Byte_ Determines if an ECU supports single byte or DAQ_ Lists multi byte DAQ list entries u32 mcPropECU_Station Returns the station address of the slave device
64. by MC DAQ Read vi refer to the Poly VI Types section To select the data type right click the VI go to Select Type and select the type by name 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description Poly VI Types The name of each Poly VI type uses the following conventions The first term is either 7 Chan or NChan This indicates whether the type returns data for a single channel or multiple channels NChan types return an array of analogous 7 Chan types one entry for each channel initialized in channel list of MC DAQ Initialize vi 1Chan types are convenient because no array indexing is required but you are limited to reading only one channel The second term is either Samp or NSamp This indicates whether the type returns a single sample or an array of multiple samples Samp types are often used for single point co
65. cluster indicated an error the Error out cluster contains the same information Otherwise Error out describes the error status of this VI EE RE status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC Build Checksum vi calculates the checksum of a specified memory block inside the ECU starting at the selected Memory Transfer Address MTA The checksum algorithm is not specified by CCP and the checksum algorithm may be different on different devices If you are using the CCP protocol MC Build Checksum vi implements the CCP BUILD_CHKSUM command The checksum algorithm is not specified by CCP and the checksum algorithm may be different on different devices ECU M amp C Toolkit User Manual 5 6 ni com Chapter5 ECU M amp C API for LabVIEW If you are using the XCP protocol MC Build Checksum vi implements the BUILD_CHECKSUM command of the XCP specification The result of the checksum calculation is returned in Checksum regardless of the checksum type The following values for type of checksum are defined in the XCP
66. command parameters 0O 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 National Instruments Corporation 6 95 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 5 ECU Specific Value Types for the PropertyID Input Value Continued Data Type Name Description u32 mcPropECU_CRO_ID Sets the CAN identifier for the CRO ID Command Receive Object which is used to send commands and data from the host to the slave device u32 mcPropECU_DTO_ID Sets the DTO ID Data Transmission Object which is used by the ECU to respond to CCP commands and send data and status information to the CCP master u32 mcPropECU_MasterID Sets CCP master ID information This ID information is optional and specific to the ECU implementation For more information about the CCP master ID information refer to the documentation for the ECU str mcPropECU_SeedChkD11 Determines the directory where the ECU M amp C Path Toolkit expects to find the Seedkey or Checksum DLL If the property is an empty string default the ECU M amp 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 str mcPropECU_SeedKey_Cal Sets the file name of the SeedKey DLL used for Calibr
67. contents of an ECU from one memory location to another Before calling the CCP MOVE command this function sets the Memory Transfer Address pointers MTAO as defined in the source cluster and MTA1 as defined in the destination cluster to appropriate values MC CCP Move Memory vi implements the CCP command MOVE defined by the CCP specification ECU M amp C Toolkit User Manual 5 24 ni com Chapter5 ECU M amp C API for LabVIEW MC CCP Select Cal Page vi Purpose Sets the beginning of the calibration data page CCP only Format ECU ref in _ _ ECU ref out address error in error out Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Address is a cluster which contains the following values j Address specifies the address part of the address Extension contains the extension part of the address 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 status is TRUE if an error occurred This VI is not executed when status is TRUE 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 intend
68. data block in bytes to be uploaded ie status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Data is a byte array which receives the uploaded data information from the ECU National Instruments Corporation 5 17 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Error out describes error conditions If the Error in cluster indicated an H error the Error out cluster contains the same information Otherwise Error out describes the error status of this VI status is TRUE if an error occurred 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 Err
69. definition The vbitx filename represents the filename and location of the bitfile on the host You may use just the filename without the folder if the bitfile is in the same folder as the LabVIEW Project vproj ECU M amp C Toolkit User Manual 6 64 ni com Chapter 6 ECU M amp C API for C mcEventCreate Purpose Creates an Event object in memory Format mcTypeStatus mcEventCreate mcTypeTaskRef ECURefNum cstr EventChannelName u8 EventChannelNumber Input ECURef Num ECURefNunm is the task reference that links to the selected ECU This reference is originally returned from mcECUCreate EventChannelName EventChannelName identifies the Event Channel object EventChannelNumber EventChannelNumber identifies the number of the Event Channel The event channel number specifies the generic signal source that effectively determines the data transmission timing To allow a reduction of the desired transmission rate a prescaler may be applied to the Event Channel The prescaler value factor must be greater than or equal to 1 to use mcSet Property using mcPropDAQ_ Prescaler Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condi
70. 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 Description MC Calc Checksum vi implements a checksum calculation over a given data block The checksum algorithm is performed by the ECU M amp C toolkit using a predefined algorithm XCP only or over a dedicated checksum function provided by a specific DLL The Checksum DLL is defined in the A2L data base and can be changed by the application by the MC Set Property vi using the Checksum DLL Name property status is TRUE if an error occurred 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 source identifies the VI where the error occurred If you are using the CCP protocol type of checksum must always be set to OxFF as CCP supports an external checksum DLL only If using XCP the following values for type of checksum are defined in the XCP specification Type Name Description 0x01 XCP_ADD_11 Add BYTE into a BYTE checksum ignore overflows 0x02 XCP_ADD_12 Add BYTE into a WORD checksum ignore overflows
71. 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 ane source identifies the VI where the error occurred CAN interface specifies the CAN interface to use for this task For compatibility reasons if you are using the CCP protocol you can only specify the CAN interface to use for this CCP task The interface input uses a ring typedef in which value 0 selects CANO value 1 selects CAN1 and so on As the ECU M amp C API is based on the NI CAN Channel API the NI CAN Frame API cannot used on the same CAN network interface simultaneously If the CAN network interface is already initialized in the Frame API this function returns an error If you use NI XNET or CompactRIO R Series hardware use the protocol and interface parameter instead National Instruments Corporation 5 81 ECU M amp C Toolkit User Manual Chapter 5 Output ECU M amp C API for LabVIEW ECU ref out is the task reference which links to the selected ECU 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 status is TRUE if an error occurred code is the error code number identifying an error A valu
72. 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 source identifies the VI where the error occurred National Instruments Corporation 5 167 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Description MC XCP Set Request vi implements the XCP command SET_REQUEST and is used to save session configuration information into non volatile memory in the ECU Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request ECU M amp C Toolkit User Manual 5 168 ni com Chapter5 ECU M amp C API for LabVIEW MC XCP Set Segment Mode vi Purpose Sets the mode of a specified segment Format Input ECU ref in ECU ref out segment mode error out error in HEE E ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Segment specifies the logical data segment number Mode specifies the mode for the segment Error in is a cluster which describes error conditions occurring before the VI executes If an error has
73. error in cluster to error out status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred ECU M amp C Toolkit User Manual 5 66 ni com Chapter5 ECU M amp C API for LabVIEW ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC Download vi is used to download data to an E
74. for C Description mcCCPActionService implements the CCP command ACTION_SERVICE The ECU carries out the requested service and automatically sets the Memory Transfer Address MTAO to the location from which the CCP master may upload the requested action service return information if applicable The result of this service can be accessed by calling the function mcCCPGetResult right after mcCCPActionService National Instruments Corporation 6 13 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcCCPDiagService Purpose Calls an implementation specific diagnostic service on the ECU CCP only Format mcTypeStatus mcCCPDiagService mcTypeTaskRef ECURefNum ul6 ServiceNo u8 Params 4 u8 ResultLength u8 DataType Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx ServiceNo ServiceNo determines the diagnostic service that is executed inside the ECU For more information about the services that are implemented in the ECU refer to the documentation for the ECU Params Params passes an array of bytes to the ECU that might be needed by the ECU to run the diagnostic service Since the definition of the parameters is specific to the implementation of the ECU the parameters can only be passed as an array of bytes It is your responsibility to pass the correct number of parameters in the correct byte ordering to this functi
75. function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description If you are using the XCP protocol mcSet Property implements the XCP command PROGRAM_RESET This optional command indicates the end of a non volatile memory programming sequence and may or may not have a response from the ECU In either case the slave device will go into a disconnected state mcSetProperty may be used to reset a slave device for other purposes For further information on how to use program ECU memory and to use the mcSet Property command refer to the ASAM XCP Part 2 Protocol Layer Specification National Instruments Corporation 6 91 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcProgramStart Purpose Indicates the start of a programming sequence Format mcTypeStatus mcProgramStart mcTypeTaskRef ECURefNum Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Output Return Value The return value indicates the status of the function call as a signed 32 bit i
76. integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention ECU M amp C Toolkit User Manual 6 20 ni com Chapter 6 ECU M amp C API for C Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcCCPMoveMemory is used to move the memory contents of an ECU from one memory location to another Before calling the CCP MOVE command this function sets the Memory Transfer Address pointers MTAO as defined in the source struct and MTA1 as defined in the destination struct to appropriate values mcCCPMoveMemory implements the CCP command MOVE defined by the CCP specification National Instruments Corporation 6 21 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcCCPSelectCalPage Purpose Sets the specified address to be the start address of the calibration data page CCP only Format mcTypeStatus mcCCPSelectCalPage mcTypeTaskRef ECURefNum mcAddress Address Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Address Configures the target address for the programming operation in the ECU mcAddress is a C struct consisting of
77. into the data field of a DAQ message So the CCP slave device keeps a list of entries for each DAM These lists are called ObjectDefinitionTables ODTs Each ODT entry holds information about the memory address where data is stored inside the device and the size of the data to be sent The data of the first ODT entry is placed in the first byte of the data field of the DAQ message The data of the next entry is placed at the first free byte of the DAQ message and so on A 4 ni com Technical Support and Professional Services Visit the following sections of the award winning National Instruments Web site at ni com for technical support and professional services e Support Technical support at ni com support includes the following resources Self Help Technical Resources For answers and solutions visit ni com support for software drivers and updates a searchable KnowledgeBase product manuals step by step troubleshooting wizards thousands of example programs tutorials application notes instrument drivers and so on Registered users also receive access to the NI Discussion Forums at ni com forums NI Applications Engineers make sure every question submitted online receives an answer Standard Service Program Membership This program entitles members to direct access to NI Applications Engineers via phone and email for one to one technical support as well as exclusive access to eLearning training modules at ni com
78. is ASCII text format National Instruments Corporation 6 111 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcXCPGetStatus Purpose Queries the current session status from an ECU slave device Format mcTypeStatus mcXCPGetStatus mcTypeTaskRef ECURefNum u8 SessionStatus u8 ResourceMask ul6 SessionId Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Output SessionStatus SessionStatus returns the current status of the selected ECU ResourceMask ResourceMask is the current resource protection status of the selected ECU SessionId SessionId returns the defined session configuration ID Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcXCPGetStatus implements the XCP command GET_STATUS and returns all current status information of the selected ECU slave device including the status of the resource protection pending store requests and the general status of dat
79. 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 source identifies the VI where the error occurred Description MC Measurement Read vi performs a single point read of a single Measurement from the selected ECU without opening a Measurement task National Instruments Corporation 5 123 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Measurement Write vi Purpose Writes a single Measurement value to the ECU Format measurement name ECU ref in ECU ref out value error in error out Input Measurement name is the name of a Measurement channel stored in the A2L database file to which to write a Measurement value ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Value writes a single sample for the Measurement channel initialized in measurement name 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 erro
80. its name followed by the bitfile name for example XCP CAN RIO1 MyBitfile lvbitx Currently only a single CAN interface is supported RJO defines the RIO target name as defined in your LabVIEW Project definition The vbitx filename represents the filename and location of the bitfile on the host You may use just the filename without the folder if the bitfile is in the same folder as the LabVIEW Project vproj DB reference in is the task reference which links to the opened database file which to initialize all subsequent tasks 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 ECU name is the ECU name to select out of a A2L Database file with status is TRUE if an error occurred This VI will not execute when status is TRUE 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 ane source identifies the VI where the error occurred CAN interface specifies the CAN interface to use for this task For compatibility reasons if you are using the CCP protocol you can only
81. mcECUConnect Establishes communication to the selected ECU through CCP After a successful ECU Connect you can create a Measurement Task or read write a Characteristic mcECUCreate Creates an ECU object in memory mcECUDeselect Deselects an ECU and invalidates the ECU reference handle mcECUDisconnect Disconnects CCP communication to the selected ECU mcECUSelectEx Selects an ECU from the names stored in an A2L database mcEventCreate Creates an Event object in memory mcGeneric Sends a generic CCP command mcGetNames Retrieves a comma separated list of ECU names Measurement names Characteristic names Event names Characteristic pages or Group names from a specified A2L database mcGetNamesLength Retrieves the amount of memory required to store the names returned by mcGetNames mcGet Property Retrieves a property of the driver the database the ECU a Characteristic a Measurement or a Measurement task mcMeasurementCreate Creates a Measurement object in memory mcMeasurementRead Reads a single Measurement value from the ECU mcMeasurementWrite Writes a single Measurement value to the ECU mcProgram Programs a memory block on the ECU mcProgramReset Indicates the end of a programming sequence mcProgramStart Indicates the start of a programming sequence ECU M amp C Toolkit User Manual 6 4 ni com Chapter 6 ECU M amp C API for C Table 6 2 Functions for the ECU M amp C A
82. non volatile ECU memory Flash EEPROM etc Programming starts at the selected MTAO address and extension defined in the Address struct The mcProgram function auto increments the ECU MTAO address If you are using the XCP protocol mcProgram implements the XCP command PROGRAM The command is used to program a non volatile memory segment inside the ECU slave Depending on the access mode defined by PROGRAM_FORMAT two different concepts are supported The end of the memory segment is indicated when BlockSize is set to 0 The end of the overall programming sequence is indicated by a using the mcProgramReset command which executes the XCP command PROGRAM_RESET causing the slave device to move into a disconnected state Usually a hardware reset of the slave device is executed This command may support block transfer similar to the commands DOWNLOAD and DOWNLOAD_NEXT For further information on how to use mcProgram and details on block mode transfers refer to the ASAM XCP Part 2 Protocol Layer Specification ECU M amp C Toolkit User Manual 6 90 ni com Chapter 6 ECU M amp C API for C mcProgramReset Purpose Indicates the end of a programming sequence Format mcTypeStatus mcProgramReset mcTypeTaskRef ECURefNum Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Output Return Value The return value indicates the status of the
83. occurred DTO_ID is the CAN identifier for the Data Transmission Object DTO used by the ECU to transmit the DAQ list data to the host If the DTO_ID terminal is unwired the ECU will use the same identifier for sending the DAQ list data as for the normal CCP communication 5 44 ni com Chapter5 ECU M amp C API for LabVIEW DAQ ref out is a task reference for the Measurement task created Wire this task reference to subsequent VIs for this Measurement task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC DAQ Initialize vi does not start the transmission of the DAQ lists from the ECU to or from the application through CCP or XCP This enables you to use MC Set Property vi to change the properties of a Measurement task After you change properties use MC DAQ Start Stop vi to start the communication for the Mea
84. performs a mutual identification of the protocol version in the slave device to agree on a common protocol version MC CCP Get Version vi implements the CCP command GET_CCP_VERSION defined by the CCP specification ECU M amp C Toolkit User Manual 5 22 ni com Chapter5 ECU M amp C API for LabVIEW MC CCP Move Memory vi Purpose Moves a memory block on the ECU CCP only Format block size ECU ref in ECU ref out source destination error out error in Input Block size determines the size of memory block in bytes which should be moved from the source address to the destination address ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Source is a cluster which contains the following values H EE Address specifies the address part of the source address from which the memory block is copied Extension specifies the extension part of the source address Destination is a cluster which contains the following values H Address specifies the address part of the destination address to which the memory block is copied Extension specifies the extension part of the destination address 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 A
85. status information Description MC CCP Get Session Status vi retrieves the session status of the ECU The return value session status is a bit mask that represents several session states inside the ECU status qualifier specifies the additional status information additional status contains the additional status information The content of these parameters is project specific and not defined by CCP For more information about these parameters refer to the documentation for the ECU MC CCP Get Session Status vi implements the CCP command GET_S_STATUS defined by the CCP specification ECU M amp C Toolkit User Manual 5 20 ni com Chapter5 ECU M amp C API for LabVIEW MC CCP Get Version vi Purpose Retrieves version of the CCP implemented in the ECU CCP only Format ECU ref in ECU ref out major version error In minor version error out Input Output ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred This VI is not executed when status is TRUE code is the error code number identifying an error A value of 0 means success A negative value means error VI
86. that determines the data format of the result Result returns information from the action service 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 HE E E status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC CCP Action Service vi implements the CCP command ACTION_SERVICE The ECU carries out the requested service and automatically uploads the requested action service return information ECU M amp C Toolkit User Manual 5 12 ni com Chapter5 ECU M amp C API for LabVIEW MC CCP Diag Service vi Purpose Calls a diagnostic service on the ECU CCP only Format ECU ref in ECU ref out service no data type params result error in error out Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Service no d
87. the 5 in version 1 2 5 str mcPropIPAddress Returns the IP address for XCP on Ethernet TCP or UDP as a string u32 mcPropIPAddress_ Size Returns the number of bytes to be allocated if you call mcGet Property with the parameter mcPropIPAddress ul6 mcPropIPPort Returns the IP port for XCP on Ethernet TCP or UDP u32 mcPropMeas_Address Returns the address of the selected Measurement in the memory of the control unit u32 mcPropMeas_ByteOrder Returns the specified byte order 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 ug mcPropMeas_Datatype Returns the data type of the Measurement task ug mcPropMeas_Extension Returns the address extension of the ECU address This optional parameter may contain additional address information defined in the A2L database For instance it can be used to distinguish different address spaces of an ECU multi microcontroller devices u32 mcPropMeas_IsVirtual Returns whether the Measurement is virtual Virtual Measurements are not transmitted by the ECU but are calculated in the application They return an error when opened in a DAQ list National Instruments Corporation 6 81 ECU M amp C API for C ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Tabl
88. the previous call to MC DAQ Read vi or MC DAQ Start Stop vi If no message has been received the warning code 3FF60009 hex is returned in error out If a new message has been received the success code 0 is returned in error out Unless an error occurs the number of samples returned is equal to number of samples to read NChan NSamp 1D Wfm Returns an array one entry for each channel initialized in channel list Each entry consists of a single waveform The order of channel entries in value is the same as the order in the original channel list The initialized sample rate must be greater than zero for this poly VI because each sample in the array of a waveform indicates the value of the CAN channel at a specific point in time In other words the sample rate specifies a virtual clock that copies the most recent value from CAN messages for each sample time The changes in sample values from message to message enable you to view the M amp C DAQ channel over time such as for comparison with other CAN or DAQ input channels This VI waits until all samples arrive in time before returning The start time for each waveform indicates the time of the first CAN sample in the array The delta time of a waveform indicates the time between each sample in the array as determined by the original sample rate If the initialized sample rate is zero this poly VI returns an error If the intent is simply to read the most recent samples for a task use the NChan
89. the serial number by selecting the Help About menu item within the application or by selecting your product within NI License Manager Start All Programs National Instruments NI License Manager You can also contact your local National Instruments branch What is a Computer ID The computer ID contains unique information about your computer National Instruments requires this information to enable your software You can find your computer ID through the NI Activation Wizard or by using NI License Manager as follows 1 Launch NI License Manager by selecting Start All Programs National Instruments NI License Manager 2 Click the Display Computer Information button in the toolbar For more information about product activation and licensing refer to ni com activate How Can I Evaluate NI Software ECU M amp C Toolkit User Manual You can install and run most NI application software in evaluation mode This mode lets you use a product with certain limitations such as reduced functionality or limited execution time Refer to your product documentation for specific information on the product s evaluation mode xvi ni com Activating Your Software Moving Software After Activation To transfer your software to another computer install and activate it on the second computer You are not prohibited from transferring your software from one computer to another and you do not need to contact or inform NI of the tran
90. the software version and computer ID to enable features on your computer Activation codes are unique and are valid on only one computer What is the NI Activation Wizard The NI Activation Wizard is a part of NI License Manager that steps you through the process of enabling software to run on your machine What Information Do Need to Activate You need your product serial number user name and organization The NI Activation Wizard determines the rest of the information Certain activation methods may require additional information for delivery This information is used only to activate your product Complete disclosure of National Instruments Corporation XV ECU M amp C Toolkit User Manual Activating Your Software How Do Find the National Instruments software licensing information privacy policy is available at ni com activate privacy If you optionally choose to register your software your information is protected under the National Instruments privacy policy available at ni com privacy My Product Serial Number Your serial number uniquely identifies your purchase of NI software You can find your serial number on the Certificate of Ownership included in your software kit If your software kit does not include a Certificate of Ownership you can find your serial number on the product packing slip or on the shipping label If you have installed a previous version using your serial number you can find
91. to a LabVIEW error handling VI such as the Simple Error Handler source identi Output Session Id returns the Session status returns EE fies the VI where the error occurred defined session configuration ID ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task the current status of the selected ECU ECU M amp C Toolkit User Manual 5 154 ni com Chapter5 ECU M amp C API for LabVIEW Resource mask is the current resource protection status of the selected ECU 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC XCP Get Status vi implements the XCP command GET_STATUS and returns all current status information of the selected ECU slave device including the status of the resource protection pending store requests and the general status of data acquisit
92. to the slave device DTO ID The DTO ID Data Transmission Object is used by the ECU to respond to CCP commands and to send data and status information to the CCP master Station Address 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 must 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 National Instruments Corporation 4 5 ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API Baudrate The baudrate property may be missing in an A2L database file and can be set explicitly within the application This property provides the baud rate at which communication will occur and applies to all tasks initialized with the interface You can specify one of the predefined baud rates or specify advanced baud rates which refer to the settings of the Bit Timing Register 0 BTRO and 1 BTR1 For more information refer to the Interface Properties dialog in MAX or the NI CAN Hardware and Software Manual The baud rate is originally set within MAX ASAM MCD 2MC Communication Properties for XCP with UDP or TCP ECU Connect ECU M amp C Toolkit User Manual If the XCP communication properties are not stored in the ASAM MCD 2MC file the communication properties must be manua
93. u8 Mode u16 SessionID Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Mode Mode is a bit mask described below Bit Description 0 Request to store calibration data in non volatile memory 1 Unused 2 Request to save all DAQ lists which have been selected with START_STOP_DAQ_LIST Select into non volatile memory The slave also must store the session configuration ID in non volatile memory Upon saving the slave first must clear any DAQ list configuration that might already be stored in non volatile memory 3 Request to clear all DAQ lists in non volatile memory All ODT entries reset to address 0 extension 0 size 0 and bit_offset FF Session configuration ID reset to 0 4 Unused 5 Unused 6 Unused 7 Unused SessionID SessionID is a session configuration ID that is stored in non volatile memory together with the information requested by the Mode parameter Chapter 6 ECU M amp C API for C Output None Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU
94. uses the syntax XXX YYY where X defines the selected protocol The following strings may be used e String CCP refers using the CAN Calibration Protocol CCP e String XCP refers using the Universal Measurement and Calibration Protocol XCP If you are using the CCP protocol YYY can be associated with a defined NI CAN interface CANO CAN1 up to CAN63 CAN network interface names are associated with physical CAN ports using the Measurement and Automation Explorer MAX For example if you are using the CCP protocol on NI CAN interface CAN1 the value passed to Interface is CCP CAN1 The special string values CAN256 and CAN257 refer to virtual interfaces Refer to the NI CAN Hardware and Software User Manual for detailed information on how to use virtual NI CAN ports If you are using the XCP protocol YYY can be associated with a XCP transport layer The transport layers may defined as follows e CANxx e TCP e UDP Using NI CAN If you select CAN as the transport layer you must specify the NI CAN interface CANO CANI up to CAN63 CAN network interface names are associated with physical CAN ports using the Measurement and Automation Explorer MAX For example if you are using the XCP on NI CAN interface CAN2 the value passed to Interface is XCP CAN2 If you are using the XCP on UDP the value passed to Interface is XCP UDP If you are using the XCP on TCP the value passed to Interface is XCP TCP The special string val
95. using sample rate 0 or as waveform using a sample rate gt 0 Input channel data is received from the DAQ messages mcDAQModePolling National Instruments Corporation In this mode the data from the Measurement task are uploaded from the ECU whenever mcDAQRead is called 6 35 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcDAQModeSTIMList For XCP this defines a DAQ list for data stimulation STIM Within a DAQ task initialized with this parameter you can call mcDAQWrite to write stimulation data to the ECU Calling mcDAQRead is not allowed For CCP an error is returned mcDAQModeDAQListTimeStamped The data is transmitted from the ECU in equidistant time intervals as defined in the A2L database The data can be read back with mcDAQReadTimestamped as a timestamped data array Input channel data are received from the DAQ messages Use mcDAQReadTimestamped to obtain input samples as an array of sample timestamp pairs Use this input mode to read samples with timestamps that indicate when each channel is received from the network DTO_ID DTO_ID is the CAN identifier for the Data Transmission Object DTO used to transmit the data from the DAQ lists to the host The default value is 1 which means that the DTO ID used to transmit the DAQ list data is the same that is used for the rest of the CCP communication SampleRate SampleRate specifies the timing to use for samples of the NI CAN task The sample
96. value specified is listed in a COMPU_VTAB scaling for the characteristic or measurement specified in Obj ectName the respective text is returned If no such value is available a string representation of the double value is returned Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcDoubleToText performs text conversion for measurement or characteristic values Especially if the measurement or characteristic has an associated COMPU_VTAB type scaling the textual representation of the value is returned If no such value is present either because the object does not have a text scaling or the value does not have a textual representation in the table a string representation of the double value is returned National Instruments Corporation 6 53 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C meDownload Purpose Downloads data to an ECU Format mcTypeStatus mcDown1load mcTypeTaskRef ECURefNum mcAddress Address u32 BlockSize u8 Data Input ECURefNum E
97. vi 5 88 MC Get Names vi 5 92 MC Get Property vi 5 95 poly output values table 5 97 MC Measurement Create vi 5 120 MC Measurement Read vi 5 122 MC Measurement Write vi 5 124 MC Program Reset vi 5 128 MC Program Start vi 5 130 MC Program vi 5 126 MC Set Property vi 5 132 Characteristic specific input values table 5 145 DAQ specific poly input values table 5 143 ECU specific poly input values table 5 134 Measurement specific input values table 5 145 MC Upload vi 5 146 MC XCP Copy Cal Page vi 5 148 MC XCP Get Cal Page vi 5 150 MC XCP Get ID vi 5 152 MC XCP Get Status vi 5 154 MC XCP Program Prepare vi 5 159 MC XCP Program Verify vi 5 161 MC XCP Set Cal Page vi 5 164 MC XCP Set Request vi 5 166 MC XCP Set Segment Mode vi 5 169 LabVIEW Real Time RT configuration 2 5 CompactRIO system 2 5 DOS prompt 2 6 FTP transfers table 2 6 LabVIEW 2 9 LabVIEW RT graphical file transfer utility 2 7 NI CAN on PXI RT system 2 5 NI XNET on PXI RT system 2 5 ni com PXI system 2 5 web browsers 2 7 license management overview 2 1 list of C functions 6 2 list of LabVIEW VIs 5 1 MC Build Checksum vi 5 5 MC Calc Checksum vi 5 8 MC CCP Action Service vi 5 11 MC CCP Diag Service vi 5 13 MC CCP Generic vi 5 90 MC CCP Get Active Cal Page vi 5 15 MC CCP Get Result vi 5 17 MC CCP Get Session Status vi 5 19 MC CCP Get Version vi 5 21 MC CCP Move Memory vi 5 23 MC CCP Select Cal
98. 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 source identifies the VI where the error occurred Description MC XCP Copy Cal Page vi implements the XCP command COPY_CAL_PAGE and forces the slave to copy one calibration page to another This command is only available if more than one calibration page is defined In principal any page of any segment can be copied to any page of any other segment but there may be restrictions Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request National Instruments Corporation 5 149 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC XCP Get Cal Page vi Purpose Queries a calibration page setting Format mode ECU ref in ECU ref out segment page error in error out Input Mode specifies the access mode Mode 1 The given page is used by the slave device application Mode 2 The slave device XCP driver will access the given page ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Error in is a cluster which describes error conditions occurring before the VI executes If an error has already occurre
99. with SEED amp Key mechanism 1 ProGraMming commands are protected with SEED amp Key mechanism 5 Unused 6 Unused 7 Unused The CAL PAG flags indicates that all commands of the CALibration PAGing group are protected and will return an ERR_ACCESS_LOCKED upon an attempt to execute the command without a previous successful GET_SEED UNLOCK sequence The PGM flags indicates that all the commands of the ProGraMming group are protected and will return a ERR_ACCESS_LOCKED upon an attempt to execute the command without a previous successful GET_SEED UNLOCK sequence National Instruments Corporation 5 157 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW The parameter Session Id contains the Session configuration ID The session configuration ID must be set by a prior MC XCP Set Request vi call with STORE_DAQ_REQ set This allows the master device to verify that automatically started DAQ lists contain the expected data transfer configuration ECU M amp C Toolkit User Manual 5 158 ni com Chapter 5 ECU M amp C API for LabVIEW MC XCP Program Prepare vi Purpose Prepares the programming of non volatile memory Format ECU ref in ECU ref out address code size error out error in Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Address
100. 1000000 You also can specify advanced baud rates in the form 8000XXYY hex where YY is the value of Bit Timing Register 0 BTRO and XX is the value of Bit Timing Register 1 BTR1 ECU CCP CRO ID Sets the CRO ID Command Receive Object which is used to send commands and data from the host to the slave device National Instruments Corporation 5 135 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 6 ECU Specific Property Value Types for the POLY Input Value Continued Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description El ECU CCP DTO ID Sets 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 A ECU CCP Master ID Sets the CAN identifier of the CCP master that is used by the CCP command EXCHANGE _ID as a parameter ECU CCP SeedKey Cal Name Sets the file name of the SeedKey DLL used for Calibration purposes ECU CCP SeedKey DAQ Name Sets the file name of the SeedKey DLL used for DAQ purposes ECU CCP SeedKey Prog Name Sets the file name of the SeedKey DLL used for programming purposes d HE TF ECU CCP Single Byte DAQ List Sets the ECU to support single byte or multi byte DAQ list entr
101. 1Samp 1D Dbl type If no message has been received for a channel since you started the task a 0 is returned in value You can specify channels in channel list that span multiple messages At each point in time a sample from the most recent message is returned for all channels You can use error out to determine whether a new message has been received since the previous call to MC DAQ Read vi or MC DAQ Start Stop vi If no message has been received for one or more channels the warning code 3FF60009 hex is returned in error out If anew message has been received for all channels the success code 0 is returned in error out Unless an error occurs the number of samples returned is equal to number of samples to read If you need to determine the number of channels in the task after initialization get the Number of Channels property for the task reference MC Read Multi Chan Multi Samp 2D Time amp Dbl Returns an array with one entry for each channel initialized in the measurement list Each entry consists of an array of clusters Each cluster corresponds to a received signal for the channels initialized in the measurement list Each cluster contains the sample value and a timestamp that indicates when the measurement channel was received The order of channel entries in samples is the same as the order in the original channel list To use this type you must set the initialized mode to timestamped read The VI does not wait for messages but instead r
102. 2 4 Transferring Files With the FTP Utility You also can use LabVIEW to programmatically access the FTP server of a LabVIEW Real Time target The DataSocket Read function has the ability to read raw text tabbed text and wav files from an FTP server For more information on this refer to the LabVIEW User Manual The LabVIEW Internet Developers Toolkit allows you to send files or raw data to an FTP server as well as sending emails and adding security to your web based applications National Instruments Corporation 2 9 ECU M amp C Toolkit User Manual Chapter 2 Installation and Configuration Hardware and Software Requirements You can use the ECU M amp C Toolkit on the following hardware e National Instruments NI CAN hardware Series 1 or 2 with the NI CAN driver software version 2 3 or later installed e National Instruments NI XNET hardware with the NI XNET driver software version 1 0 or later installed e National Instruments CompactRIO or R Series Multifunction RIO hardware and the NI 9853 or NI 9852 CompactRIO CAN modules 3 Note You can use the ECU M amp C Toolkit with LabVIEW 2009 or newer on CompactRIO systems or National Instruments R Series Multifunction RIO hardware ECU M amp C Toolkit User Manual 2 10 ni com Application Development This chapter explains how to develop an application using the ECU M amp C API Choose the Programming Language LabVIEW LabWindows CVI The programming la
103. 2 7 FTP with web browsers 2 7 G generic CCP functions 4 17 generic XCP functions 4 18 Get Names 4 16 H help technical support B 1 home software use 2 4 instrument drivers NI resources B 1 K KnowledgeBase B 1 ECU M amp C Toolkit User Manual Index L MC ECU Disconnect vi 5 78 LabVIEW MC ECU Open vi 5 80 list of VIs 5 1 MC Build Checksum vi 5 5 MC Calc Checksum vi 5 8 MC CCP Action Service vi 5 11 MC CCP Diag Service vi 5 13 MC CCP Generic vi 5 90 MC CCP Get Active Cal Page vi 5 15 MC CCP Get Result vi 5 17 MC CCP Get Session Status vi 5 19 MC CCP Get Version vi 5 21 MC CCP Move Memory vi 5 23 MC CCP Select Cal Page vi 5 25 MC CCP Set Session Status vi 5 27 options table 5 28 MC Characteristic Read Single Value vi 5 31 MC Characteristic Read vi 5 29 options table 5 30 MC Characteristic Write Single Value vi 5 35 MC Characteristic Write vi 5 33 options table 5 34 MC Clear Memory vi 5 37 MC Conversion Create vi 5 39 MC DAQ Clear vi 5 41 MC DAQ Initialize vi 5 43 MC DAQ List Initialize vi 5 46 MC DAQ Read vi 5 49 MC DAQ Start Stop vi 5 55 MC DAQ Write vi 5 57 MC Database Close vi 5 60 MC Database Open vi 5 62 MC Double To Text vi 5 64 MC Download vi 5 66 MC ECU Close vi 5 68 MC ECU Connect vi 5 70 MC ECU Create vi 5 72 MC ECU Deselect vi 5 76 ECU M amp C Toolkit User Manual l 4 MC ECU Select vi 5 84 MC Event Create
104. 4 ni com Chapter 3 Application Development The interface name you use must be part of all parameters in the FPGA code for the CAN communication Also the ECU M amp C Toolkit needs the interface name for correct functionality If you define the interface name to be CANO you must name the parameters as follows e __CANO Rx Data e __CANO Rx Ready e __CANO Tx Data Frame e __CANO Tx Ready e _ CANO Bit Timing e __CANO FPGA Is Running e CANO Start e __CANO FIFO Full e __CANO FIFO Ready In addition you need to set the name of the internally used FIFO to __CAN0 FIFO the FIFO is set to U32 1029 elements target scoped and block memory After recompiling your FPGA VI copy the bitfile to the root directory of your CompactRIO controller and specify the bitfile in the interface name Or copy the file to any location on the CompactRIO controller and specify an absolute path or path relative to the root for the bitfile If you are using an NI XNET 986x C Series module on your CompactRIO target you need to start an FPGA VI on the target before accessing the port with the ECU M amp C Toolkit Refer to the Getting Started with CompactRIO section in the NI XNET Hardware and Software Manual for more information about compiling the FPGA VI When the VI is running you can access the NI 986x module as you would program on a Windows or PXI LabVIEW Real Time target National Instruments Corporation 3 5 ECU M amp C Toolkit User Manual
105. 9 list 4 10 mode 4 10 overview 4 9 National Instruments Corporation l 7 Index sample rate 4 10 software activating xv evaluating xvi moving after activation xvii software NI resources B 1 Station Address property 4 5 structure of ECU M amp C API 4 1 support technical B 1 T task concept 1 4 technical support B 1 training and certification NI resources B 1 troubleshooting NI resources B 1 U using with FTP 2 6 V volume licensing program 2 4 W Web resources B 1 Windows Guest accounts xvii writing Characteristics 4 8 X XCP functions overview 4 3 ECU M amp C Toolkit User Manual
106. A single master device host can be connected to one or more slave devices Before a slave device may accept commands from the host the host must establish a logical point to point connection to the slave device After this connection has been established the slave device must acknowledge each command received from the host within a specific time CCP offers continuous or event driven data acquisition from the controllers as well as memory transfers to and control functions in the controllers for calibration purposes With these functions CCP may be used in e The development of electronic control units ECU e Systems for functional and environmental tests of an ECU e Test systems and test stands for controlled devices combustion engines gearboxes suspension systems climate control systems body systems anti locking systems e On board test and measurement systems of pre series vehicles e Any non automotive application of CAN based distributed electronic control systems CCP defines two function sets one for control memory transfer and one for data acquisitions that are independent of each other and may run asynchronously The control commands are used to carry out functions in the slave device and may use the slave to perform tasks on other devices The data acquisition commands are used for continuous data acquisition from a slave device The devices continuously transmit internal data according to a list that has been confi
107. AN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN 2 IN ANY APPLICATION INCLUDING THE ABOVE RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY ADVERSE FACTORS INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY COMPUTER HARDWARE MALFUNCTIONS COMPUTER OPERATING SYSTEM SOFTWARE FITNESS FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION INSTALLATION ERRORS SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES TRANSIENT FAILURES OF ELECTRONIC SYSTEMS HARDWARE AND OR SOFTWARE UNANTICIPATED USES OR MISUSES OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER ADVERSE FACTORS SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED SYSTEM FAILURES ANY APPLICATION WHERE A SYSTEM FAILURE WOULD CREATE A RISK OF HARM TO PROPERTY OR PERSONS INCLUDING THE RISK OF BODILY INJURY AND DEATH SHOULD NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE TO AVOID DAMAGE INJURY OR DEATH THE USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES INCLUDING BUT NOT LIMITED TO BACK UP OR SHUT DOWN MECHANISMS BECAUSE EACH END USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUA
108. ATUS u32 mcPropOptCmd_GET_SEED Returns whether the ECU supports the optional CCP Command GET_SEED u32 mcPropOptCmd_MOVE Returns whether the ECU supports the optional CCP Command MOVE ECU M amp C Toolkit User Manual 6 82 ni com Chapter 6 ECU M amp C API for C Table 6 4 Values for PropertylID Continued Data Type Name Description u32 mcPropOptCmd_PROGRAM Returns whether the ECU supports the optional CCP Command PROGRAM u32 mcPropOptCmd_PROGRAM_6 Returns whether the ECU supports the optional CCP Command PROGRAM _6 u32 mcPropOptCmd_SELECT_ Returns whether the ECU supports the optional CAL_PAGE CCP Command SELECT_CAL_PAGE u32 mcPropOptCmd_SET_S_ Returns whether the ECU supports the optional STATUS CCP Command SET_S_STATUS u32 mcPropOptCmd_SHORT_UP Returns whether the ECU supports the optional CCP Command SHORT_UP u32 mcPropOptCmd_START_ Returns whether the ECU supports the optional STOP_ALL CCP Command START_STOP_ALL u32 mcPropOptCmd_TEST Returns whether the ECU supports the optional CCP Command TEST u32 mcPropOptCmd_UNLOCK Returns whether the ECU supports the optional CCP Command UNLOCK u8 mcPropPGM_AccessMethod Returns the selected access mode for mcProgram and mcClearMemory 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 O
109. Bold text also denotes parameter names Italic text denotes variables emphasis a cross reference or an introduction to a key concept Italic text also denotes text that is a placeholder for a word or value that you must supply Text in this font denotes text or characters that you should enter from the keyboard sections of code programming examples and syntax examples This font is also used for the proper names of disk drives paths directories programs subprograms subroutines device names functions operations variables filenames and extensions Italic text in this font denotes text that is a placeholder for a word or value that you must supply National Instruments Corporation xiii ECU M amp C Toolkit User Manual About This Manual Related Documentation The following documents contain information that you may find helpful as you read this manual ECU M amp C Toolkit User Manual ANSIJISO Standard 11898 1993 Road Vehicles Interchange of Digital Information Controller Area Network CAN for High Speed Communication CAN Specification Version 2 0 1991 Robert Bosch GmbH Postfach 106050 D 70049 Stuttgart 1 CiA Draft Standard 102 Version 2 0 CAN Physical Layer for Industrial Applications CAN Calibration Protocol Specification Version 2 1 ASAP Arbeitskreis zur Standardisierung von Applikationssystemen Standardization of Application Calibration Systems task force Interface Specification Interface
110. C Table 6 4 Values for PropertylID Continued Data Type Name Description u32 mcPropECU_CmdByteOrder Returns the byte order for multi byte command parameters O 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 u32 mc PropECU_CRO_ID Returns the CRO ID Command Receive Object which is used to send commands and data from the host to the slave device nctType mcPropECU_CRO_Task NI CAN Task reference to the CAN Task Taskref assigned to the CRO ID u32 mcPropECU_DTO_ID Returns the DTO ID Data Transmission Object which is used by the ECU to respond to CCP commands and send data and status information to the CCP master nctType mcPropECU_DTO_Task NI CAN Task reference to the CAN Task Taskref assigned to the DTO ID u8 mcPropECU_ID Returns the slave device identifier This ID information is optional and specific to the ECU implementation For more information about the CCP slave ID information refer to the documentation for the ECU ug mcPropECU_ID_DataType Returns a data type qualifier of the slave device ID information This ID information is optional and specific to the ECU implementation For more information about the CCP slave ID information refer to the documentation for the ECU u8 mcPropECU_ID_Length Returns the length of the slave device identifier in bytes u32 mcPropECU_In
111. C DAQ Read vi as Single point data using sample rate 0 or as a waveform using a sample rate gt 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 DAQ Prescaler Sets the prescaling factor which reduces the desired transmission frequency of the associated DAQ list National Instruments Corporation 5 143 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 7 DAQ Specific Property Value Types for the POLY Input Value Continued Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description DAQ Sample Rate SampleRate 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 DAQ CCP DTO ID Sets the DTO ID Data Transmission Object which is used by the ECU to send DAQ list
112. C Toolkit User Manual Chapter 3 Application Development Visual C 6 ECU M amp C Toolkit User Manual The toolkit software includes a full set of examples for LabWindows CVI The examples are installed in the LabWindows CVI directory under samples ecumc Each example provides a complete LabWindows CVI project prj file A description of each example is provided in comments at the top of the c file The ECU M amp C Toolkit software supports Microsoft Visual C C 6 The header file for Visual C C 6 is in the Program Files National Instruments Shared ExternalCompilerSupport C include folder To use the ECU M amp C API include the niemc h header file in the code then link with the niemcc 1ib library file The niemcc 1ib library file is in the Program Files National Instruments Shared ExternalCompilerSupport C 1ib32 msve folder For C applications files with a c extension include the header file by adding a include to the beginning of the code like this include niemc h For C applications files with a cpp extension define __cplusplus before including the header like this define _ cplusplus include niemc h The _ cplusplus define enables the transition from C to the C language functions The reference for each API function is in Chapter 6 ECU M amp C API for C On Windows Vista with Standard User Account the typical path to the C examples folder is Users Public Documents Nat
113. C Toolkit on your system National Instruments does not use this information for any other purpose Refer to the Privacy Policy section for information on the National Instruments privacy policy regarding your personal information The Activation Wizard offers a variety of options you can use to obtain an activation code from National Instruments including an automatic option through an Internet connection or through email by telephone or by fax Activate ECU M amp C Toolkit ECU M amp C Toolkit User Manual The ECU M amp C Toolkit must be activated before using it in accordance with its license agreement To activate the ECU M amp C Toolkit you must first purchase a license For information on purchasing licenses contact your local National Instruments sales representative or visit ni com Once you have purchased a license you can activate your product using the Activation Wizard Activation is simple and you can activate your software 24 hours a day 7 days a week Complete the following steps to activate the ECU M amp C Toolkit 1 Locate your serial number Your serial number uniquely identifies your purchase of NI software You can find it on the Certificate of Ownership included in your software kit If you subscribe to NI Developer Suite or Academic Software Solutions use the original serial number you received with your initial purchase ke TT aaa SUMED d XXXXXXXXX 2 Install your software
114. CAN ECU Measurement and Calibration Toolkit User Manual December 2011 7 NATIONAL 371601J 01 instruments Worldwide Technical Support and Product Information ni com Worldwide Offices Visit ni com niglobal to access the branch office Web sites which provide up to date contact information support phone numbers email addresses and current events National Instruments Corporate Headquarters 11500 North Mopac Expressway Austin Texas 78759 3504 USA Tel 512 683 0100 For further support information refer to the Technical Support and Professional Services appendix To comment on National Instruments documentation refer to the National Instruments Web site at ni com info and enter the Info Code feedback 2005 2011 National Instruments Corporation All rights reserved Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions due to defects in materials and workmanship for a period of 90 days from date of shipment as evidenced by receipts or other documentation National Instruments will at its option repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period National Instruments does not warrant that the operation of the software shall be uninterrupted or error free A Return Material Authorization RMA number must be obta
115. CAN_ID_FIXED us mcPropDAQList_FirstPID Returns the first Packet ID for the specified DAQ list u32 mcPropDAQList_NumberOf Returns the number of allowed event channels EventChannels for the specified DAQ list ECU M amp C Toolkit User Manual 6 78 ni com Chapter 6 Table 6 4 Values for PropertylID Continued Data Type Name Description u8 mcPropDAQList_Event Returns an array of event channel numbers Channels referenced by the DAQ list u32 mcPropDAQList_ Returns whether or not the specified DAQ list ReductionAllowed allows reduction u32 mcPropDAQList_NumberOf Returns the length of the array containing the ExcludedDAQLists numbers of DAQ lists not working together with the current DAQ list ul6 mcPropDAQList_Excluded Returns an array containing the numbers of DAQLists DAQ lists not working together with the current DAQ list u32 mcPropECU_Name_Size Returns the number of bytes to be allocated if you call mcGet Property with the parameter mcPropECU_Name str mcPropECU_SeedChkD11 Determines the directory where the ECU M amp C Path Toolkit expects to find the Seedkey or Checksum DLL If the property is an empty string default the ECU M amp 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 str mcPropECU_SeedChkD11 Returns the required
116. CCP slave device O0O 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 ECU Command Byte Order Sets the byte order of the CCP or XCP commands O 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 ECU M amp C Toolkit User Manual 5 134 ni com Chapter5 ECU M amp C API for LabVIEW Table 5 6 ECU Specific Property Value Types for the POLY Input Value Continued Sub Hierarchy Type Hierarchy Subl Sub 2 Param Description ECU Seedkey Determines the directory Checksum where the ECU M amp C DLL Path Toolkit expects to find the Seedkey or Checksum DLL If the property is an empty string default the ECU M amp 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 ECU Checksum Sets the file name of the DLL Name Checksum DLL used for verifying the checksum ECU CCP Baud Rate Sets the Baud Rate in use by the interface 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
117. CP or XCP As with any other NI product for LabVIEW RT you must download the ECU M amp C Toolkit software to the LabVIEW RT system using the Remote Systems branch in MAX For more information refer to the LabVIEW RT documentation After installing the PXI CAN cards and downloading the NI CAN or NI XNET and ECU M amp C Toolkit software to the LabVIEW RT system you need to verify the installation NI CAN on PXI RT System Within the MAX Tools menu select NI CAN RT Hardware Configuration The RT Hardware Configuration tool provides features similar to Devices and Interfaces on the local system Use the RT Hardware Configuration tool to self test the CAN cards and assign an interface name to each physical CAN port NI XNET on PXI RT System After you install the PXI XNET cards and download the NI XNET software to the LabVIEW RT system you need to verify the installation Find your PXI target device in MAX under Network Devices and expand the tree Browse to Devices and Interfaces and open the NI XNET Devices group Perform a self test for all installed NI XNET devices On the RT target you can configure your NI XNET hardware the same way as on the local system CompactRIO System After you have installed the CompactRIO CAN modules and downloaded the NI RIO and ECU M amp C Toolkit software you need to enable the CompactRIO Reconfigurable Embedded Chassis for use in LabVIEW For more information refer to the MAX help National In
118. CU The data is stored starting at the location specified by the Address and Extension parameters On XCP protocol when the slave supports the block mode ECU sends the data in blocks using the DOWNLOAD_NEXT command National Instruments Corporation 5 67 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC ECU Close vi Purpose Closes the selected ECU and the associated A2L database Format ECU ref in error in error out Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred Unlike other VIs this VI will execute when status is TRUE 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 source identifies the VI where the error occurred Output Error out describes error conditions If the Error in cluster indicate
119. CU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcDoubleToText Purpose Converts a numerical value to a text string using a COMPU_VTAB type of scaling Format mcTypeStatus Input ECURefNum ObjectType ObjectName Value SizeOfTextValue ECU M amp C Toolkit User Manual mcDoubleToText mcTypeTaskRef ECURefNum u32 ObjectType cstr ObjectName double Value u32 SizeOfTextValue str TextValue ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Indicates the type of the object named in ObjectName Valid values are 1 Measurement Name 2 Characteristic Name Indicates the object measurement or characteristic for which the COMPU_VTAB scaling is performed If no COMPU_VTAB scaling is available for the object Text Value is just a string representation of the value specified in Value The numerical value to be converted For example this could have been returned from mcCharacteristicRead or mcMeasurementRead Must contain the number of bytes in the buffer passed to TextValue Note that there is no way of requesting the necessary size of this buffer If you do not know up front how long your text could become specify a buffer of 256 bytes This is the maximum the ASAM standard allows 6 52 ni com Chapter 6 ECU M amp C API for C Output TextValue The buffer for the resulting converted text string If the
120. CU Reference handle ECU ref out in LabVIEW ECURef Num in C must be acquired before any additional actions can be performed National Instruments Corporation 4 7 ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API ECU M amp C Toolkit User Manual Characteristic Read The application must call the Read Characteristic function to obtain scaled floating point samples The application typically calls Read Characteristic on demand Calling Read Characteristic in a loop can cause significant CAN network traffic as Characteristics may contain large amounts of data The function to read 0 to 2 dimensional Characteristics is MC Characteristic Read vi in LabVIEW or mcCharacteristicRead in C The function to read single double values as Characteristics is MC Characteristic Read Single Value vi in LabVIEW or mcCharacteristicReadSingleValue in C Before reading a Characteristic it may be helpful to verify the dimension of the Characteristic based on the definition in the ASAM MCD 2MC database file Depending on the dimension of the Characteristic use the appropriate Read function for reading a double a 1D array of doubles or a 2D array of doubles The function to verify a dimension of a named Characteristic is MC Get Property vi with the parameter Characteristic Dimension in LabVIEW or mcGet Property with the parameter mcPropChar_Dimension in C Characteristic Write The application must call the Write Characte
121. CURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Address Configures the target address for the download operation in the ECU mcAddress is a C struct consisting of Address Specifies the address part of the target address Extension Extension contains the extension part of the target address BlockSize BlockSize determines the size of the data block to be downloaded Output Data Data pointer to the information to be downloaded Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 54 ni com Chapter 6 ECU M amp C API for C Description mcDownload downloads data to an ECU The data is stored starting at the selected Address and Extension in the ECU memory The function can download more than 5 data bytes to the ECU If you are using the CCP protocol and the selected BlockSize is higher than 5 bytes mcDownload performs several CCP DNLOAD commands until all data bytes are downloaded to the ECU mc
122. CUSelectEx Mode Mode specifies the access mode Mode 1 The given page is used by the slave device application Mode 2 The slave device XCP driver will access the given page Segment Segment specifies the selected logical data segment number Output Page Page returns the logical data page number Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcXCPGetCalPage implements the XCP command GET_CAL_PAGE and queries the logical number for the calibration data page that is currently activated for the specified access mode and data segment ECU M amp C Toolkit User Manual 6 108 ni com Chapter 6 ECU M amp C API for C Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request National Instruments Corporation 6 109 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcXCPGetID Purpose Queries session configuration or slave device identification Format mcTypeStatus mcXCPGet ID mcTypeTaskRef ECURefNum u8 Type
123. Chapter5 ECU M amp C API for LabVIEW MC Clear Memory vi Purpose Clears the contents of a specified memory block Format ECU ref in ECU ref out address block size error out error in Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Address is a cluster which contains the following values Address specifies the address part of the source address Extension contains the extension part of the source address Block size determines the size of the block that must be cleared 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 status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred National Instruments Corporation 5 37 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for La
124. ConversionCreate Creates a signal conversion object in memory mcDAQClear Stops communication for the Measurement task and clears the task mcDAQInitialize Initializes a Measurement task for the specified Measurement channel list mcDAQListInitialize Defines a DAQ list on a specific DAQ list number and initializes the Measurement task for the specified Measurement channel list Initializes a Measurement task for the specified Measurement channel list mcDAQRead Reads samples from a Measurement task Samples are obtained from received CAN messages mcDAQReadTimestamped Reads timestamped samples from a DAQ task initialized with the selected mode of mcDAQModeDAQListTimeStamped mcDAQStartStop Starts or stops the transmission of the DAQ lists for the specified Measurement task mcDAQWrite Writes samples to an ECU DAQ list National Instruments Corporation 6 3 ECU M amp C Toolkit User Manual ECU M amp C API for C Chapter 6 ECU M amp C API for C Table 6 2 Functions for the ECU M amp C API for C Continued Function Purpose mcDatabaseClose Stops transmission of the DAQ lists for the specified Measurement task mcDatabaseClose Closes a specified A2L Database reference mcDatabaseOpen Opens a specified A2L Database mcDoubleToText Converts a numerical value to a text string using a COMPU_VTAB type of scaling mcDownload Downloads data to an ECU
125. Download implements the CCP DNLOAD command defined by the CCP specification If you are using the XCP protocol the Data block of the specified BlockSize is copied into the ECU memory starting at the MTA The MTA is post incremented by the number of downloaded data bytes If the slave device does not support Block Transfer Mode all downloaded data is transferred in a single command packet If Block Transfer Mode is supported the downloaded data is transferred in multiple command packets For the slave however there might be limitations concerning the maximum number of consecutive command packets so the number of data elements may be within a limited range The master device has two additional consecutive DOWNLOAD_NEXT command packets The slave device will acknowledge only the last DOWNLOAD_NEXT command packet The separation time between the command packets and the maximum number of packets are specified in the response for the CONNECT command National Instruments Corporation 6 55 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcECUConnect Purpose Establishes communication to the selected ECU through CCP or XCP After a successful ECU Connect you can create a Measurement task or read write a Characteristic Format mcTypeStatus mcECUConnect mcTypeTaskRef ECURefNum Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelect
126. E if the Measurement can be accessed through MC Measurement Write vi as well Measurement Unit Returns the unit string defined for this Measurement in the A2L database ECU M amp C Toolkit User Manual 5 118 ni com Chapter 5 Table 5 5 Poly Values for Value Output Continued ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description Version Build Returns the build number of the ECU M amp C software This number applies to the Development Alpha and Beta phases only and should be ignored for the Release phase Version Comment Returns a comment string for the ECU M amp C software If you received acustom release of ECU M amp C from National Instruments this comment often describes special features of the release Version Major Returns the major version of the ECU M amp C software such as the 1 in version 1 2 5 Version Minor Returns the minor version of the ECU M amp C software such as the 2 in version 1 2 5 Version Update Returns the update version of the ECU M amp C software such as the 5 in version 1 1 5 National Instruments Corporation 5 119 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Measurement Create vi Purpose Creates a Measurement object in memory Format ConversionName Measurement
127. ECU M amp C Toolkit API that you use to read and write channels A Characteristic or Measurement channel consists of one more floating point values in physical units such as Volts rpm km h C and so on that is converted to from a raw value in measurement hardware The ECU M amp C API Read and Write functions provide access to Characteristic or Measurement channels When a CAN message is received ECU M amp C Toolkit converts raw fields in the message into physical units which you then obtain using the ECU M amp C API Read function When you call a ECU M amp C API Write function you provide floating point values in physical units which ECU M amp C Toolkit converts into raw fields and transmits as a CAN message based on the CCP protocol Reference handle to a selected ECU See ECU reference Specifies the generic signal source that effectively determines the data transmission timing A 29 bit arbitration ID Frames that use extended IDs are often referred to as CAN 2 0 Part B the specification which defines them A 6 byte string identifying the CCP master device See DAQ A collection of DAQ channels that you can read or write Address pointer in the ECU that holds the source target address for data sent or received via CCP The address extension depends on the slave controller s organization and may identify a switchable memory bank or a memory segment See Memory Transfer Address G 4 ni com ODT PID Prescaler S
128. Ex Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcECUConnect implements the CCP or XCP CONNECT command It establishes a logical connection to an ECU using the provided ECU Reference handle EcURe fNum Unless a slave device ECU is unconnected it must not execute or respond to any command sent by the application The only exception to this rule is the Test command to which the CCP or XCP slave with the specific address may return an acknowledgement Only a single CCP or XCP slave can be connected to the application at a time ECU M amp C Toolkit User Manual 6 56 ni com mcECUCreate Chapter 6 ECU M amp C API for C Purpose Creates an ECU object in memory Format mcTypeStatus Input DBRefNum ECUname Interface ByteOrder CRO_ID DTO_ID StationAddress National Instruments Corporation mcECUCreate mcTypeTaskRef DBRefNum cstr ECUName char Interface 132 ByteOrder u32 CRO_ID u32 DTO_ID u16 StationAddress u32 B
129. GroupNames Returns a list of Group names 6 68 ni com Chapter 6 ECU M amp C API for C 6 mcTypeGroup_SubGroupNames Returns a list of Subgroup names of the specified Group name 7 mcTypeGroup_MeasurementNames Returns a list of Measurement names within the specified Group 8 mcTypeGroup_CharacteristicNames Returns a list of Characteristic names within the specified Group ECUName If the Type mcTypeMeasurementNames or Type mcTypeCharacteristicNames and RefNum contains a DBRefNum the corresponding ECU name must be referenced in order to access ECU specific properties If RefNum contains an ECURefNum or DAQRefNum the parameter ECUName is ignored and can be set to NULL SizeOfNamesList Size of the buffer provided to take the names list After calling mcGetNamesLength you can allocate an array of size SizeofNamesList and then pass that array to mcGetNames using the same input parameters This ensures that mcGetNames will return all names without error Output NameList Returns the comma separated list of names specified by Type Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use
130. I 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 source identifies the VI where the error occurred Description If you are using the CCP protocol MC ECU Connect vi implements the CCP CONNECT command If you are using the XCP protocol MC ECU Connect vi implements the XCP command CONNECT It establishes a logical connection to an ECU using the provided ECU Reference handle Unless a slave device ECU is disconnected it must not execute or respond to any command sent by the application Only one CCP slave can be connected to the application at a time from a set of CCP slaves sharing identical CRO and DTO identifiers MC ECU Connect vi is an optional function and is automatically performed before MC Characteristic Read vi MC Characteristic Write vi MC DAQ Initialize vi any MC CCP xxx command or any MC XCP xxx command is performed National Instruments Corporation 5 71 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC ECU Create vi Purpose Creates an ECU object in memory Format Protocol and Interface ECU Name DB ref in ECU ref out Communication Params Byte Order error out error in Input ECU M amp C Toolkit User Manual Protocol and Interface selects target communi
131. I returns the value of the error in cluster to error out status is TRUE if an error occurred This VI will not execute when status is TRUE ECU M amp C Toolkit User Manual 5 152 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Reference out is a copy of the reference in terminal which can be wired through subsequent ECU M amp C VIs Id contains the queried identification string 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 status is TRUE if an error occurred 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 source identifies the
132. If an error has already occurred the VI returns the value of the error in cluster to error out status is TRUE if an error occurred This VI will not execute when status is TRUE 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 National Instruments Corporation 5 95 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output Por ECU M amp C Toolkit User Manual source identifies the VI where the error occurred Reference out contains an ECU M amp C task reference which can be wired through subsequent ECU M amp C VIs Value is a poly output value that returns the property value You select the property returned in 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 Get 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 Error out describes error conditions If the Error in cluster indicated an error the Error out cluster contains the same information Otherwise Error out de
133. Instruments Corporation 6 15 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcCCPGetActiveCalPage Purpose Retrieves the ECU Memory Transfer Address pointer to the calibration data page CCP only Format mcTypeStatus mcCCPGetActiveCal Page mcTypeTaskRef ECURefNum mcAddress Address Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Output Address Returns the address for the active calibration page in the ECU mcAddress is a C struct consisting of Address Specifies the address part of the address Extension Extension contains the extension part of the address Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcCCPGetActiveCalPage retrieves the start address of the active calibration data page in the ECU memory ECU M amp C Toolkit User Manual 6 16 ni com Chapter 6 ECU M amp C API for C mcCCPGetResult Purpose Uploads data from the ECU whe
134. LOAD MC Download vi mcDownload GET_ACTIVE_CAL_PAGE MC CCP Get Active Cal Page vi mcCCPGetActiveCalPage GET_CCP_VERSION MC CCP Get Version vi mcCCPGetVersion GET_S_STATUS MC CCP Get Session Status vi mcCCPGetSessionStatus MOVE MC CCP Move Memory vi mcCCPMoveMemory PROGRAM MC Program vi mcProgram SELECT_CAL_PAGE MC CCP Select Cal Page vi meCCPSelectCalPage National Instruments Corporation ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API Table 4 1 Overview of the CCP Commands with Related VIs and C Functions Continued CCP Command LabVIEW VI Name C Function Name SET_S_STATUS MC CCP Set Session mcCCPSetSessionStatus Status vi UPLOAD MC Upload vi mcUpload Generic XCP Functions The generic ECU M amp C XCP functions provide direct access to the XCP commands on a very low programming level For more information about the use and parameters of the XCP commands refer to the ASAM XCP Part 2 Protocol Layer Specification Table 4 2 provides an overview of the XCP commands with their corresponding LabVIEW VIs or C functions Table 4 2 Overview of the XCP Commands with Related Vis and C Functions XCP Command LabVIEW VI Name C Function Name BUILD_CHKSUM MC Build Checksum vi mcBuildChecksum CLEAR_MEMORY MC Clear Memory vi mcClearMemory COPY_CAL_PAGE MC XCP Copy Cal Pa
135. Login Dialog Box The upper section of the utility interface shows the current directory and contents on the remote RT target while the lower section gives information for the host or local machine To copy a file Test ECU a21 for instance to the RT target complete the following steps referring to Figure 2 4 for details 1 Inthe Current Directory section navigate through the tree structure to the System folder 2 Inthe local directory section navigate through the tree structure to the location of the file you want to transfer and highlight the file 3 Click the To Remote button to copy the file 2 8 ni com gt File Transfer Target IP Address 10 0 47 69 Current Remote Directory Chapter 2 Installation and Configuration INI RT S STEM LABVIEW DATA STARTUP ERRORS ETHERNET Current Local Directory D niemc dll D niemcazl aml D niemcazl dll D nipalp dil D nipalpa dil D nirpc dll FB missen aden lt 143360 24263 294912 350812 3584 41050 maa C Program Files National Instruments LabYIEW 7 O examples ECUMC express File general y e LabVIEW amp D MCAdvancedExamples lib D McBasicExamples IIb D MccharacteristicsEditors IIb D ReadMe txt D TestECU az2l M ore etre oi lt 576487 131098 684092 1119 6 9 20 New Folder 6 9 200 6 9 20 69 20 6 9 201 Rename File Select All finan Figure
136. Measurement task and then clears the configuration MC DAQ Initialize vi Initializes a Measurement task for the specified Measurement channel list MC DAQ List Initialize vi Defines a DAQ list on a specific DAQ list number and initializes the Measurement task for the specified Measurement channel list ECU M amp C Toolkit User Manual 5 2 ni com Chapter5 ECU M amp C API for LabVIEW Table 5 1 ECU M amp C API VIs for LabVIEW Continued Function Purpose MC DAQ Read vi Reads samples from a Measurement task Samples are obtained from received CAN messages MC DAQ Start Stop vi Starts or stops transmission of the DAQ lists for the specified Measurement task MC DAQ Write vi Writes samples to a Measurement task MC Database Close vi Closes a specified A2L Database MC Database Open vi Opens a specified A2L Database MC Double to Text vi Converts a numerical value to a text string using a COMPU_VTAB type of scaling MC Download vi Downloads data to an ECU MC ECU Close vi Closes the selected ECU and the associated A2L database MC ECU Connect vi Establishes the communication to the selected ECU through the CCP protocol After a successful ECU Connect you can create a Measurement Task or read write a Characteristic MC ECU Create vi Creates an ECU object in memory MC ECU Deselect vi Deselects an ECU and invalidates the ECU reference handle MC ECU Disco
137. Num ECURe fNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Address Configures the source address for the upload operation in the ECU mcAddress is a C struct consisting of Address Specifies the address part of the source address Extension Extension contains the extension part of the address BlockSize BlockSize is the size of the data block in bytes to be uploaded Output Data Data is a byte array which receives the uploaded data information from the ECU Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 104 ni com Chapter 6 ECU M amp C API for C Description If you are using the CCP protocol mcUpload implements the CCP command UPLOAD A data block of the specified length starting at the specified address is uploaded from the ECU This function sets the Memory Transfer Address pointer MTAO to the appropriate value as defined in the Address struct If you are using the XCP protocol mcUpload imp
138. PI for C Continued Function Purpose mcSet Property Sets a property of the driver the database the ECU a Characteristic a Measurement or a Measurement task mcStatusToString Converts a status code into a descriptive string mcUpload Uploads data from an ECU mcXCPCopyCalPage Forces a copy transaction of one calibration page to another mcXCPGetCalPage Queries a calibration page setting mcXCPGet ID Queries session configuration or slave device identification mcXCPGetStatus Queries the current session status from an ECU slave device mcXCPProgramPrepare Prepares the programming of non volatile memory mcXCPProgramVerify Performs a non volatile memory certification task on the ECU device mcXCPSetCalPage Sets a calibration page mcXCPSetRequest Performs a request to save session and device information to non volatile memory mcXCPSetSegmentMode Sets the mode of a specified segment National Instruments Corporation 6 5 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcBuildChecksum Purpose Calculates a checksum over a defined memory range within the ECU Format mcTypeStatus mcBuildChecksum mcTypeTaskRef ECURefNum mcAddress Address u32 BlockSize u8 ChecksumType u8 SizeOfChecksum u32 Checksum Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned fr
139. Page vi 5 25 MC CCP Set Session Status vi 5 27 options table 5 28 MC Characteristic Read Single Value vi 5 31 MC Characteristic Read vi 5 29 options table 5 30 MC Characteristic Write Single Value vi 5 35 MC Characteristic Write vi 5 33 options table 5 34 MC Clear Memory vi 5 37 MC Conversion Create vi 5 39 MC DAQ Clear vi 5 41 MC DAQ Initialize vi 5 43 MC DAQ List Initialize vi 5 46 MC DAQ Read vi 5 49 MC DAQ Start Stop vi 5 55 MC DAQ Write vi 5 57 MC Database Close vi 5 60 MC Database Open vi 5 62 MC Double To Text vi 5 64 MC Download vi 5 66 MC ECU Close vi 5 68 MC ECU Connect vi 5 70 National Instruments Corporation l 5 Index MC ECU Create vi 5 72 MC ECU Deselect vi 5 76 MC ECU Disconnect vi 5 78 MC ECU Open vi 5 80 MC ECU Select vi 5 84 MC Event Create vi 5 88 MC Get Names vi 5 92 MC Get Property vi 5 95 poly output values table 5 97 MC Measurement Create vi 5 120 MC Measurement Read vi 5 122 MC Measurement Write vi 5 124 MC Program Reset vi 5 128 MC Program Start vi 5 130 MC Program vi 5 126 MC Set Property vi 5 132 Characteristic specific input values table 5 145 DAQ specific poly input values table 5 143 ECU specific poly input values table 5 134 Measurement specific input values table 5 145 MC Upload vi 5 146 MC XCP Copy Cal Page vi 5 148 MC XCP Get Cal Page vi 5 150 MC XCP Get ID vi 5 152 MC XCP Get Status vi 5 154 MC XCP
140. Program Prepare vi 5 159 MC XCP Program Verify vi 5 161 MC XCP Set Cal Page vi 5 164 MC XCP Set Request vi 5 166 MC XCP Set Segment Mode vi 5 169 mcBuildChecksum 6 6 mcCCPActionService 6 12 mcCCPCalculateChecksum 6 10 mcCCPDiagService 6 14 mcCCPGetActiveCalPage 6 16 mcCCPGetResult 6 17 mcCCPGetSessionStatus 6 18 ECU M amp C Toolkit User Manual Index mcCCPGetVersion 6 19 mcCCPMoveMemory 6 20 mcCCPSelectCalPage 6 22 mcCCPSetSessionStatus 6 23 options table 6 23 mcCharacteristicRead 6 25 mcCharacteristicReadSingle Value 6 26 mcCharacteristicWrite 6 28 mcCharacteristic WriteSingle Value 6 29 mcClearMemory 6 31 mcConversionCreate 6 32 mcDAQClear 6 34 mcDAQInitialize 6 35 mcDAQListInitialize 6 38 mcDAQRead 6 40 mcDAQReadTimestamped 6 43 mcDAQStartStop 6 46 mcDAQWrite 6 48 mcDatabaseClose 6 50 mcDatabaseOpen 6 51 mcDoubleToText 6 52 mcDownload 6 54 mcECUConnect 6 56 mcECUCreate 6 57 mcECUDeselect 6 60 mcECUDisconnect 6 61 mcECUSelectEx 6 62 mcEventCreate 6 65 mcGeneric 6 66 mcGetNames 6 68 mcGetNamesLength 6 70 mcGetProperty 6 72 options table 6 73 mcMeasurementCreate 6 85 mcMeasurementRead 6 87 mcMeasurementWrite 6 88 mcProgram 6 89 mcProgramReset 6 91 mcProgramStart 6 92 mcSetProperty 6 93 ECU M amp C Toolkit User Manual l 6 Characteristic specific options table 6 100 DAQ specific options table 6 100 ECU specific options table 6 94 Measurement spe
141. RefNum DBRefNum is the task reference from the initial database task function The database task reference is originally returned from mcDatabaseOpen ECUName ECUName is the selected ECU name out of an A2L Database file with which to initialize all subsequent tasks Interface Specifies the protocol and optional interface to use for this task Output ECURefNum ECURefNunm is the task reference which links to the selected ECU Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcECUSelect mcECUSelect Ex creates an ECU reference handle to the selected ECU name The Ex function does not start communication This enables you to use mcSetProperty to change the properties of an ECU task After you change properties use mcECUConnec ECU ECU M amp C Toolkit User Manual t to start communication for the task and logically connect to the selected 6 62 ni com Chapter 6 ECU M amp C API for C Interface is the name of the protocol and interface the selected ECU task will use This string
142. SAM CCP Command PROGRAM_6 ECU CCP Optional SELECT Sets whether the ECU Commands CAL PAGE supports the optional ASAM CCP Command SELECT_CAL_PAGE ECU CCP Optional SETS Sets whether the ECU Commands STATUS supports the optional ASAM CCP Command SET_S_STATUS ECU CCP Optional SHORT UP Sets whether the ECU Commands supports the optional ASAM CCP Command SHORT_UP ECU CCP Optional START Sets whether the ECU Commands STOP ALL supports the optional ASAM CCP Command START_STOP_ALL ECU CCP Optional TEST Sets whether the ECU Commands supports the optional ASAM CCP Command TEST ECU CCP Optional UNLOCK Sets whether the ECU Commands supports the optional ASAM CCP Command UNLOCK ECU Misc Timing Sets the timing factor to Factor increase the XCP or CCP Command timeouts by this value For details on the default Command Timeout values refer to the CCP or XCP Protocol Specification National Instruments Corporation 5 139 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 6 ECU Specific Property Value Types for the POLY Input Value Continued Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU XCP SeedKey DLL Sets the file name of the XCP SeedKey DLL ECU XCP Access Method Sets the selected access mode 0x00 Absolute Access Mode default The MTA uses physical addresses 0x01 Functional Access Mode The MTA functions as a bl
143. Start DAQ List Configures the ECU to start sending data for a DAQ task Ensure that the DAQ list has not yet been transferred to the ECU first Once started properties of the DAQ list can no longer be changed using MC Set Property vi This function is performed automatically before the first read of the DAQ list with MC DAQ Read vi Transmit DAQ List to ECU Transfers the DAQ list to the ECU but does not start it For example use this mode if you want to change the session status before starting the DAQ list For some ECUs this is necessary 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 status is TRUE if an error occurred This VI will not execute when status is TRUE National Instruments Corporation 5 55 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred DAQ ref out is the same as DAQ ref in Wire the task reference to subsequent VIs for this
144. TED OR CONTEMPLATED BY NATIONAL INSTRUMENTS THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION INCLUDING WITHOUT LIMITATION THE APPROPRIATE DESIGN PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION Contents About This Manual CONVEMUONS 5 te sessesteetead E E A E TE xiii Related Documentation sssssesseeeeeererersesesssssesrrerereetererrrrresssssssssstttrttterteersresrssssssseeet xiv Activating Your Software How Do I Activate My Software oo cece eseseesecseeececeeeesecseeeseeseesseeseeeaesseeeaeeneeeaes XV What ts ACtivattom soc ceciessccoscuddsstccectes a aa a eaae avec EEE EE ar AAE aE XV What is the NI Activation Wizard cccccccccecccssssessssssssceecescceeesceseesesesssssesenssseeeees XV What Information Do I Need to Activate iccccececesssssessscssceeseecceceeeeecsesesesseessneees XV How Do I Find My Product Serial Number 0 eee eeceeeeceeeeseeseeeeeeeeeaeeeseeaseneeeaes XVi What 18 a Computer ID huan oe tess ei a vac detynstiv by Meradh E dees XVi How Can I Evaluate NI Software seciono tinerimii a a E EE ai xvi Moving Software After Activation isesessssssisiisessscrssrsrcssisereisseisiriisiersrisiissassessteseesre xvii Deactivating a Product nencen NE r IE a e AE A iaa ea ea xvii Using Windows Guest ACCOUNTS oireeseesi pin
145. TaskRef ECURefNum char MeasurementName 64 Values Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx MeasurementName MeasurementName is the name of a Measurement channel stored in the A2L database file to which a Measurement value is to be written Values Writes a single sample for the Measurement channel initialized in MeasurementName Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcMeasurementWrite performs a single point write download of a Measurement into the selected ECU without opening a Measurement task mcMeasurementWrite can only be performed if the Measurement channel is not set to read only To query if an ECU Measurement channel can be accessed by mcMeasurementWrite call mcGet Property with the parameter mcPropMeas_ReadoOnly ECU M amp C Toolkit User Manual 6 88 ni com Chapter 6 ECU M amp C API for C mcProgram Purpose Programs a memory block on
146. Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Generic vi Purpose Sends a generic CCP or XCP command Format timeout ms ECU ref in ECU ref out command error code data return value error in error out buffer size for return value Input Timeout is the time limit in milliseconds during which a specified command must complete ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Command is the CCP or XCP command to be sent to the ECU Data contains a 1 dimensional array of byte information to send to the ECU Buffer size for return value sets the maximum length of the Return value data array 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 EEE Be status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the
147. Toolkit User Manual Chapter 6 ECU M amp C API for C The CLEAR_DAQ_ REQ flag indicates a pending request to clear all DAQ lists in non volatile memory All ODT entries are reset to address 0 extension 0 size 0 and bit_offset FF Session configuration ID is reset to 0 As soon as the request has been fulfilled the slave will reset the appropriate bit The slave device may indicate this by transmitting an EV_CLEAR_DAQ event packet If the slave device does not support the requested mode an ERR_OUT_OF_RANGE is returned The DAQ_ RUNNING flag indicates that at least one DAQ list has been started and is in RUNNING mode The RESUME flag indicates that the slave is in RESUME mode ResourceMask contains the current resource protection status as a bit mask described below Bit Number Flag Description 0 CAL PAG REQuest to STORE CALibration data 0 STORE_CAL_REQ mode is reset 1 STORE_CAL_REQ mode is set Unused DAQ DAQ list commands DIRECTION DAQ O0 DAQ list commands are not protected with SEED amp Key mechanism 1 DAQ list commands are protected with SEED amp Key mechanism STIM DAQ list commands DIRECTION STIM 0 DAQ list commands are not protected with SEED amp Key mechanism 1 DAQ list commands are protected with SEED amp Key mechanism PGM ProGraMming commands 0 ProGraMming commands are not protected with SEED amp Key mechanism 1
148. Transport Layer for instance CAN identifiers on CAN must be chosen in such a way that they build independent and unambiguously distinguishable communication channels The ECU M amp C Toolkit abstracts the XCP communication layer so that it is transparent to the user For most cases it is sufficient that the underlying XCP communication is handled by the toolkit kernel Nevertheless the ECU M amp C Toolkit offers direct access to the low level XCP commands if a non standard timing behavior or independent user defined command sequence is required XCP Protocol Version The ECU M amp C Toolkit supports the XCP Calibration Protocol Specification version 1 0 For further information related to the XCP protocol refer to the XCP Calibration Protocol Specification version 1 0 The Universal Measurement and Calibration Protocol Family Part 1 by ASAM e V National Instruments Corporation 1 3 ECU M amp C Toolkit User Manual Chapter 1 Introduction Measurement and Calibration Databases The ASAP description file ASAP2 or ASAM MCD 2MC is used to describe the ECU internal memory configuration An ASAM MCD 2MC description file with the file extension A2L contains information and access locations for the relevant data objects in the ECU such as e Project relevant information e ECU data structure e Conversion procedures for representation in physical units e Descriptions of the available Measurement channels inside the ECU e Desc
149. U M amp C API for LabVIEW EH 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identif
150. U M amp C Toolkit User Manual 6 24 ni com Chapter 6 ECU M amp C API for C mcCharacteristicRead Purpose Reads all data from a named Characteristic on the ECU which is identified by the ECU Reference handle Format mcTypeStatus mcCharacteristicRead mcTypeTaskRef ECURefNum char CharacteristicName f64 Values u32 NumberOfValues Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx CharacteristicName CharacteristicName is the name of the Characteristic defined in the A2L database file NumberOfValues Specifies the number of values to read To determine the dimension of the Characteristic use the mcGet Property function upfront using the parameter mcPropChar_Dimension To determine the size of each dimension use the mcGet Property function with the parameter mcPropChar_Sizes Output Values Returns a single value a 1 dimensional array or a 2 dimensional array of values for the selected Characteristic Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function o
151. U Open vi or MC ECU Select vi and then wired through subsequent VIs Service No determines the service that is executed inside the ECU For more information about the services that are implemented in the ECU refer to the documentation for the ECU Params passes an array to the ECU that might be needed by the ECU to run the service Since this VI has no knowledge about how the data is interpreted by the ECU you are responsible for providing the data in the correct byte ordering Ee E 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 A status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred National Instruments Corporation 5 11 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Data type is a data type qualifier
152. User Manual 5 30 ni com Chapter5 ECU M amp C API for LabVIEW MC Characteristic Read Single Value vi Purpose Reads a value from a named Characteristic on the ECU which is identified by the ECU Reference handle Format characteristic name ECU ref in ECU ref out x characteristic value error out error in Input database ECU ref in is the task Select vi and then wir Hee BE Characteristic name is the name of the Characteristic defined in the A2L reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU ed through subsequent VIs x is the horizontal index if the Characteristic consists of 1 or 2 dimensions y is the vertical index if the Characteristic consists of 2 dimensions 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 status is TRUI status is TRUE if an error occurred This VI is not executed when code is the error code number identifying an error A value of 0 means Succes s 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
153. VI where the error occurred Description MC XCP Get ID vi implements the XCP command GET_ID and returns session configuration or slave device identification information of the selected ECU slave device The supported types are implementation specific of the ECU slave device The identification string is ASCII text format National Instruments Corporation 5 153 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC XCP Get Status vi Purpose Queries the current session status from an ECU slave device Format session id ECU ref in ECU ref out session status error in resource mask error out Input ECU ref in is the task reference which links to the selected ECU This returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Error in is a cluster w reference is originally hich 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 status is TRUI F if an error occurred This VI will not execute when TE status is TRUE 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
154. W Table 5 5 Poly Values for Value Output Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description DAQ List z CAN ID Select Returns the condition Mode for selecting the CAN ID for the specified DAQ list 0 CAN_ID_FIXED The CAN Identifier is a predefined fixed number 1 CAN_ID_ VARIABLE The CAN Identifier is a variable number 2 CAN_ID_DTO_ID The CAN Identifier is the same as the DTO identifier DAQ List Event Returns the number of Channels allowed event channels for the specified DAQ list em Lemel DAQ List Excluded DAQ Returns an array Lists containing the numbers of DAQ lists not working together with the current DAQ list T g DAQ List First PID Returns the first Packet ID for the specified DAQ list DAQ List MAX Length Returns the maximal length of the DAQ list DAQ List Reduction Returns whether or not Allowed the specified DAQ list allows reduction Aa E ECU M amp C Toolkit User Manual 5 116 ni com Chapter 5 Table 5 5 Poly Values for Value Output Continued ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description Measurement Address Returns the address part of the address of the selected Measurement in the memory of the control unit Measurement Byte Order Returns the specified by
155. YSte mh iis secs cies a a E devas std a aeaa Eae E aaa a 2 5 NI CAN on PXI RT Systemin ioniene ae a i a ai 2 5 NI XNET on PXI RT System sss esssstesdsecseecheisesacessstesdeescestoedesssdeendescacdetbovecestys 2 5 Comp ctRIO Systemi arona oiai ina i dena eceeiieness 2 5 DOS Command Prompt i ciscieccies cesses deat sescdbesctis ed sgiealecepeuses sgcegeeastssadasseeepeeceoans 2 6 Web Browsers nsien iaia EEE E E EEEE i 2 7 LabVIEW Real Time Graphical File Transfer Utility eee 2 7 LabVIEW sieaas esei eel oaa E e aa ae a EEEE E EE S 2 9 Hardware and Software Requirements esssesessssseereeeerestsrestsrtssestesrsresreresresrsresresrsees 2 10 Chapter 3 Application Development Choose the Programming Language sseessesseeesesrsersrserssrstrsrertssestesrnresreresresreererentees 3 1 Lab VIEW sarioa o econ E T atest A 3 1 LabWindows CVI niini nirin aniei fcuk ie a AE A ey 3 1 Wasulall CA Gis EEEE E 3 2 Other Programming Languages 2000 eee eeeeseeeseeeceeeeecececneenseeseeeseseneeaeenaes 3 3 Application Development on CompactRIO or R Series Using an NI 985x or NI 986x C Series Module oo cee cece ceeeesceeceeeesecseeeseeseeeseesseeseeeseeseeeas 3 4 Debugging An Application 03 cscccescecsseesosesseseaeseestiesssusesstessesesesaesdaecsosercdssusescasens 3 6 NIVO Trace iis niria hie Gat Seca Ae eal igen eld ea 3 6 CCP X CPES pins sthcsasesca sats deetoce vs yesusaptesue cites iscuetants sccunnddenae hiceeeg E Ra 3 6 Saving Capture
156. _ACTION_ Sets whether the ECU supports the optional SERVICE CCP Command ACTION_SERVICE u32 mcPropOptCmd_BUILD_ Sets whether the ECU supports the optional CHKSUM CCP Command BUILD_CHKSUM u32 mcPropOptCmd_CLEAR_ Sets whether the ECU supports the optional MEMORY CCP Command CLEAR_MEMORY u32 mcPropOptCmd_DIAG_ Sets whether the ECU supports the optional SERVICE CCP Command DIAG_SERVICE u32 mcPropOptCmd_DNLOAD_6 Sets whether the ECU supports the optional CCP Command DNLOAD_6 u32 mcPropOptCmd_GET_ Sets whether the ECU supports the optional ACTIVE_CAL_PAGE CCP Command GET_ACTIVE_CAL_PAGE u32 mcPropOptCmd_GET_S_ Sets whether the ECU supports the optional STATUS CCP Command GET_S_STATUS National Instruments Corporation 6 97 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 5 ECU Specific Value Types for the PropertyID Input Value Continued Data Type Name Description u32 mcPropOptCmd_GET_SEED Sets whether the ECU supports the optional CCP Command GET_SEED u32 mcPropOptCmd_MOVE Sets whether the ECU supports the optional CCP Command MOVE u32 mcPropOptCmd_PROGRAM Sets whether the ECU supports the optional CCP Command PROGRAM u32 mcPropOptCmd_PROGRAM_6 Sets whether the ECU supports the optional CCP Command PROGRAM_6 u32 mcPropOptCmd_SELECT_ Sets whether the ECU supports the optional CAL_PAGE CCP Command SELECT_CAL_PAGE
157. a acquisition and stimulation ECU M amp C Toolkit User Manual 6 112 ni com Current Session Status SessionStatus contains a bit mask which is described below Chapter 6 ECU M amp C API for C Bit Number Flag Description 0 STORE_CAL_REQ REQuest to STORE CALibration data 0 STORE_CAL_REQ mode is reset 1 STORE_CAL_REQ mode is set 1 Unused 2 STORE_DAQ_REQ REQuest to STORE DAQ list 0 STORE_DAQ_REQ mode is reset 1 STORE_DAQ_REQ mode is set 3 CLEAR_DAQ_ REQ REQuest to CLEAR DAQ configuration 0 CLEAR_DAQ_REQ is reset 1 CLEAR_DAQ_REQ is set 4 Unused 5 Unused 6 DAQ _ RUNNING Data Transfer 0 The data transfer is not running 1 The data transfer is running 7 RESUME RESUME Mode O The slave device is not in RESUME mode 1 The slave device is in RESUME mode The STORE_CAL_REQ flag indicates a pending request to save the calibration data into non volatile memory As soon as the request has been fulfilled the slave will reset the appropriate bit The slave device may indicate this by transmitting an EV_STORE_CAL event packet The STORE_DAQ_ REQ flag indicates a pending request to save the DAQ list setup in non volatile memory As soon as the request has been fulfilled the slave will reset the appropriate bit The slave device may indicate this by transmitting an EV_STORE_DAQ event packet National Instruments Corporation 6 113 ECU M amp C
158. abase use the Database Open and ECU Select VIs Format protocol and interface DB path ECU ref out error in error out interface Input ECU M amp C Toolkit User Manual protocol and interface selects target communication protocol CCP or XCP and the desired interface to use for this task The interface input uses a string xxx yyy where xxx defines one of the two available protocols CCP or XCP and yyy defines the desired interface to use like CANO for CCP or XCP or UDP or TCP for XCP The protocol and interface input is required as this parameter is not defined in the A2L database The default baud rate for CCP or XCP on CAN or the IP address for XCP on UDP TCP may be defined in the A2L database but you can change it by setting the Interface Baud Rate or IP Address property with MC Set Property vi NI CAN The special CAN interface values 256 and 257 refer to virtual interfaces For more information on usage of virtual interfaces refer to the Frame to Channel Conversion section of Chapter 6 Using The Channel API in the NI CAN Hardware and Software User Manual NI XNET If you use NI XNET hardware and select the xxx yyy syntax the ECU M amp C Toolkit uses the XNET NI CAN compatibility library XCL internally if the XNET interface is defined in MAX under NI CAN Devices To force use of the native XNET API you must use the xxx yyy ni_genie_nixnet syntax The interface name is
159. alling this VI you can establish the communication to another ECU defined in the A2L database using MC ECU Select vi National Instruments Corporation 5 77 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC ECU Disconnect vi Purpose Disconnects the CCP or XCP communication to the selected ECU Format ECU ref in ECU ref out error in error out Input ECU M amp C Toolkit User Manual ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Error out describes error conditions I
160. am Interface A set of routines protocols and tools for building software applications An 11 or 29 bit ID transmitted as the first field of a CAN frame The arbitration ID determines the priority of the frame and is normally used to identify the data transmitted in the frame Association of Standardization of Automation and Measurement Systems ASAM MCD 2MC is a file interface standardized by ASAM which describes the internal ECU data interfaces and communication protocols It contains all information about relevant data objects in the ECU like Characteristic variables parameters characteristic curves and maps real virtual measurement variables and variant dependencies For each of these objects information is needed such as storage address record layout data type and conversion rules to convert the data into their physical units ECU M amp C Toolkit User Manual Glossary baudrate byte order C calibration data page CAN CCP CCP master CCP slave Characteristic Checksum DLL Command Receive Object CRO ECU M amp C Toolkit User Manual A user defined property which provides the baud rate at which communication will occur For more information refer to the Interface Properties dialog in MAX or the NI CAN Hardware and Software Manual The baud rate is originally set within MAX The byte order refers to which bytes are most significant in multi byte data types The term describes the order in wh
161. ample rate must be set to zero A SampleRate of zero means mcDAQWrite immediately writes a single sample to the ECU when calling the mcDAQWrite function You must pass NumberOfSamplesToWrite no greater than 1 SampleArray SampleArray specifies a 2D array one array for each channel initialized in the task The array of each channel must have NumberOfSamplesToWrite entries allocated The order of channel entries in SampleArray is the same as the order in the original ChannelList If you must determine the number of channels in the task after initialization get the mcPropDAQ_NumChannels property for the task reference Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 48 ni com Chapter 6 ECU M amp C API for C Description For XCP STIM lists refer to mcDAQInitialize mcDAQWrite transfers an array of samples to the ECU These samples are called data stimulation packets STIM On the ECU side the STIM processor buffers incoming data stimulation packets When
162. an event occurs which triggers a DAQ list in data stimulation mode the buffered data is transferred to the memory on the slave device Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to configure data stimulation National Instruments Corporation 6 49 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcDatabaseClose Purpose Closes a specified A2L Database Format mcTypeStatus mcDatabaseClose mcTypeTaskRef DBRefNum Input DBRefNum DBRefNum is the task reference from the initial database task function The database task reference is originally returned from mcDatabaseOpen Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcDatabaseClose must always be the final ECU M amp C function called for each database task If you do not use the mcDatabaseClose function the remaining task configurations can cause problems in the execution of subsequent Measurement and Calibration applications ECU M amp C Toolkit User M
163. and Key and Checksum Calculation API Version 1 0 The specification defines the Win32 APIs for seed and key calculation and checksum calculation Definition for Seed and Key Algorithm Function name ASAP1A_CCP_ComputeKeyFromSeed Parameter Description 1 Pointer to the seed data retrieved from the ECU GET_SEED command Seed data size in number of bytes Pointer to key data returning the calculated Key data size in number of bytes nA AJN Key data size in number of bytes The calling convention is as defined in the WIN32 API Specification for ASAP Ib section 2 4 National Instruments Corporation ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API Seed and Key Example The following example shows a possible header file for a library for key calculation Header file for ASAPla CCP V2 1 Seed and Key Algorithm 7 ifndef _SEEDKEY_H_ define _SEEDKEY_H_ ifndef DllImport define DllImport __declspec dllimport endif ifndef D11Export define D11Export __declspec dllexport endif ifdef SEEDKEYAPI_IMPL only defined by implementor of SeedKeyApi define SEEDKEYAPI DllExport _ cdecl else define SEEDKEYAPI DllImport _ cdecl endif ifdef _ cplusplus extern C endif BOOL SEEDKEYAPI ASAP1A_CCP_ComputeKeyFromSeed BYTE Seed unsigned short SizeSeed BYTE Key unsigned short Ma
164. annel functions there are a number of ways to access memory content in an ECU The starting point is always the creation of a database task which is the link to a valid ASAM MCD 2MC database file A2L file and the selection of the protocol CCP or XCP With the database task reference it is possible to create an ECU task reference which links to the selected ECU Depending on the application scenario the ECU task reference can be used for the following e Creation of a Measurement task to measure ECU internal data continuously or on demand e Direct read write of 0 to 2 dimensional Characteristics e Read write of single Measurement values on demand What is an ECU Measurement An ECU Measurement called ECU Data Acquisition DAQ in the CCP and XCP specifications is a definition of specific procedures and CAN messages sent from the slave device ECU to the master device for fast data acquisition DAQ The XCP protocol supports synchronous data transfer in both directions from Master to Slave DAQ list and from Slave to Master STIM list XCP allows several DAQ lists which may be simultaneously active The sampling and transfer of each DAQ list is triggered by individual events in the slave To allow reduction of the transfer rate a transfer rate prescaler may be applied to the DAQ lists What is an ECU Characteristic An ECU Characteristic represents an ECU internal memory range with defined access methods through the CCP
165. ans 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 5 128 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Description If you are using the XCP protocol MC Program Reset vi implements the XCP command PROGRAM_RESET This optional command indicates the end of a non volatile memory programming sequence and may or may not have a response from the ECU In either case the slave device will go into a disconnected state MC P
166. anual 6 50 ni com Chapter 6 ECU M amp C API for C mcDatabaseOpen Purpose Opens a specified A2L Database Format mcTypeStatus mcDatabaseOpen cstr Database mcTypeTaskRef DBRefNum Input Database Database is a path to an A2L database file from which to get Measurement or calibration channel names The file must use a A2L extension You can generate A2L database files with several 3rd party tools Output DBRefNum DBRe fNunm is the task reference from the initial database task function The database task reference is originally returned from mcDatabaseOpen Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description The mcDatabaseOpen function does not start communication This enables you to query all defined ECU names in the A2L Database using the mcGetNames function and selecting the property value ECU Names To use the ECU M amp C Toolkit on a LabVIEW RT system you must download your ASAM MCD 2MC database A2L file to the RT target National Instruments Corporation 6 51 E
167. ask reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mc mc ECUDisconnect implements the CCP or XCP command DISCONNECT ECUDisconnect disconnects the specified CCP or XCP slave from the actual communication and ends the calibration session When the calibration session is terminated all CCP or XCP DAQ lists of the device are stopped and cleared and the protection masks of the device are set to their default values mc ECUDisconnect is an optional command as disconnecting from the ECU is performed by the function mcECUDeselect National Instruments Corporation 6 61 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcECUSelectEx Purpose Selects an ECU from the names stored in an A2L database Format mcTypeStatus mcECUSelectEx mcTypeTaskRef DBRefNum cstr ECUName cstr Interface mcTypeTaskRef ECURefNum Input DB
168. ation mode is ECU M amp C Toolkit User Manual 5 162 ni com Chapter5 ECU M amp C API for LabVIEW project specific The master receives the Verification mode from the project specific programming flow control and passes it to the slave MC XCP Program Verify vi implements the optional XCP PROGRAM_VERIFY command defined by the XCP specification For further information on how to program non volatile ECU memory refer to the ASAM XCP Part 2 Protocol Layer Specification National Instruments Corporation 5 163 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC XCP Set Cal Page vi Purpose Sets a calibration page Format mode ECU ref in ECU ref out segment page error out error in Input Mode is a bit mask described below Bit Description The given page is used by the slave device application The slave device XCP driver will access the given page nused nused nused U U Unused U U nused The logical segment number is ignored The command applies to all segments ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Segment specifies the selected logical data segment number Page specifies the logical data page number ECU M amp C Toolkit User Manual 5 164 ni com Chapter5 EC
169. ation purposes str mcPropECU_SeedKey_DAQ Sets the file name of the SeedKey DLL used for DAQ purposes str mcPropECU_SeedKey_Prog_ Sets the file name of the SeedKey DLL used for programming purposes str mcPropECU_SeedKey_XCP Sets the file name of the SeedKey DLL for XCP u8 mcPropECU_Single_Byte_ Sets the ECU to support single byte or DAQ_ Lists multi byte DAQ list entries ECU M amp C Toolkit User Manual 6 96 ni com Chapter 6 ECU M amp C API for C Table 6 5 ECU Specific Value Types for the PropertyID Input Value Continued Data Type Name Description u32 mcPropECU_Station Sets the station address of the slave device CCP Address 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 must 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 u32 mcPropECU_TimingFactor Sets the timing factor which you can use to increase CCP or XCP command timeout values For details on the default Command Timeout values refer to the CCP or XCP Protocol Specification str mcPropIPAddress Sets the IP address for XCP on Ethernet TCP or UDP as a string ul6 mcPropIPPort Sets the IP port for XCP on Ethernet TCP or UDP u32 mcPropOptCmd
170. ative 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 Ec source identi fies the VI where the error occurred ECU M amp C Toolkit User Manual 5 88 ni com Chapter5 ECU M amp C API for LabVIEW ECU ref out is the task reference that links to the selected ECU 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description Use MC Event Create vi to create an Event object in memory instead of referring to a predefined measurement in the A2L database Assign the event channel object by name to a DAQ List in MC Measurement Create vi National Instruments Corporation 5 89 ECU M amp C
171. audRate mcTypeTaskRef ECURefNum DBRefNum is the task reference from the initial database task function The database task reference is originally returned from mcDatabaseOpen Identifies the ECU object Use this name as reference in mcMeasurementCreate to create a DAQ list on the ECU Specifies the protocol and optional interface to use for this task Sets 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 Sets the Command Receive Object CRO CAN Identifier for CCP or XCP on CAN which is used to send commands and data from the host to the slave device Sets the Data Transfer Object DTO CAN Identifier for CCP or XCP on CAN which is used to send commands and data from the slave device to the host Sets the slave device station address 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 must be unique for all ECUs sharing the 6 57 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C 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 BaudRate Sets the CAN baud rate in use by the selected interface This property applies to all tasks initialized with th
172. bVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC Clear Memory vi can be used to erase the FLASH EPROM prior to reprogramming If you are using CCP the CCP Memory Transfer address MTAO pointer is set to the memory location to be erased specified by the parameters Address and Extension MC Clear Memory vi implements the CCP CLEAR_MEMORY command defined by the CCP specification If you are using the XCP protocol MC Clear Memory vi implements the PROGRAM_CLEAR command For further details on how to clear parts of non volatile memory in the ECU refer to the ASAM XCP Protocol Layer Specification ECU M amp C Toolkit User Manual 5 38 ni com Chapter5 ECU M amp C API for LabVIEW MC Conversion Create vi
173. bVIEW source identifies the VI where the error occurred DAQ ref out is the same as DAQ ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description Poly VI Types The name of each Poly VI type uses the following conventions e The first term is either 7 Chan or NChan This indicates whether the type writes data to a single channel or multiple channels NChan types write an array of analogous Chan types one entry for each channel initialized in channel list of MC DAQ Initialize vi 1Chan types are convenient because no array indexing is required but you are limited to writing only one channel e The second term is either Samp or NSamp This indicates whether the type writes a single sample or an array of multiple samples Samp types are often used for single poin
174. bit first ug mcPropChar_lI Datatype Returns the data type of the Characteristic u32 mcPropChar_1 Dimension Returns the dimension of the Characteristic 0 0 dimensional The Characteristic can be accessed read write through a double value 1 1 dimensional The Characteristic can be accessed read write through a one dimensional array of double value 2 2 dimensional The Characteristic can be accessed read write through a two dimensional array of double value ug mcPropChar_ Extension Returns additional address information For instance it can be used to distinguish different address spaces of an ECU multi microcontroller devices f64 mcPropChar_Maximum Returns the Maximum value of the Characteristic f64 mcPropChar_Minimum Returns the Minimum value of the Characteristic National Instruments Corporation 6 73 ECU M amp C API for C ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 4 Values for PropertyID Continued Data Type Name Description u32 mcPropChar_ReadOnly Returns if a Characteristic is set to read only In this case it is not allowed to call mcCharacteristicwrite for this Characteristic u32 mcPropChar_Sizes Returns the Array Sizes for the X and Y directions of the Characteristic str mcPropChar_Unit Returns the unit string defined for this Characteristic in the A2L da
175. bration and data acquisition A single master device host can be connected to one or more slave devices The host must establish a logical point to point connection to the slave device before the slave device may accept commands from the host The slave device must acknowledge each command received from the host within a specified time after the connection between host and slave has been established CCP defines two function sets one for control memory transfer and one for data acquisitions that are independent of each other and may run asynchronously The control commands are used to carry out functions in the slave device and may use the slave to perform tasks on other devices The data acquisition commands are used for continuous data acquisition from a slave device The devices continuously transmit internal data according to a list that has been configured by the host Data acquisition is initiated by the host then executed by the slave device and may be based on a fixed sampling rate or be event driven The communication of controllers with a master device through CCP is based on the CAN 2 0B standard 11 bit and 29 bit identifier which includes 2 0A 11 bit identifier for data acquisition from the controllers memory transfers to the controllers and control functions in the controllers for calibration The ECU M amp C Toolkit abstracts the CCP communication layer so that it is transparent to the user For most cases it is suffic
176. cXCPSetSegmentMode miinaan tenio a n ia 6 124 ECU M amp C Toolkit User Manual X ni com Contents Appendix A Summary of the CCP Standard Appendix B Technical Support and Professional Services Glossary Index National Instruments Corporation xi ECU M amp C Toolkit User Manual About This Manual Conventions This manual provides instructions for using the ECU Measurement amp Calibration ECU M amp C Toolkit It contains information about installation configuration and troubleshooting and also contains ECU M amp C function references for LabVIEW based and C based APIs Use the ECU M amp C Toolkit Installation Guide in the jewel case of the program CD to install the ECU M amp C Toolkit software Use this manual to learn the basics of ECU Measurement and Calibration as well as how to develop an application Q 3 bold italic monospace monospace italic The following conventions appear in this manual The symbol leads you through nested menu items and dialog box options to a final action The sequence Options Settings General directs you to pull down the Options menu select the Settings item and select General from the last dialog box This icon denotes a tip which alerts you to advisory information This icon denotes a note which alerts you to important information Bold text denotes items that you must select or click in the software such as menu items and dialog box options
177. cation protocol CCP or XCP and the desired interface to use for this task The interface input uses a string xxx yyy where xxx defines one of the two available protocols CCP or XCP and yyy defines the desired interface to use such as CANO for CCP or XCP UDP or TCP for XCP The protocol and interface input is required as this parameter is not defined in the A2L database The default baud rate for CCP or XCP on CAN or the IP address for XCP on UDP TCP may be defined in the A2L database but you can change it by setting the Interface Baud Rate or IP Address property with MC Set Property vi NI CAN The special CAN interface values 256 and 257 refer to virtual interfaces For more information about using virtual interfaces refer to the Frame to Channel Conversion section of Chapter 6 Using The Channel API in the NI CAN Hardware and Software User Manual NI XNET By default the ECU Measurement and Calibration Toolkit uses NI CAN for CAN communication This means you must define an NI CAN interface for your NI XNET hardware NI CAN compatibility mode to use your XNET hardware for CAN communication However to use your NI XNET interface in the native NI XNET mode meaning it does not use the NI XNET Compatibility Layer you must define your interface under NI XNET Devices in MAX and pass the NI XNET interface name that the ECU Measurement and Calibration Toolkit will use To do this add ni_genie_nixnet to the Protocol and Interface str
178. ccccccccessssssccecesensnececccsesssseccecesessaeecccessssseceeeesssaaees 5 70 MC ECU Create viiesn oat itr eine Merah Mimi eens 5 72 MG ECU Dese lee V sarteciedl eens a O 5 76 MCEEFECU Di E OE a a ta e er EET E a A E TE 5 78 MG ECU Open Viana n ae a ei io E Aa 5 80 ME ECU Ge EOE s a a a a hateesemnee Be 5 84 MG Event Create Vin sesanan a a a a a cals 5 88 MC Generic Vinnan e a a a S Ae e aR 5 90 MC Get Names Vi cccccccccsssseccccssssscececcessnneecceeessueeeccesesaseeececessseeececeeetseeeeees 5 92 MC Get Property vis sss it 3s cii0t adeensuss cased hand E E EEA E EIE 5 95 MC Measurement Create vi cccccsscccccsssssscecccessssseccecssssseecccessseeeceesessaaeees 5 120 ME Measurement Read Vicen essed ts sec ckd ehh doc cobs eset cts fuedna shes aea Oe 5 122 MC Measurement Wite Vi ccccscccccecesssccccceeesssceecceeesseeeeeceesseesceseessseeeeees 5 124 MC Programivi siivesista sin disk hie tail ier eae Ree ee Rs 5 126 MG Program Reset Vieniigaa R a a ia 5 128 ECU M amp C Toolkit User Manual viii ni com Contents MC Pro granny Stait Vi siececieetss assacnsst desta uiia e EEE AN 5 130 MC Set Property Yleistieto ikonei aeo iii as Tasia 5 132 MC Uplod Vismann anid hii let Senta dial E AEE EA EEEN 5 146 MC XCP Copy Cal Page Vives sectsstseaisevegessscoasvateceescestdovecasesabbaises a 5 148 MC XCP Get Cal Page vis iieccsisseiecitedeuiie ned siti i uaiaadantioncseeeie 5 150 MO XCP Get ID Vi aissses cece ae a seiea
179. ce u32 mcPropDTOID Sets the DTO CAN Identifier Data Transfer Object for CCP or XCP on CAN which is used to send commands and data from the slave device to the host ECU M amp C Toolkit User Manual 6 94 ni com Chapter 6 ECU M amp C API for C Table 6 5 ECU Specific Value Types for the PropertyID Input Value Continued Data Type Name Description u32 mcPropECU_BaudRate Sets the Baud rate in use by the selected interface This property applies to all tasks initialized with the NI CAN or NI XNET 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 can specify advanced baud rates as 8000XXYY hex where YY is the value of Bit Timing Register 0 BTRO and XX is the value of Bit Timing Register 1 BTR1 For more information refer to the Interface Properties dialog in MAX The value of this property is originally set within MAX but it can be changed using mcSet Property u32 mcPropECU_ByteOrder Sets the Byte Order of the slave device O MSB_LAST The Slave device uses the MSB_LAST Intel byte ordering 1 MSB_FIRST The Slave device uses the MSB_FIRST Motorola byte ordering str mcPropECU_Checksum Sets the file name of the Checksum DLL used for verifying the checksum u32 mcPropECU_CmdByteOrder Sets the byte order for multi byte
180. checksum must be calculated TypeOfChecksum TypeOfChecksum specifies the type of the calculated checksum Output Data Data is a byte array upon which the checksum calculation is performed SizeofChecksum SizeofChecksun returns the size in bytes of the calculated checksum Checksum Checksum is the calculated checksum Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 10 ni com Chapter 6 ECU M amp C API for C Description mcCalculateChecksum implements a checksum calculation over a given data block The checksum algorithm is performed over a dedicated checksum function provided by a specific DLL The name of the Checksum DLL is defined in the A2L data base and can be changed by the application by the mcSet Property function using the mcPropECU_Checksum property If you are using the CCP protocol TypeOfChecksum must be set to OxFFh since CCP only supports an external checksum DLL If you are using XCP the following values for TypeOfChecksum are defined in the XCP
181. cific options table 6 101 mcStatusToString 6 102 return codes table 6 102 mcUpload 6 104 mcXCPCopyCalPage 6 106 mcXCPGetCalPage 6 108 mcXCPGetID 6 110 mcXCPGetStatus 6 112 mcXCPProgramPrepare 6 116 mcXCPProgramVerify 6 118 mcXCPSetCalPage 6 120 mcXCPSetRequest 6 122 mcXCPSetSegmentMode 6 124 measurement and calibration databases 1 4 National Instruments support and services B 1 NI Activation Wizard xv NI support and services B 1 0 online software activation 2 4 P privacy policy 2 4 programming examples NI resources B 1 programming languages LabVIEW 3 1 LabWindows CVI 3 1 other 3 3 Visual C 3 2 ni com R R Series application development on using NI 985x or NI 986x C Series module 3 4 reactivation on another system 2 4 reading Characteristics 4 8 related documentation xiv RT configuration DOS prompt 2 6 FTP transfers table 2 6 LabVIEW 2 9 LabVIEW RT graphical file transfer utility 2 7 web browsers 2 7 S sample rate greater than 0 4 12 read sample timing figure 4 12 sample rate 0 4 11 read sample timing figure 4 11 seed and key algorithm 4 19 definition 4 19 example 4 20 for VxWorks targets 4 23 example 4 23 serial number finding xvi Set Get Properties 4 16 setting up an ECU Measurement DAQ Clear 4 13 DAQ Read 4 11 DAQ Start Stop 4 10 DAQ Write 4 12 DTO ID 4 10 ECU DAQ Initialize 4 10 ECU reference handle 4 10 flowchart figure 4
182. cluding negligence Any action against National Instruments must be brought within one year after the cause of action accrues National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control The warranty provided herein does not cover damages defects malfunctions or service failures caused by owner s failure to follow the National Instruments installation operation or maintenance instructions owner s modification of the product owner s abuse misuse or negligent acts and power failure or surges fire flood accident actions of third parties or other events outside reasonable control Copyright Under the copyright laws this publication may not be reproduced or transmitted in any form electronic or mechanical including photocopying recording storing in an information retrieval system or translating in whole or in part without the prior written consent of National Instruments Corporation National Instruments respects the intellectual property of others and we ask our users to do the same NI software is protected by copyright and other intellectual property laws Where NI software may be used to reproduce software or other materials belonging to others you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction Trademarks CVI LabVIEW National Instruments NI ni com the National
183. 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 source identifies the VI where the error occurred Description MC XCP Program Prepare vi may be used to indicate a data download as a pre condition for non volatile memory reprogramming The Memory Transfer address MTA pointer is set to the volatile memory location specified by the parameters Address and Extension The download itself is done by using subsequent standard commands like MC Download vi The slave device must ensure that the target memory area is available and it is in an operational state which permits the download of code If not an error will be returned MC XCP Program Prepare vi implements the optional XCP PROGRAM_PREPARE command defined by the XCP specification For further information on how to program non volatile ECU memory refer to the ASAM XCP Part 2 Protocol Layer Specification ECU M amp C Toolkit User Manual 5 160 ni com MC XCP Program Verify vi Chapter5 ECU M amp C API for LabVIEW Purpose Performs a non volatile memory certification task on the ECU device Format verification mode ECU ref in ECU ref out verification type
184. d the VI returns the value of the error in cluster to error out Segment specifies the selected logical data segment number status is TRUE if an error occurred This VI will not execute when status is TRUE ECU M amp C Toolkit User Manual 5 150 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Page returns the logical data page number d 5 ne 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 status is TRUE if an error occurred 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 hand
185. d Communication Data eee eee ees eeeeeeeeeees 3 8 Capture Options iiissiegsccsscsscea ct resoa esasa epis aSa seernes 3 8 Call History Depth ssisionissonernen aa a a a 3 8 Capturing Data ncesi a a a a 3 8 Selecting Which CCP and XCP Commands to View 3 8 Chapter 4 Using the ECU M amp C API Structure of the ECU M amp C APL rirnori a ae e 4 1 ECU M amp C Channel Fune toisissa r a A 4 2 What is an ECU Measurement s ssseseeeeseeeereersresreserersrrsesresrereseeee 4 2 What is an ECU Characteristic occ eee eeseceeeeeeeeeeseceeeeeeeseeenees 4 2 ECU M amp C CCP and XCP Functions 20 eee eeecesecneceeeeseeneenaeeaeenaes 4 3 Basic Programming Model iv eaae oe i E ANEA SE Eee aeiia 4 3 ECU Operi er on a a aia aia ied AEE EEE N 4 5 ASAM MCD 2MC Communication Properties for CCP or XCP with CAN aene e a oa a a e nls Belk ieee Belk 4 5 CROMD is iis EA AEE E E S E OOE E EE E aes 4 5 DTO Diranna aarti gal ae ALA ane eee 4 5 ECU M amp C Toolkit User Manual vi ni com Contents Station Address ission tes 6 l0h avi ed ds ca a da cad saben cbavbeus ei o aaia 4 5 Bau dtate sc sss a a a cc suedaies doves epi luce Sedat ocedabs aca AA 4 6 ASAM MCD 2MC Communication Properties for XCP With UDP Or TGR raai en aa catalase Sevens ddan E a N E 4 6 IP Address or hostname cescessscesseeeseeceeeeeeeceeeeseeceaeeeseeeeaeeenees 4 6 POrt NUIMDER siete een Aaa E ate leas 4 6 ECU Connect on E eciect avs beties Ee aE E E EEE R aa 4 6 ECU Disconnect a
186. d River Workbench IDE featuring source code level debugging and build management The redistributable GNU tool chain downloadable on ni com offers debugging only at the assembly code level and you must use the included GNU Make to build binaries 3 Note LabVIEW 2009 RT installs version 6 3 of the VxWorks OS to compatible targets All builds should be targeted to corresponding versions and use corresponding header files As new versions of LabVIEW RT become available different versions of VxWorks may be installed and may require you to rebuild your libraries Refer to the readme file for LabVIEW RT to find the corresponding VxWorks OS version Example of a Header for a Seed and Key and Checksum Algorithm for a VxWorks Target The module name of the compiled out file must correspond to the seed and key and checksum function name defined in the ASAM A2L database The following example uses the seed and key module name ccpecu out Therefore the seed and key function is named ccpecu_ASAP1A_CCP_ComputeKeyFromSeed The example uses the prefix in addition to the ASAM standard because the VxWorks OS requires unique function names across all loaded modules Therefore multiple National Instruments Corporation 4 23 ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API modules must not export functions with the same names To support multiple ECUs with the ECU Measurement and Calibration Toolkit each seed and key and checksum fu
187. d adjust them based on your installed FPGA target The default bitfiles are sufficient for a basic ECU M amp C application However in some situations you may need to modify the existing FPGA code or create a custom bitfile For example to use additional I O on the FPGA target you must add these I O to the FPGA VI You must install the LabVIEW FPGA Module to create these files Modify the FPGA VI according to the following guidelines e Do not modify remove or rename any block diagram controls and indicators named __ CANO Rx Data _ CANO Rx Ready _ CANO Tx Data Frame _ CANO Tx Ready _ CANO Bit Timing _ CANO FPGA Is Running _ CANO Start _ CANO FIFO Full or __CANO FIFO Empty If you intend to use multiple CAN 985x modules on your FPGA you need to duplicate and rename all controls and indicators accordingly e Do not modify the CAN read and write code except to filter CAN IDs on the receiving side to minimize the amount of CAN data transfers to the host e As you create controls or indicators ensure that each control name is unique within the VI Refer to the LabVIEW FPGA Module documentation for more information about creating FPGA VIs and bitfiles for an FPGA target When using the ECU M amp C Toolkit on CompactRIO with an NI 985x C Series module the interface name is based on the bitfile you use and the interface name you set For example MyInterface MyBitfile lvbitx CAN lvbitfile lvbitx or CANO mybitfile lvbitx 3
188. d an error the Error out cluster contains the same information Otherwise Error out describes the error status of this VI status is TRUE if an error occurred ECU M amp C Toolkit User Manual 5 68 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Description MC ECU Close vi is the very last VI which must be called It deselects the ECU and closes the remaining database reference handle MC ECU Close vi must always be the final M amp C VI If you do not use MC ECU Close vi the remaining task configurations can cause problems in the execution of subsequent M amp C applications If you just want to deselect the ECU connections call MC ECU Deselect vi National Instruments Corporation 5 69 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC ECU Connect vi Purpose Establishes the communication to the selected ECU through the CCP or XCP protocol After a successful ECU Format Connect you can create a Measurement Task or read write a Characteristic ECU ref in ECU ref out
189. d successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcCCPSetSessionStatus implements the CCP command SET_S_STATUS and is used to keep the ECU informed about the current state of the calibration session The session status bits of an ECU can be read and written Possible conditions are reset on power up session log off and in applicable error conditions The calibration session status is organized as a bit mask with the following assignment Table 6 3 Bit Mask Assignments for Calibration Session Status Bit Name Description 0 CAL Calibration data initialized 1 DAQ DAQ list s initialized 2 RESUME Request to save DAQ set up during shutdown in CCP slave CCP slave automatically restarts DAQ after start up National Instruments Corporation 6 23 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 3 Bit Mask Assignments for Calibration Session Status Continued Bit Name Description 3 Reserved 4 Reserved 5 Reserved 6 STORE Request to save calibration data during shut down in CCP slave 7 RUN Session in progress EC
190. data to the CCP master ECU M amp C Toolkit User Manual 5 144 ni com Characteristic Specific Properties Chapter5 ECU M amp C API for LabVIEW Table 5 8 Characteristic Specific Property Value Types for the PropertyID Input Value Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description Characteristic X Axis Sets the X axis values on which the Characteristic is defined The Characteristic dimension must be at least 1 Characteristic Y Axis Sets the Y axis values on which the Characteristic is defined The Characteristic dimension must be 2 Characteristic Byte Sets the specified byte order of Order 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 Measurement Specific Properties Table 5 9 Measurement Specific Property Value Types for the PropertyID Input Value Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description Measurement Byte Order Sets 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 National Instruments Corporation 5 145 ECU M amp C To
191. dentifying 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 source identifies the VI where the error occurred Output DB reference out is the task reference which links to the opened database i file 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 status is TRUE if an error occurred ECU M amp C Toolkit User Manual 5 62 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Description Opens a specified A2L Database MC Database Open vi enables you to query all defined ECU names in the A2L Database using the MC Get Names vi and selecting the property ECU Names MC Database Open vi does not start comm
192. diagnostic service Result contains the information returned from the diagnostic service uploaded from the ECU by the CCP master 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 Jee E status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC CCP Diag Service vi implements the CCP command DIAG_SERVICE which starts a diagnostic service on the ECU and waits until it is finished The selected Service no specifies the diagnostic service that is executed inside the ECU For more information about the available services that are implemented in the ECU refer to the documentation for the ECU ECU M amp C Toolkit User Manual 5 14 ni com Chapter5 ECU M amp C API for LabVIEW MC CCP Get Active Cal Page vi Purpose Retrieves the ECU Memory Transfer Address pointer to the calibration data page CCP only Format ECU ref in ECU ref out t address error i
193. 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Major version returns the major version number of the CCP implementation Minor version returns the minor version number of the CCP implementation National Instruments Corporation 5 21 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Error out describes error conditions If the Error in cluster indicated an H error the Error out cluster contains the same information Otherwise Error out describes the error status of this VI status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC CCP Get Version vi can be used to query the CCP version implemented in the ECU This command
194. e mcPropChar_X_Axis Sets the X axis values on which the Characteristic is defined The Characteristic dimension must be at least 1 ECU M amp C Toolkit User Manual 6 100 ni com Chapter 6 ECU M amp C API for C Table 6 7 Characteristic Specific Value Types for the PropertyID Input Value Continued Data Type Name Description double mcPropChar_Y_Axis Sets the Y axis values on which the Characteristic is defined The Characteristic dimension must be 2 u32 mcPropChar_ByteOrder Sets the specified byte order of the selected 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 Measurement Specific Properties Table 6 8 Measurement Specific Value Types for the PropertyID Input Value Data Type Name Description u32 mcPropMeas_ByteOrder Sets 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 National Instruments Corporation 6 101 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcStatusToString Purpose Converts a status code into a descriptive string Format mcTypeStatus mcStatusToString mcTypeTaskRef Status u32 Size
195. e 6 4 Values for PropertyID Continued Data Type Name Description f64 mcPropMeas_Maximum Returns the maximum value of the Measurement f64 mcPropMeas_Minimum Returns the minimum value of the Measurement u32 mcPropMeas_ReadOnly Returns TRUE if the selected Measurement is read only and can only be accessed through mcMeasurementRead or returns FALSE if the Measurement can be accessed through mcMeasurementWrite as well str mcPropMeas_Unit Returns the unit string defined for this Measurement in the A2L database u32 mcPropMeas_Unit_Size Returns the number of bytes to be allocated if you call mcGet Property with the parameter mcPropMeas_Unit u32 mcPropOptCmd_ACTION_ Returns whether the ECU supports the optional SERVICE CCP Command ACTION_SERVICE u32 mcPropOptCmd_BUILD_ Returns whether the ECU supports the optional CHKSUM CCP Command BUILD_CHKSUM u32 mcPropOptCmd_CLEAR_ Returns whether the ECU supports the optional MEMORY CCP Command CLEAR_MEMORY u32 mcPropOptCmd_DIAG_ Returns whether the ECU supports the optional SERVICE CCP Command DIAG_SERVICE u32 mcPropOptCmd_DNLOAD_6 Returns whether the ECU supports the optional CCP Command DNLOAD_6 u32 mcPropOptCmd_GET_ Returns whether the ECU supports the optional ACTIVE_CAL_PAGE CCP Command GET_ACTIVE_CAL_PAGE u32 mcPropOptCmd_GET_S_ Returns whether the ECU supports the optional STATUS CCP Command GET_S_ST
196. e NI CAN or NI XNET 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 can specify advanced baud rates as 8000XXYY hex where YY is the value of Bit Timing Register 0 BTRO and XX is the value of Bit Timing Register 1 BTR1 For more information refer to the Interface Properties dialog in MAX Output ECURef Num ECURef Num is the task reference that links to the selected ECU Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description The function mcECUCreate is used to create an ECU object in memory instead of referring to a predefined ECU of an A2L database Interface is the name of the protocol and interface the selected ECU task will use This string uses the syntax XXX YYY where X defines the selected protocol The following strings may be used as Y e String CCP refers using the CAN Calibration Protocol CCP e String XCP refers using the Universal Measurement and Calib
197. e attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 32 ni com Chapter 6 ECU M amp C API for C Description Use mcConversionCreate to create a conversion object in memory instead of referring to measurement properties defined in the A2L database National Instruments Corporation 6 33 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C meDAQClear Purpose Stops communication for the Measurement task and clears the task Format mcTypeStatus mcDAQClear mcTypeTaskRef DAQRefNum Input DAQRefNum DAQRefNum is the task reference which links to the selected Measurement task This reference is originally returned from mcDAQInitialize Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcDAQClear must always be the final function called for a Measurement task If you do not use mcDAQC lear the remaining Measurement task configuration can cause problem
198. e file name of Name the SeedKey DLL used for Calibration purposes ECU CCP SeedKey DAQ Returns the file name of Name the SeedKey DLL used for DAQ purposes ECU CCP SeedKey Prog Returns the file name of Name the SeedKey DLL used for programming purposes ECU CCP Single Byte Determines if an ECU DAQ List supports single byte or multi byte DAQ list entries ECU CCP Station Returns the Station Address 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 must 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 ECU M amp C Toolkit User Manual 5 102 ni com Table 5 5 Poly Values for Value Output Continued Chapter 5 ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU CCP Misc Skip EXCHANGE ID Returns a Boolean value that indicates whether or not the EXCHANGE_ID command should be suppressed during connection to the ECU ECU CCP Optional Commands ACTION SERVICE Returns a Boolean value that indicates whether the ECU supports the optional CCP Command ACTION_SERVICE ECU CCP Optional Commands
199. e 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 source identifies the VI where the error occurred Description MC ECU Open vi opens a specified A2L database and selects the first ECU found in the database If there are several ECUs stored in the A2L database use MC Database Open vi and MC ECU Select vi to select a specific ECU Possible selections for the interface and protocol parameter for the various hardware targets are as follows Using CAN hardware CCP CAN0 uses CCP on CAN interface 0 CCP CAN1 uses CCP on CAN interface 1 and so on with the form CANx CCP CAN256 uses CCP on virtual CAN interface 256 CCP CAN257 uses CCP on virtual CAN interface 257 XCP CANO0 uses XCP on CAN interface 0 XCP CAN1 uses XCP on CAN interface 1 and so on with the form CANx XCP UDP uses XCP on UDP XCP TCP uses XCP on TCP Using NI XNET hardware CCP CANI1 ni_genie_nixnet uses CCP on CAN interface 1 CCP CAN2 ni_genie_nixnet uses CCP on CAN interface 2 and so on with the form CANx XCP CANI1 ni_genie_nixnet uses XCP on CAN interface 1 ECU M amp C Toolkit User Manual 5 82 ni com Chapter5 ECU M amp C API for LabVIEW e XCP CANI1 ni_genie_nixnet
200. e previous Measurement task VI The task reference is originally returned from MC DAQ Initialize vi and then wired through subsequent Measurement task VIs Number of samples specifies the number of samples to write for the Measurement task For single sample Poly VI types MC DAQ Write vi always returns one sample so this input is ignored Value is a poly output that writes samples to the ECU STIM list The type of the poly output is determined by the poly VI selection For information on the different poly VI types provided by MC DAQ Write vi refer to the Poly VI Types section 2 A E or To select the data type right click the VI go to Select Type and select the type by name 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 A status is TRUE if an error occurred This VI will not execute when status is TRUE 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 National Instruments Corporation 5 57 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for La
201. e specifies the logical segment number of the destination data page Destination segment specifies logical page number of the destination data page 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 EEE EER status is TRUE if an error occurred This VI will not execute when status is TRUE ECU M amp C Toolkit User Manual 5 148 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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
202. eLearning NI offers complementary membership for a full year after purchase after which you may renew to continue your benefits For information about other technical support options in your area visit ni com services or contact your local office at ni com contact e Training and Certification Visit ni com training for training and certification program information You can also register for instructor led hands on courses at locations around the world e System Integration If you have time constraints limited in house technical resources or other project challenges National Instruments Alliance Partner members can help To learn more call your local NI office or visit ni com alliance You also can visit the Worldwide Offices section of ni com niglobal to access the branch office Web sites which provide up to date contact information support phone numbers email addresses and current events National Instruments Corporation B 1 ECU M amp C Toolkit User Manual Glossary Symbol Prefix Value m milli 10 3 k kilo 103 M mega 106 Numbers 2MC A2L See ASAM MCD 2MC database file A A2L file address extension API arbitration ID ASAM ASAM MCD 2MC National Instruments Corporation G 1 ECU device database file in ASAM MCD 2MC format An additional parameter to the address that may be used to switch between data of several memory banks Application Progr
203. eaten ae eE A TE 6 57 MeECUDeselect een a A EA Ei SEEST 6 60 mMCcECUDISCONNEC oemei ainei ee e Ea EEE EEE EEKE E 6 61 MECECUSelectEX erener E EREE E E E EE 6 62 mcEyentEredtes nno aa aaa R ha aa tie a O Sea need Me 6 65 EE AIE OREO T E E EERE EEE 6 66 INCGELN AIMS iki e ana aA AEE EE AEE EEEE 6 68 meGetNameslen gt siinne tse i E E a 6 70 MC GetProperty ars ieninieieninio eripiat e EE E TEA AA EE ENEE 6 72 MCMeasurement Create si iniii rinan aa i opio i aita 6 85 MCMeasureMentReads oroia e e a EE RE sts 6 87 MCMeasurement Writers oaea scien deassatetavagedeasdesecedesdedaaieeaoedoes Ge agecewvangs 6 88 WMNICPLO SAM ario edsiate Aas Adee seeta dh saa bs had sede ee eoeiseed otua beens Ni eceed uaeas 6 89 MCProsramReset sisicecs ccssisicsevssiecdsiseisestdsoseshedessavedeedicay ce ve EE a SEKE aR EESE aie 6 91 meProgramStart ensesine Eai EE E T ES 6 92 MCSetProperty eeann a a a i a A E a 6 93 MCS tatus TOS tgs aiiis ahs Aee e a R EE E RA EE 6 102 MEUploAd rsi esaer sies s aaa E aa aoas r EEE E OE EEE RRE E Ei a 6 104 mcXCPCopyCalPage niei aoran a EE Ea TE aa 6 106 MeEXCP Getal Pages n i a a a 6 108 mcXCPGetID eo scien eal n e ad oe We EAA Shae dee 6 110 MCX CPG Status iced seesiases an aa aE aaa ra aa Eaa NEERA VERRES sade 6 112 meXCPProgramPrepare siias ieee a i sven NEE EEs 6 116 MeXCPProgram Verify sotiras iiia a E E 6 118 meXCPSetCal Pagen hiriran e E E A EAE 6 120 MeXCPSetR g est srli oiiaee riihi eves aara EER KEES TIETES i piat 6 122 m
204. ect the CCP XCP commands to spy on select Spy Options then select the commands under Capture Commands Captures all CCP XCP commands DAQ Messages Captures all DAQ list commands ECU measurement commands STIM Messages Captures all STIM list ECU slave stimulation commands 3 8 ni com Using the ECU M amp C API This chapter helps you get started with the ECU M amp C API Structure of the ECU M amp C API The ECU M amp C API is divided into three main function categories the high level Channel based functions and the generic low level CCP and XCP functions The ECU M amp C Channel functions provide an easy way to access ECU internal data through named channels The ECU M amp C CCP functions provide direct access to the CCP commands on a very low programming level The ECU M amp C XCP functions provide direct access to the XCP commands on a very low programming level Figure 4 1 outlines the three function categories ECU M amp C Toolkit y y y Channel Functions CCP Functions XCP Functions y Database Task y ECU Task Yy v y Y Y Measurement Rw DAQ Task Characteristic rw CCP Commands XCP Commands Figure 4 1 ECU Architectural Overview National Instruments Corporation 4 1 ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API ECU M amp C Channel Functions ECU M amp C Toolkit User Manual With the ECU M amp C Ch
205. ected segment into the specified mode If Mode 0 the segment disables the FREEZE mode if Mode 1 the segment is set to FREEZE mode through an XCP STORE_CAL_REQ operation Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request ECU M amp C Toolkit User Manual 6 124 ni com Summary of the CCP Standard Controller Area Network CAN Bosch developed the Controller Area Network CAN in the mid 1980s Using CAN devices controllers sensors and actuators are connected on a common serial bus This network of devices can be thought of as a scaled down real time low cost version of the networks used to connect personal computers Any device on a CAN network can communicate with any other device using a common pair of wires As CAN implementations increased in the automotive industry CAN was standardized internationally as ISO 11898 CAN chips were created by major semiconductor manufacturers such as Intel Motorola and Philips With these developments manufacturers of industrial automation equipment began to consider CAN for use in industrial applications Comparison of the requirements for automotive and industrial device networks showed numerous similarities including the transition away from dedicated signal lines low cost resistance to harsh environments and high real time capabilities CAN Calibration Protocol CCP The amount of electronics introduced into the automobi
206. ed 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 source identifies the VI where the error occurred National Instruments Corporation 5 25 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC CCP Select Cal Page vi implements the CCP command SELECT_CAL_PAGE The operation of the command depends on the ECU implementation ECU M amp C Toolkit User Manual 5 26 ni com Chapter5 ECU M amp C API for LabVIEW MC CCP Set Session Status vi Purpose Updates the ECU with the current state of the calibrat
207. ee types of DTOs PID Type 0x00 OxFD Data Acquisition Message OxFE Event Message OxFF Command Return Message Command Return Messages and Event Messages have the following structure 0 1 2 3 4 5 6 7 PID ERR Parameter and Data Field National Instruments Corporation A 3 ECU M amp C Toolkit User Manual Appendix A Summary of the CCP Standard In the case of an Event Message the Counter field does not contain valid data and must be ignored by the host For Command Return Messages the Counter field must have the same value as the counter field of the corresponding CRO The error field contains information about the error state The parameter and data fields contain the data returned from the slave device to the host Command Return Messages and Event Messages consist of eight bytes Data Acquisition Messages DAQ Messages or DAMs have a PID in the first byte and the rest of the message contains data DAMs may be shorter than eight bytes 2 3 4 5 6 7 PID Parameter and Data Field ECU M amp C Toolkit User Manual Since the PIDs 0x00 OxFD are reserved for Data Acquisition Messages a CCP slave device can send up to 253 different DAMs Each DAQ message can transfer up to seven bytes of data The number of DAQ Messages supported by a slave device depends on the device itself Data acquisition is performed through a CCP slave device by reading data from a device s memory and copying it
208. eeessessaeeseeseeeeenseens 4 19 Definition for Seed and Key Algorithm eee eeeeeeeeees 4 19 Seediand Key Example erros hea iiaia del seg caine 4 20 Checksum Algorithm sics s ssesces cecil ectegsscastesdeeocebaaseaeseaseadbeeacassstes 4 21 Seed and Key and Checksum Algorithms for VxWorks Targets 4 23 Chapter 5 ECU M amp C API for LabVIEW Section Heading Sann ron ann R santas deg sg sebeee E R A 5 1 PULPOSC aii e ethan eek ao ev ated AR a E EA E BLN LA 5 1 Oral E ids cabs caades sed od cae anc sande shsesctesteabecutastegsensieidfespbessdhes alder iesstay 5 1 Inputiand Output eiro iienaa E peleceiss adherence dian veined 5 1 Descriptions a a a E E oi nteaateasen cused estes 5 1 National Instruments Corporation vii ECU M amp C Toolkit User Manual Contents I ER Of A REEE PA esses AO Sa cusses ee sgn E SEE E TE TART 5 1 MC Build Checksum Vi ccccccsssccccecsesscecccesessceeceeceessseeeeecessseeeeeeeesssseeeees 5 5 ME Cale Cheek sum V e Ged Beceerielh ihe ices ek hatha ibs 5 8 MC CCP Action Service Vi cccccccccsssssccccessssseccceessssececccesssaeeeccecessseeeceesesseeeees 5 11 MC CCP Diag Service Pi nicissita iiis ora coved ER E AEA Seu 5 13 MC CCP Get Active Cal Page View eee cesecesseceseeeceeeesecsseeseesaeesesseeeaeenaes 5 15 MCG CCP Get Resultiva ee jicesanttss csipeccecau E bonsvonuen sas geueetes 5 17 MC CCP Get Session Status Vi cccccccccccssssseccceesssecceecesssecececeesseeeceseessseeeeees 5
209. efer to the ASAM XCP Part 2 Protocol Layer Specification or CAN Calibration Protocol Version 2 1 specification documents 3 7 ECU M amp C Toolkit User Manual Chapter 3 Application Development ECU M amp C Toolkit User Manual Saving Captured Communication Data To save the information displayed in the CCP XCP Spy capture window select File Save As In the dialog box that appears select a name for the capture file A xlg extension usually is used for saving CCP XCP Spy capture information The CCP XCP Spy log is stored in ASCII format so you can view the x1g file in any ASCII editor Capture Options To view or modify the CCP XCP Spy capture options select Spy Options By default CCP XCP Spy displays 250 calls in the capture window Call History Depth The call history depth reflects the maximum number of API calls that CCP XCP Spy can display When the number of captured API calls exceeds the call history depth only the most recent calls are kept Capturing Data By default capture is activated when you open CCP XCP Spy When capture is off the blue arrow start button is enabled When capture is on the red X stop button is enabled To turn capture on click the blue arrow button on the toolbar To turn capture off click the red button on the toolbar Selecting Which CCP and XCP Commands to View You can specify which command you want to spy on at any time By default CCP XCP commands are enabled To select desel
210. ement task data type Data Type can contain the following values Data Type Data Format 0 1 nH nn A W N Unsigned byte Signed byte Unsigned word Signed word Unsigned long Signed long Float 32 ECU ref out is the task reference that links to the selected ECU 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 Description status is TRUE if an error occurred 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 source identifies the VI where the error occurred Use MC Measurement Create vi to create a measurement object in memory instead of referring to a predefined measurement in the A2L database National Instruments Corporation 5 121 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Measurement Read vi Purpose Reads a single Measurement value from the ECU Format measurement name ECU ref in ECU ref out value ere error out Input ECU M amp C Toolkit User Manual Measurement name is
211. ended 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC XCP Program Verify vi may be used to verify the success of non volatile memory reprogramming With Verification mode set to 00 the master may request the slave to begin internal test routines to check whether the new flash contents fits to the rest of the flash Only the result is of interest With Verification mode set to 01 the master may tell the slave that it will be sending a Verification value to the slave The definition of the Verific
212. eneric CCP Functions Generic XCP Functions ECU Disconnect ECU Close ECU M amp C Toolkit User Manual Figure 4 2 ECU Communication Decision Chart 4 4 ni com Chapter 4 Using the ECU M amp C API ECU Open The ECU Open function combines the opening of a selected ASAM MCD 2MC database file with the A2L file extension and the selection of a stored ECU name The required parameters are the ASAM MCD 2MC database path and filename and the dedicated CAN interface if you are using CCP or XCP with CAN The CAN interface is used for communication with the ECU If you are using XCP with UDP or TCP a port number and IP address or hostname must be defined in the A2L database The function to open and select an ECU is MC ECU Open vi in LabVIEW or mcDatabaseOpen followed by mcECUSelectEx in C 3 Note The import of ASAM MCD 2MC database files into MAX is not supported ASAM MCD 2MC Communication Properties for CCP or XCP with CAN If your ASAM MCD 2MC database file already contains communication properties you can directly open the communication to your selected ECU If the communication properties are not stored in the ASAM MCD 2MC file the communication properties must be manually set To establish communication through CCP or XCP with CAN the target ECU slave should be addressed by setting the following properties CRO ID The CRO ID Command Receive Object is used to send commands and data from the host
213. er Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcCharacteristicWrite writes the value s of a named Characteristic to an ECU identified by the ECU reference handle ECURefNum ECU M amp C Toolkit User Manual 6 28 ni com Chapter 6 ECU M amp C API for C mcCharacteristicWriteSingleValue Purpose Writes a single value to a named Characteristic on the ECU Format mcTypeStatus mcCharacteristicWriteSingleValue mcTypeTaskRef ECURefNum char CharacteristicName 64 Value u32 X u32 Y Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx CharacteristicName CharacteristicName is the name of the Characteristic defined in the A2L database file to which the values are written Value Value contains the value which is sent to the ECU X X refers to the array offset of the Characteristic defined in the A2L database file as 1 or 2 dimensional If the Characteristic is defined as 0 dimensional you can set x to 0 Y Y refers to the array offset of the Characteristic defined in the A2L
214. erence which links to the selected ECU This reference is originally returned from mcECUSelectEx ServiceNo ServiceNo determines the service that is executed inside the ECU For more information about the services that are implemented in the ECU refer to the documentation for the ECU Params Params passes the parameters of the service function as an array of bytes to the ECU Since the parameters and their data types are specific to the ECU implementation you are responsible of providing the required parameters in the correct byte ordering Output ResultLength ResultLength indicates the amount of data that can be uploaded from the ECU as a result of the execution of the service The result of this service can be accessed by calling the function mcCCPGetResult right after mcCCPActionService DataType DataType is a data type qualifier that determines the data format of the result Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 12 ni com Chapter 6 ECU M amp C API
215. es the value s of a named Characteristic to an ECU identified by the ECU ref handle The Poly VI writes the selected type double 1D or 2D array Format characteristic name ECU ref in ECU ref out characteristic t error in rror au Input Characteristic name is the name of a Characteristic stored in the A2L database file to which one or more values may be written ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Characteristic writes the data for the Characteristic channel initialized by Characteristic name Characteristic values are listed in the Poly VI Types section 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 status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred National Instrument
216. es to initialize as a Measurement task Each channel name is provided in an array entry ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs LEFI Mode specifies the I O mode for the task For an overview of the I O modes including figures refer to the Basic Programming Model section of Chapter 4 Using the ECU M amp C API E EE Mode 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 a sample rate 0 or as waveform using a sample rate gt 0 Input channel data are received from the DAQ messages Use MC DAQ Read vi to obtain input samples as single point array or waveform Mode 1 Polling In this mode the data from the Measurement task are acquired from the ECU whenever the MC DAQ Read vi is called Mode 2 STIM List In this mode the data from the Measurement task are sent to the ECU whenever MC DAQ Write vi is called National Instruments Corporation 5 43 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW ECU M amp C Toolkit User Manual Mode 3 Timestamped read The data is transmitted from the ECU in equidistant time intervals as defined in the A2L database The data can be read back with MC DAQ Read vi as timestamped data ar
217. etailed information on how to use virtual NI CAN ports Using NI XNET If you are using NI XNET hardware and select the xxx yyy syntax the ECU M amp C Toolkit uses the XNET NI CAN compatibility library XCL internally if the XNET interface is defined in MAX under NI CAN Devices To force use of the native XNET API you must define a unique interface name that differs from the NI CAN compatible interface name under XNET Devices or use the xxx yyy ni_genie_nixnet syntax The interface name is related to the NI XNET hardware naming under Devices and Interfaces in MAX The extension ni_genie_nixnet directs the ECU M amp C Toolkit to use the native NI XNET API CompactRI0O or R Series If you are using CompactRIO or R Series hardware you must provide a bitfile that handles the CAN communication between the host system and the FPGA To access the CAN module on the FPGA you must specify the bitfile name after the for example CCP CANI1 MyBitfile lvbitx To specify a special RIO target you can specify that target by its name followed by the bitfile name for example XCP CAN RIO1 MyBitfile lvbitx Currently only a single CAN interface is supported RIO1 defines the RIO target name as defined in your LabVIEW Project definition The vbitx filename represents the filename and location of the bitfile on the host You may use just the filename without the folder if the bitfile is in the same folder as the LabVIEW Project vproj Nationa
218. etermines the diagnostic service that is executed inside the ECU For more information about the services that are implemented in the ECU refer to the documentation for the ECU Params passes an array to the ECU that might be needed by the ECU to run the service Since this VI has no knowledge about how the data is interpreted by the ECU you are responsible for providing the data in the correct byte ordering Ee E 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 A status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred National Instruments Corporation 5 13 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Data Type returns a Data Type Qualifier which provides information about the data type of the result of the
219. ethod for mcProgram 0 Sequential programming default Ox80 0xFF User defined National Instruments Corporation 6 99 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 6 DAQ Specific Value Types for the PropertyID Input Value Data Type Name Description u32 mcPropDAQ_DTO_ID Sets the DTO ID Data Transmission Object which is used by the ECU to respond to send data from the DAQ lists to the CCP master abc mcPropDAQ_ EventChannel Sets the selected event channel name to which Name the Measurement task is assigned 132 mcPropDAQ_ Mode Sets the mode of an M amp C Measurement task 0O 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 mcDAQRead as Single point data using sample rate 0 or as waveform using a sample rate gt 0 Input channel data is received from the DAQ messages Use mcDAQRead 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 mcDAQRead is called ul6 mcPropDAQ Prescaler Sets the Prescaler which reduces the desired transmission frequency of the associated DAQ list Characteristic Specific Properties Table 6 7 Characteristic Specific Value Types for the PropertylD Input Value Data Type Name Description doubl
220. eturns samples from the messages received since the previous call to CAN Read vi National Instruments Corporation 5 53 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW The number of samples returned is indicated in the number of samples returned output up to a maximum of number of samples to read messages If no new message has been received the number of samples returned is 0 and error out indicates success Because the timing of values in samples is determined by when the message is received the sample rate input is not used with this poly VI type To determine the number of channels in the task after initialization get the Number of Channels property for the task reference ECU M amp C Toolkit User Manual 5 54 ni com Chapter5 ECU M amp C API for LabVIEW MC DAQ Start Stop vi Purpose Starts or stops transmission of the DAQ lists for the specified Measurement task Format DAQ ref in DAQ ref out mode error in error out Input DAQ ref in is the task reference from the previous Measurement task VI The task reference is originally returned from MC DAQ Initialize vi and then wired through subsequent Measurement task VIs mode indicates the type of function to be performed Stop DAQ List Configures the ECU to stop transmitting a DAQ task If stopped properties of the DAQ task can be changed using MC Set Property vi This function is performed automatically before MC DAQ Clear vi
221. event packet The CLEAR_DAQ_ REQ flag indicates a pending request to clear all DAQ lists in non volatile memory All ODT entries are reset to address 0 extension 0 size 0 and bit_offset FF Session configuration ID is reset to 0 As soon as the request has been fulfilled the slave will reset the appropriate bit The slave device may indicate this by transmitting an EV_CLEAR_DAQ event packet If the slave device does not support the requested mode an ERR_OUT_OF_RANGE is returned The DAQ_ RUNNING flag indicates that at least one DAQ list has been started and is in RUNNING mode The RESUME flag indicates that the slave is in RESUME mode ECU M amp C Toolkit User Manual 5 156 ni com Chapter5 ECU M amp C API for LabVIEW Resource mask contains the current resource protection status as a bit mask described below Bit Number Flag Description 0 CAL PAG REQuest to STORE CALibration data 0 STORE_CAL_REQ mode is reset 1 STORE_CAL_REQ mode is set 1 Unused 2 DAQ DAQ list commands DIRECTION DAQ 0 DAQ list commands are not protected with SEED amp Key mechanism 1 DAQ list commands are protected with SEED amp Key mechanism 3 STIM DAQ list commands DIRECTION STIM 0 DAQ list commands are not protected with SEED amp Key mechanism 1 DAQ list commands are protected with SEED amp Key mechanism 4 PGM ProGraMming commands 0 ProGraMming commands are not protected
222. f BOOL CHECKSUMAPI CalcChecksum struct TRange ptr int nRanges BYTE pnChecksum int pnSignificant WORD nFlags ifdef _ cplusplus endif endif _CHECKSUM_H ECU M amp C Toolkit User Manual 4 22 ni com Chapter 4 Using the ECU M amp C API Seed and Key and Checksum Algorithms for VxWorks Targets LabVIEW RT users can run the ECU Measurement and Calibration Toolkit on either a LabVIEW RT target such as a PXI controller or an Intel based CompactRIO running the Pharlap operating system which supports Win32 calls or on a PowerPC based CompactRIO controller running a Windriver VxWorks operating system If you are using a CompactRIO target with a PowerPC controller running a VxWorks operating system you cannot use any Win32 function calls based on a DLL However the GNU tool chain distributed with VxWorks can compile shared libraries for controllers running Wind River VxWorks including the CompactRIO 901x and 907x series You can access the shared libraries oUT modules for VxWorks through the ECU Measurement and Calibration Toolkit by using a C C function definition that is slightly different from the ASAM specification due to the differences between Win32 DLLs and VxWorks OUT modules You can obtain the GNU tool chain for VxWorks by either purchasing a VxWorks development license from Wind River or downloading the redistributable GNU tool chain from ni com If you purchase VxWorks you can use the Win
223. f a Measurement into the selected ECU without opening a Measurement task MC Measurement Write vi can only be performed if the Measurement is not set to read only To query if an ECU Measurement channel can be accessed by MC Measurement Write vi first call MC Get Property vi with the parameter Measurement Read Only National Instruments Corporation 5 125 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Program vi Purpose Programs a memory block on the ECU Format ECU ref in ECU ref out address data error out error in Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Address is a cluster which contains the following values ue Address specifies the address part of the destination address Extension contains the extension part of the destination address Data contains the byte array to be transmitted to the ECU 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 He status is TRUE if an error occurred This VI is not executed when status is TRUE 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 pos
224. f the ECU M amp C API to obtain a descriptive string for the return value Description mcCharacteristicRead reads values from a named Characteristic on the ECU which is identified by the ECU Reference handle The function returns a double 1D or 2D array National Instruments Corporation 6 25 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcCharacteristicReadSingleValue Purpose Reads a single value from a named Characteristic on the ECU which is identified by the ECU Reference handle Format mcTypeStatus mcCharacteristicReadSingleValue mcTypeTaskRef ECURefNum char CharacteristicName 64 Value u32 X u32 Y Input ECURefNum ECURefNumn is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx CharacteristicName CharacteristicName is the name of the Characteristic defined in the A2L database file x X is the horizontal index if the Characteristic consists of 1 or 2 dimensions Y Y is the vertical index if the Characteristic consists of 2 dimensions Output Value Returns a single value from the selected Characteristic Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function per
225. f 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 status is TRUE if an error occurred 5 78 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Description MC ECU Disconnect vi implements the CCP or XCP command DISCONNECT MC ECU Disconnect vi permanently disconnects the specified CCP or XCP slave from the communication and ends the calibration session When the calibration session is terminated all DAQ lists of the device are stopped and cleared and the protection masks of the device are set to their default values MC ECU Disconnect vi is an optional function and is automatically performed prior to any MC ECU Deselect vi or MC ECU Close vi call National Instruments Corporation 5 79 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC ECU Open vi Purpose Opens a specified A2L database and selects the first ECU found in the database If there are several ECUs stored in the A2L dat
226. fic 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 Table 5 6 for a list of ECU specific properties that can be used to define the poly input value National Instruments Corporation 5 133 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW 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 Table 5 7 for a list of DAQ specific properties that can be used to define the poly input value Poly VI Types Table 5 6 ECU Specific Property Value Types for the POLY Input Value Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU Byte Order Sets the byte order of the
227. formed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 26 ni com Chapter 6 ECU M amp C API for C Description mcCharacteristicReadSingleValue reads a value from a named Characteristic on the ECU which is identified by the ECU Reference handle The value to be read is identified by the x and Y indices If the Characteristic array is 0 dimensional X and Y can be set to 0 If the Characteristic array is 1 dimensional Y can be set to 0 National Instruments Corporation 6 27 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcCharacteristicWrite Purpose Downloads data to a Characteristic for a selected ECU Format mcTypeStatus mcCharacteristicWrite mcTypeTaskRef ECURefNum char CharacteristicName 64 Values u32 NumberOfValues Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx CharacteristicName CharacteristicName is the name of the Characteristic defined in the A2L database file Values Values contains a pointer to a double a double 1D or 2D array which is sent to the ECU NumberOfValues Specifies the number of values to write for the task Output Return Value The return value indicates the status of the function call as a signed 32 bit integ
228. from the ECU during the communication ReturnValue ReturnValue may contain an array of bytes returned from the ECU as a response to the command sent to the ECU ReturnValueSize ReturnValueSize contains the number of bytes returned from ECU M amp C Toolkit User Manual the ECU passed to ReturnValue 6 66 ni com Chapter 6 ECU M amp C API for C Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcGeneric can be used to send commands to the ECU that are not defined by the CCP or XCP specification The command code in Command and the parameters of this command defined in Data are sent to the ECU and the data returned by the ECU is passed to the parameter ReturnValue Since the ECU M amp C driver has no knowledge of the parameters of the command and their data types all parameters and return values are passed as an array of bytes Therefore you are responsible for the correct type casting of all parameters and return values of this command Make sure that all parameters are passed in the cor
229. ge vi mcXCPCopyCalPage DOWNLOAD MC Download vi mcDownload GET_CAL_PAGE MC XCP Get Cal Page vi mcCCPGetActiveCalPage GET_ID MC XCP Get ID vi mcXCPGet ID GET_STATUS MC XCP Get Status vi mcXCPGetStatus PROGRAM MC Program vi mcProgram PROGRAM_PREPARE MC XCP Program mcXCPProgramPrepare Prepare vi PROGRAM_RESET MC Program Reset vi mcProgramReset PROGRAM_START MC Program Start vi mcProgramStart PROGRAM_VERIFY MC XCP Program Verify vi mcXCPProgramVerify SET_CAL_PAGE MC XCP Set Cal Page vi mcXCPSetCalPage SET_REQUEST MC XCP Set Request vi mcXCPSetRequest ECU M amp C Toolkit User Manual 4 18 ni com Chapter 4 Using the ECU M amp C API Table 4 2 Overview of the XCP Commands with Related VIs and C Functions Continued XCP Command LabVIEW VI Name C Function Name SET_SEGMENT_MODE MC XCP Set Segment mcXCPSetSegmentMode Mode vi UPLOAD MC Upload vi mcUpload Seed and Key Algorithm To restrict access to an ECU you can add a defined login mechanism to ECU software The Association for Standardization of Automation and Measuring Systems ASAM defines this seed which may be stored in the A2L file A typical login mechanism may happen as follows Connect to the ECU 1 Gee oes Exchange station identifications Get the seed for the key Calculate the key using a seed and key DLL as ASAM defines Unlock the ECU protection by sending the calculated key ASAM AE Common defines the seed and key algorithm in the Seed
230. gured by the host Data acquisition is initiated by the host then executed by the slave device and may be based on a fixed sampling rate or be event driven A 2 ni com Appendix A Summary of the CCP Standard CCP Protocol Definition Two communication objects are defined by CCP to handle the communication between host and slave devices The CommandReceiveObject CRO which is used to send commands and data from the host to the slave device and the DataTransmissionObject DTO which is used to transmit handshake messages data and status information from the slave device to the host Each of these message objects is assigned a unique CAN ID Messages that are returned from the slave as a message to a command are called CommandReturnMessages CRM A Command Receive Object is a CAN message consisting of eight bytes The first byte of a CRO is the command code followed by the command counter byte The command counter is generated for reference by the host to make sure that the CRM returned by a slave device corresponds to the correct host command The rest of the message builds the parameter and data fields The structure is as follows 0 1 2 3 4 5 6 7 CMD CTR Parameter and Data Field A DataTransmissionObject has a PacketID PID as the first byte This PID determines how the rest of the message is interpreted CCP differentiates between thr
231. gures the target address to be cleared in the ECU mcAddress is aC struct consisting of Address Specifies the address part of the target address Extension Extension contains the extension part of the target address BlockSize BlockSize determines the size of the block on which the checksum must be calculated Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcClearMemory can be used to clear the contents of the non volatile memory prior to reprogramming it The Memory Transfer Address 0 MTA 0 is set to the start of the memory block automatically by this function The size parameter is the size of the block to be erased If you are using the XCP protocol mcClearMemory implements the PROGRAM_CLEAR command Refer to the ASAM XCP specification for further information on how to clear parts of non volatile memory in the ECU National Instruments Corporation 6 31 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C meConversionCreate Purpose Creates a signal c
232. h National Instruments Corporation 4 25 ECU M amp C Toolkit User Manual ECU M amp C API for LabVIEW This chapter lists the LabVIEW VIs for the ECU M amp C API and describes the format purpose and parameters for each VI The VIs in this chapter are listed alphabetically Unless otherwise stated each VI suspends execution of the calling thread until it completes Section Headings The following are section headings found in the ECU M amp C API for LabVIEW VIs Purpose Each VI description includes a brief statement of the purpose of the VI Format The format section describes the format of each VI Input and Output The input and output parameters for each VI are listed Description The description section gives details about the purpose and effect of each VI List of Vis The following table is an alphabetical list of the ECU M amp C Toolkit VIs Table 5 1 ECU M amp C API VIs for LabVIEW Function Purpose MC Build Checksum vi Calculates a checksum over a defined memory range within the ECU MC Calc Checksum vi Calculates the checksum of a data block in memory MC CCP Action Service vi Calls an implementation specific action service on the ECU National Instruments Corporation 5 1 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 1 ECU M amp C API Vis for LabVIEW Continued Function Purpose MC CCP Diag Service vi Cal
233. h open Internet Explorer and type the following in the address field ftp w x y z d To enter a directory double click on its icon Right click on a file or folder and choose cut copy paste or delete to perform those actions LabVIEW Real Time Graphical File Transfer Utility LabVIEW Real Time Module versions 7 0 and later include a File Transfer Utility that can be used to access your RT target This method helps you avoid the caching problem encountered when using web browsers You can find this utility in the Measurement and Automation Explorer MAX To open the utility right click on the desired RT target under the Remote Systems list and choose File Transfer as shown in Figure 2 2 National Instruments Corporation 2 7 ECU M amp C Toolkit User Manual Chapter 2 Installation and Configuration ECU M amp C Toolkit User Manual Configuration 4 My System Data Neighborhood Devices and Interfaces Scales Software amp Remote Systems fez JPXI 8175R Reboot re Data Ne 8 tiak Devices View Error Lo Scales vated alia Softwar File Transfer p X Delete Figure 2 2 FTP Utility Access in MAX At this point you are prompted for a username and password If these security features have not been enabled check the Anonymous Login box as shown in Figure 2 3 Username Password x Username anonymous PEAS Login Password iTS Figure 2 3 FTP
234. have NumberOfSamplesToRead entries allocated The order of channel entries in SampleArray is the same as the order in the original ChannelList If you need to determine the number of channels in the task after initialization get the mcPropDAQ_NumChannel1s property for the task reference If no message has been received since you started the task 0 is returned as default value for of the channel in all entries of SampleArray NumberOfSamplesReturned NumberOfSamplesReturned indicates the number of samples returned for each channel in SampleArray The remaining entries are left unchanged zero National Instruments Corporation 6 41 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description If the initialized SampleRate is greater than zero this function returns an array of samples each of which indicates the value of the CAN channel at a specific point in time The mcDAQRead function waits for these samples to arrive in time befo
235. havior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcDAQStartStop is an optional command to start or stop communication for an M amp C Measurement task If you do not perform mcDAQStart Stop with the parameter mcStartStopModeStart before using mcDAQRead the Measurement task is started by the first call of mcDAQRead After you start the transmission of the DAQ lists you can no longer change the configuration of the Measurement task with mcSet Property You must call mcDAQStartStop with the parameter mcStartStopModeStop first National Instruments Corporation 6 47 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcDAQWrite Purpose Writes samples to an ECU DAQ list Format mcTypeStatus mcDAQWrite mcTypeTaskRef DAQRefNum u32 NumberofSamplesTowrite 64 SampleArray Input DAQRefNum DAQRe Nun is the task reference from the previous Measurement task function The task reference is originally returned from mcDAQInitialize and then reused by subsequent Measurement task functions NumberofSamplesToWrite NumberofSamplesTowrite specifies the number of samples to write for the ECU MC DAQ task to the ECU DAQ list For single sample output pass 1 to this parameter The initialized DAQ s
236. he checksum algorithm is not specified by CCP and the checksum algorithm may be different on different devices If you are using the XCP protocol mcBuildChecksum implements the BUILD_CHECKSUM command of the XCP specification The result of the checksum calculation is returned in Checksum regardless of the checksum type The following values for ChecksumType are defined in the XCP specification Type Name Description 0x01 XCP_ADD_11 Add BYTE into a BYTE checksum ignore overflows 0x02 XCP_ADD_12 Add BYTE into a WORD checksum ignore overflows 0x03 XCP_ADD_14 Add BYTE into a DWORD checksum ignore overflows 0x04 XCP_ADD_22 Add WORD into a WORD checksum ignore overflows blocksize must be modulo 2 0x05 XCP_ADD_24 Add WORD into a DWORD checksum ignore overflows blocksize must be modulo 2 0x06 XCP_ADD_44 Add DWORD into DWORD ignore overflows blocksize must be modulo 4 0x07 XCP_CRC_16 Refer to CRC error detection algorithms 0x08 XCP_CRC_16_CITT Refer to CRC error detection algorithms 0x09 XCP_CRC_32 Refer to CRC error detection algorithms OxFF XCP_USER_ DEFINED User defined algorithm in externally calculated function National Instruments Corporation 6 7 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C With ChecksumType XCP_USER_DEFINED the Slave may indicate that the Master which calculates the checksum must use a user defined algorithm implemented in a
237. he order of channel entries in value is the same as the order in the original channel list The initialized sample rate must be greater than zero for this poly VI because each sample in the array indicates the value of each CAN channel at a specific point in time In other words the sample rate specifies a virtual clock that copies the most recent value from CAN messages for each sample time The changes in sample values from message to message enable you to view the CAN channels over time such as for comparison with other CAN or DAQ input channels This VI waits until all samples arrive in time before returning If the initialized sample rate is zero this poly VI returns an error If the intent is simply to read the most recent samples for a task use the NChan 1Samp 1D Dbl type If no message has been received for a channel since you started the task the Default Value of the channel is returned in value You can specify channels in channel list that span multiple messages At each point in time a sample from the most recent message is returned for all channels You can use error out to determine whether a new message has been received since the previous call to MC DAQ Read vi or MC DAQ Start Stop vi If no message has been received for one or more channels the warning code 3FF60009 hex is returned in error out If a new message has been received for all channels the success code 0 is returned in error out Unless an error occurs the number of sa
238. he task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 5 130 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Description If you are using the XCP protocol MC Program Start vi implements the XCP command PROGRAM_ START This optional command indicates the beginning of a programming sequence into a non volatile memory area If the slave device is not in a state which permits programming an error is returned The memory programming commands The end of a non volatile memory programming sequence is indicated by using the MC Program Start vi function For further information on how to use program ECU memory and to use the MC Program Start vi command refer to the ASAM XCP Part 2 Protocol Layer Specification National Instruments Corporation 5 131 ECU M amp C Toolkit User Manual Chapter 5 ECU M
239. ible to use different access modes for clearing and programming ECU XCP Programming Method Returns the selected programming method used for MC Program vi 0x00 Sequential programming 0x80 0xFF User defined ECU XCP SeedKey DLL Returns the file name of the SeedKey DLL National Instruments Corporation 5 107 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU XCP CAN Baudrate Returns the Baud Rate in use by the NI CAN Interface Basic baud rates such as 125000 and 500000 are specified as the numeric rate Advanced baud rates are specified as 8000XXYY hex where YY is the value of Bit Timing Register 0 BTRO and XX is the value of Bit Timing Register 1 BTR1 of the CAN controller chip For more information refer to the Interface Properties dialog in MAX The value of this property is originally set within MAX but it can be changed using MC Set Property vi ECU XCP CAN CRO Id Returns the CRO ID Command Receive Object which is used to send commands and data from the host to the slave device ECU XCP CAN DTO Id Returns the DTO ID Data Transmission Object which is used by the ECU to respond to XCP commands and send data
240. ich a sequence of bytes is stored in computer memory A portion of the ECU memory containing data that controls the behavior of the ECU Controller Area Network The Controller Area Network CAN is a joint development of Robert Bosch GmbH and Intel Corporation CAN is used in many high end automotive control systems like engine management as well as in industrial control systems Controller chips for CAN are available from various semiconductor manufacturers CAN Calibration Protocol The CCP master device host is a calibration monitoring tool for initiating data transfers on the CAN by sending commands to slave devices Typically an ECU which communicates through CCP with the CCP master A Characteristic is a memory area within the ECU which defines the behavior of a control subsystem Calibration is a process to optimize the Characteristic A Characteristic can be represented by a single value parameter a one dimensional array of values curve or a two dimensional array of values map A Dynamic Link Library which implements a function to calculate a checksum over a given data block A Command Receive Object CRO is sent from the CCP master device to one of the slave devices The slave device answers with a Data Transmission Object DTO containing a Command Return Message CRM G 2 ni com Glossary Controller Area Network See CAN CRM CRO CRO ID D DAQ DAQ channel DAQ list DAQ mode Data Transfe
241. ient that the underlying CCP communication is handled by the toolkit kernel itself Nevertheless the ECU M amp C Toolkit offers direct access to the low level CCP commands if a non standard timing behavior or independent user defined command sequence is needed CCP Protocol Version The ECU M amp C Toolkit supports the CAN Calibration Protocol specification version 2 1 ECU M amp C Toolkit User Manual 1 2 ni com Chapter 1 Introduction Universal Measurement and Calibration Protocol XCP Overview The Universal Measurement and Calibration Protocol XCP is a single master single slave protocol for calibration and data acquisition based on various transport layers Communication is always initiated by the XCP master An XCP slave must respond to requests from the master within a specified time The XCP protocol uses a soft master slave principle once the master establishes a communication channel with the slave the slave can send certain messages Events Service Requests and Data Acquisition messages autonomously In addition the master sends Data Stimulation messages without expecting a direct response from the slave The XCP builds a continuous logical unambiguous point to point connection with 1 specific slave when establishing a communication channel The XCP slave cannot handle multiple connections The master is not allowed to broadcast XCP messages to multiple slaves at the same time The identification parameters of the
242. ies ECU M amp C Toolkit User Manual 5 136 ni com Chapter 5 ECU M amp C API for LabVIEW Table 5 6 ECU Specific Property Value Types for the POLY Input Value Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description ECU CCP Station Address Sets 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 must 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 ECU E F CCP Misc Skip EXCHANGE ID Sets whether or not the CCP command EXCHANGE_ID should be suppressed during connection to the ECU ECU H CCP Optional Commands ACTION SERVICE Sets whether the ECU supports the optional ASAM CCP Command ACTION_SERVICE ECU P F CCP Optional Commands BUILD CHECKSUM Sets whether the ECU supports the optional ASAM CCP Command BUILD_CHKSUM ECU E F CCP Optional Commands CLEAR MEMORY Sets whether the ECU supports the optional ASAM CCP Command CLEAR_MEMORY National Instruments Corporation 5 137 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Tab
243. ies of an ECU task After you change properties use MC ECU Connect vi to start communication for the task and logically connect to the selected ECU Prior to calling MC ECU Select vi an available ECU name can be queried by calling MC Get Property vi with the parameter ECU Name Possible selections for the interface and protocol parameter for the various hardware targets are as follows Using NI CAN hardware e CCP CAN0 uses CCP on CAN interface 0 e CCP CAN1 uses CCP on CAN interface 1 and so on with the form CANx e CCP CAN256 uses CCP on virtual CAN interface 256 e CCP CAN257 uses CCP on virtual CAN interface 257 e XCP CAN0 uses XCP on CAN interface 0 e XCP CAN1 uses XCP on CAN interface 1 and so on with the form CANx e XCP UDP uses XCP on UDP e XCP TCP uses XCP on TCP ECU M amp C Toolkit User Manual 5 86 ni com Chapter5 ECU M amp C API for LabVIEW Using NI XNET hardware CCP CAN1 ni_genie_nixnet uses CCP on CAN interface 1 CCP CAN2 ni_genie_nixnet uses CCP on CAN interface 2 and so on with the form CANx XCP CANI1 ni_genie_nixnet uses XCP on CAN interface 1 XCP CANI1 ni_genie_nixnet uses XCP on CAN interface 2 and so on with the form CANx XCP UDP ni_genie_nixnet uses XCP on UDP XCP TCP ni_genie_nixnet uses XCP on TCP Using CompactRIO or R Series CCP CAN1 RIO1 c temp MyF pgaBitfile lvbitx uses CCP on named target RIO1 as compiled into the bitfile at c temp MyFpgaBitfile
244. ies the VI where the error occurred Description MC XCP Set Cal Page vi implements the XCP command SET_CAL_PAGE and sets the access mode for a calibration data segment if the slave device supports calibration data page switching A calibration data segment and its pages are specified by logical numbers Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request National Instruments Corporation 5 165 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC XCP Set Request vi Purpose Performs a request to save session and device information to non volatile memory Format mode ECU ref in ECU ref out session id error in error out Input Mode is a bit mask described below Bit Description 0 Request to store calibration data in non volatile memory 1 Unused 2 Request to save all DAQ lists which have been selected with START_STOP_DAQ_LIST Select into non volatile memory The slave also must store the session configuration ID in non volatile memory Upon saving the slave first must clear any DAQ list configuration that might already be stored in non volatile memory 3 Request to clear all DAQ lists in non volatile memory All ODT entries reset to address 0 extension 0 size 0 and bit_offset FF Session configuration ID reset to 0 4 Unused 5 Unused 6 Unused 7 Unused ECU M amp
245. ifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcXCPProgramVeri fy implements the XCP command PROGRAM_VERIFY and performs a flash program verification If VerMode 0 the master can request the slave to start internal test routines to check whether the new flash contents fits to the rest of the flash Only the result is of interest If VerMode 01 the master can tell the slave that he is sending a Verification Value to the slave The definition of the Verification Mode is project specific The master is getting the Verification Mode from the project specific programming flow control and passing it to the slave The tool needs no further information about the details of the project specific check routines The XCP parameters allow a wide range of project specific adaptations The Verification Type is specified in the project specific programming flow control The master is getting this parameter and passing it to the slave The definition of the Verification Value is project specific and the use is defined in the project specific programming flow control Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request
246. ine e ERNE E Na Ei xvii Chapter 1 Introduction CAN Calibration Protocol CCP Overview seesesessesssssssesssrersesssreessrersrresseesssressrns 1 2 CGP Protocol Version oneee cases sos bee Seek RE N doses AEN aaa 1 2 Universal Measurement and Calibration Protocol XCP Overview ccccsceeeeeees 1 3 XCP Protocol Version icc oes feccctdecsevcctavecsvuoesSeedaeeedvencivevecsheededdscvccrssestuousaetecssd 1 3 Measurement and Calibration Databases cccccccccscssccccsccccceececessssesessssscsessseeeeesseess 1 4 ECU Measurement S erena anea EAER EE E E EO ENRE 1 4 ECU Characteristics s wis 3 2 a ha ee i Re a oda es es 1 4 Chapter 2 Installation and Configuration Installation seeren Wv tec eas tenavelieatinditadhi doc kt r Mines 2 1 License Management Overview ce ceceesesceseeecceseeseceseseeeeaecseeeseeseeesecseeeaeeneeeasenseaes 2 1 Activate ECUMQC TOOK a n ie scab hee a ck ite obs Goce E E 2 2 Ba ar a a A Ara eie aan enS 2 3 Moving Software After Activation ssesseeessersersreersrrsrsresrsresresrsresreereresree 2 4 Volume License Program erian nei a EE E a aE eE 2 4 Online AcHyatiON sereen aana r EER E E A E e E aaaea 2 4 Home Computer Uses aeniea a a a r e ais 2 4 Bravia y POC AA AE ENEE EEEE E EAEI AETA TO 2 4 National Instruments Corporation V ECU M amp C Toolkit User Manual Contents LabVIEW Real Time RT Configuration 0 ec ec ceeccceseceseeenecesceceseeesaeceaeeesneenaeerees 2 5 PXI S
247. ined from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty National Instruments believes that the information in this document is accurate The document has been carefully reviewed for technical accuracy In the event that technical or typographical errors exist National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition The reader should consult National Instruments if errors are suspected In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it EXCEPT AS SPECIFIED HEREIN NATIONAL INSTRUMENTS MAKES NO WARRANTIES EXPRESS OR IMPLIED AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE CUSTOMER S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA PROFITS USE OF PRODUCTS OR INCIDENTAL OR CONSEQUENTIAL DAMAGES EVEN IF ADVISED OF THE POSSIBILITY THEREOF This limitation of the liability of National Instruments will apply regardless of the form of action whether in contract or tort in
248. ing for example 5 72 ni com ld E EEG Chapter5 ECU M amp C API for LabVIEW CCP CAN1 ni_genie_nixnet The interface name is related to the NI XNET hardware naming under Devices and Interfaces in MAX CompactRIO or R Series If using CompactRIO or R Series hardware you must provide a bitfile that handles the CAN communication between the host system and FPGA To access the CAN module on the FPGA you must specify the bitfile name after the for example CCP CANI MyBitfile lvbitx To specify a special RIO target you can specify that target by its name followed by the bitfile name for example XCP CAN1 RIO1 MyBitfile lvbitx Currently only a single CAN interface is supported RJO defines the RIO target name as defined in your LabVIEW Project definition The vbitx filename represents the filename and location of the bitfile on the host if using RIO or on a CompactRIO target This implies that you must download the bitfile to the CompactRIO target before you can run your application You may specify an absolute path or a path relative to the root of your target for the bitfile ECU Name sets the ECU object name For all related ECU functions such as MC ECU Select vi use this name as reference DB ref in is the task reference that links to the opened database file Communication Params is a cluster that contains the following values CRO ID sets the CAN identifier for the Command Receive Object CRO ID which sends comma
249. ion and stimulation Current Session Status Session status contains a bit mask which is described below Bit Number Flag Description 0 STORE_CAL_REQ REQuest to STORE CALibration data 0 STORE_CAL_REQ mode is reset 1 STORE_CAL_REQ mode is set 1 Unused 2 STORE_DAQ_REQ REQuest to STORE DAQ list 0 STORE_DAQ_REQ mode is reset 1 STORE_DAQ_REQ mode is set National Instruments Corporation 5 155 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Bit Number Flag Description 3 CLEAR_DAQ_REQ REQuest to CLEAR DAQ configuration 0 CLEAR_DAQ_REQ is reset 1 CLEAR_DAQ_REQ is set 4 Unused 5 Unused 6 DAQ_RUNNING Data Transfer 0 The data transfer is not running 1 The data transfer is running 7 RESUME RESUME Mode O0 The slave device is not in RESUME mode 1 The slave device is in RESUME mode The STORE_CAL_REQ flag indicates a pending request to save the calibration data into non volatile memory As soon as the request has been fulfilled the slave will reset the appropriate bit The slave device may indicate this by transmitting an EV_STORE_CAL event packet The STORE_DAQ_ REQ flag indicates a pending request to save the DAQ list setup in non volatile memory As soon as the request has been fulfilled the slave will reset the appropriate bit The slave device may indicate this by transmitting an EV_STORE_DAQ
250. ion session CCP only Format ECU ref in ECU ref out session status error in error out Input HA E ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Session status is the new status to be set in the ECU 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 status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 National Instruments Corporation 5 27 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW
251. ional Instruments ECU Measurement and Calibration Toolkit Examples MS Visual C On Windows XP 2000 the typical path to the C examples folder is Documents and Settings All Users Documents National Instruments ECU Measurement and Calibration Toolkit Examples MS Visual C 3 2 ni com Chapter 3 Application Development Each example is in a separate folder A description of each example is in comments at the top of the c file At the command prompt after setting MSVC environment variables such as with MS vevars32 bat you can build each example using a command such as cl I lt HDir gt measure c lt LibDir gt niemcc 1lib lt HDir gt is the folder where niemc h can be found lt LibDir gt is the folder where niemcc 1ib can be found Other Programming Languages The ECU M amp C Toolkit software does not provide formal support for programming languages other than those described in the preceding sections If the programming language provides a mechanism to call a Dynamic Link Library DLL you can create code to call ECU M amp C Toolkit functions All functions for the ECU M amp C API are located in niemcc d11 If the programming language supports the Microsoft Win32 APIs you can load pointers to ECU M amp C Toolkit functions in the application The following text demonstrates use of the Win32 functions for C C environments other than Visual C C 6 For more detailed information refer to Microsoft documentation The fo
252. is a cluster which contains the following values Address specifies the address part of the source address i i Extension contains the extension part of the source address i Code size determines the size of data code to be downloaded by the subsequent memory programming 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 status is TRUE status is TRUE if an error occurred This VI is not executed when 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 source identifies the VI where the error occurred National Instruments Corporation 5 159 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred code is the error
253. ist The initialized sample rate must be greater than zero for this poly VI because each sample in the array indicates the value of the CAN channel at a specific point in time In other words the sample rate specifies a virtual clock that copies the most recent value from CAN messages for each sample time The changes in sample values from message to message enable you to view the CAN channel over time such as for comparison with other CAN or DAQ input channels This VI waits until all samples arrive in time before returning National Instruments Corporation 5 51 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW If the initialized sample rate is zero this poly VI returns an error If the intent is simply to read the most recent sample for a task use the 7 Chan 1Samp Dbl type If no message has been received since you started the task a 0 is returned in all entries of the samples array You can use error out to determine whether a new message has been received since the previous call to MC DAQ Read vi or MC DAQ Start Stop vi If no message has been received the warning code 3FF60009 hex is returned in error out If a new message has been received the success code 0 is returned in error out Unless an error occurs the number of samples returned is equal to number of samples to read NChan NSamp 2D Dbl Returns an array one entry for each channel initialized in channel list Each entry consists of an array of value T
254. it signed integer 132 32 bit signed integer National Instruments Corporation 6 1 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 1 Data Types for the ECU M amp C API for C Continued Data Type Purpose us 8 bit unsigned integer ul6 16 bit unsigned integer u32 32 bit unsigned integer 32 32 bit floating point number f64 64 bit floating point number str ASCII string represented as an array of characters terminated by null character 0 This type is used with output strings str is typically used in the ECU M amp C API as a pointer to a string as char cstr ASCII string represented as an array of characters terminated by null character 0 This type is used with input strings estr is typically used in the ECU M amp C API as a pointer to a string as const char mcTypeTaskRef Reference to an initialized database task ECU task or Measurement task mcAddress C struct which represents the target address for a specific CCP operation in the ECU List of Functions The following table contains an alphabetical list of the ECU M amp C Toolkit API functions Table 6 2 Functions for the ECU M amp C API for C Function Purpose mcBuildChecksum Calculates a checksum over a defined memory range within the ECU mcCalculateChecksum Calculates the checksum of a data block in memory mcCCPActionService Ca
255. itive 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 source identifies the VI where the error occurred ECU M amp C Toolkit User Manual 5 126 ni com Chapter5 ECU M amp C API for LabVIEW ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description If you are using the CCP protocol MC Program vi implements the CCP command PROGRAM The command is used to program the specified data into nonvolatile ECU memory Flash EEPROM etc Programming starts at the selected MTAO address and extension defined in the Address cluster If you are using the XCP protocol MC Program
256. k pcadestisvecstsdtes eostiesicaestsaetdtiadesiteieesieatys 5 152 MC XCP Get Status Vi onini ee eotectuadtegies EE E R REE 5 154 MC XCP Program Prepare Vise scesescehesss lecescasseetbescdsgensstacases sdituneesesgeaseecaeeees 5 159 MC XCP Program Verily Viicia e iaa 5 161 MC XCP Set Cal Page Vi sess sscse ccibesesdegcaststisesdscstessssshanssceedessedaredscsestaseesaseibad 5 164 MC XCP Set Request Vissiin iesistie esiri 5 166 MC XCP Set Segment Mode Vhsssscieiisi ini np ai 5 169 Chapter 6 ECU M amp C API for C Section Headings iiris niniin ne aE EE EEE E RE REE 6 1 PULPOSE ri iaaea E a aa A Raa a a EaR EEEE E 6 1 IPORMAt EEE O E E wi ate tin eae S 6 1 Input and Outputs nisor asarei iari sa i i E E TA 6 1 DeScCription misiris io edeier ter a Eea AE Ea KE NE RE AEREA 6 1 Lastof Data Types orrara siar igar aE Ea E EERE AEE EEE ER 6 1 List of Bunctions e e ih ile N E eA 6 2 meB dCh cks m zacina a E A E 6 6 mcCalculat Checksuim aon Eaa E E E ERE EE 6 10 MeCCPA CAO O EV E a E E E iin deat 6 12 MCCEPDiaASSCLVICE s osio enee nea coisa EEE EE E AEE EE 6 14 mcoCCPGetActiveCal Pagen sonenn a aaa 6 16 mceCePGetResullt e T aata ne aa ES E E S hen sia Aad 6 17 MCCCPGetSessionStatus s e eei e ee ate a a a Ee Sais 6 18 MCCCPGEtN ersiON ae leeds e e Rice tees He eee eae 6 19 MCCCPMOVEMEMOLY 022 sissesteersssvenddesshiscestzseestagnetetea vidoes E R a 6 20 meCCPSelectCalPa ges css i eed onir a a E E E wavtene dene 6 22 MCCCPSetSessionStatus
257. l Instruments Corporation 6 59 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcECUDeselect Purpose Deselects an ECU and invalidates the ECU reference handle Format mcTypeStatus mcECUDeselect mcTypeTaskRef ECURefNum Input ECURefNum ECURe fNunm is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcECUDeselect deselects the ECU and clears all internal driver data stored for this ECU After calling this function it is no longer possible to communicate with the specified ECU The task reference ECURefNunm is transferred into a database handle DBRefNum ECU M amp C Toolkit User Manual 6 60 ni com Chapter 6 ECU M amp C API for C mcECUDisconnect Purpose Disconnects CCP or XCP communication to the selected ECU Format mcTypeStatus mcECUDisconnect mcTypeTaskRef ECURefNum Input ECURef Num ECURe fNum is the t
258. le 5 6 ECU Specific Property Value Types for the POLY Input Value Continued Sub Hierarchy Type Hierarchy Sub1 Sub 2 Param Description ECU CCP Optional CLEAR Sets whether the ECU Commands MEMORY supports the optional ASAM CCP Command CLEAR_MEMORY ECU CCP Optional DIAG Sets whether the ECU Commands SERVICE supports the optional ASAM CCP Command DIAG_SERVICE ECU CCP Optional DNLOAD 6 Sets whether the ECU Commands supports the optional ASAM CCP Command DNLOAD_6 ECU CCP Optional GET Sets whether the ECU Commands ACTIVE supports the optional CAL PAGE ASAM CCP Command GET_ACTIVE_CAL_ PAGE ECU CCP Optional GETS Sets whether the ECU Commands STATUS supports the optional ASAM CCP Command GET_S_STATUS ECU CCP Optional GET SEED Sets whether the ECU Commands supports the optional ASAM CCP Command GET_SEED ECU CCP Optional MOVE Sets whether the ECU Commands supports the optional ASAM CCP Command MOVE ECU CCP Optional PROGRAM Sets whether the ECU Commands supports the optional ASAM CCP Command PROGRAM ECU M amp C Toolkit User Manual 5 138 ni com Chapter 5 ECU M amp C API for LabVIEW Table 5 6 ECU Specific Property Value Types for the POLY Input Value Continued Sub Hierarchy Type Hierarchy Sub1 Sub 2 Param Description ECU CCP Optional PROGRAM 6 Sets whether the ECU Commands supports the optional A
259. le has increased significantly This trend is expected to continue as automobile manufacturers initiate further advances in safety reliability and comfort The introduction of advanced control systems combining multiple sensors actuators and electronic control units has begun to place extensive demands on the existing Controller Area Network CAN communication bus To enable the new generation of automotive electronics new and highly sophisticated software calibration measurement and diagnostic equipment must be used At this time almost no standards exist in the area of software interfaces for such devices Each company has its proprietary systems and interfaces to support the development of these high end configurations National Instruments Corporation A 1 ECU M amp C Toolkit User Manual Appendix A Summary of the CCP Standard Scope of CCP ECU M amp C Toolkit User Manual The CAN Calibration Protocol was originally developed and introduced by Ingenieurb ro Helmut Kleinknecht a manufacturer of calibration systems and is used in various application areas in the automotive industry Afterwards CCP was taken over by the ASAP working group and enhanced with optional functions and is now maintained by the ASAM organization The CAN Calibration Protocol is a CAN based master slave protocol for calibration and data acquisition using the CAN 2 0B standard 11 bit and 29 bit identifiers which includes 2 0A 11 bit identifier
260. lemented in the ECU This command performs a mutual identification of the protocol version in the slave device to agree on a common protocol version mcCCPGetVersion implements the CCP command GET_CCP_VERSION defined by the CCP specification National Instruments Corporation 6 19 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcCCPMoveMemory Purpose Moves a memory block on the ECU CCP only Format mcTypeStatus mcCCPMoveMemory mcTypeTaskRef ECURefNum mcAddress Source mcAddress Destination u32 BlockSize Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Source Configures the source address for the memory move operation in the ECU mcAddress is a C struct consisting of Address Specifies the address part of the source address Extension Extension contains the extension part of the source address Destination Configures the destination address for the memory move operation in the ECU mcAddress is a C struct consisting of Address Specifies the address part of the destination address Extension Extension contains the extension part of the destination address BlockSize BlockSize determines the size of memory block in bytes which should be moved from the source address to the destination address Output Return Value The return value indicates the status of the function call as a signed 32 bit
261. lements the XCP command UPLOAD A data block of the specified length starting at the specified address is uploaded from the ECU The Memory Transfer Address pointer MTAO is post incremented by the given number of data elements If the slave device does not support block transfer mode all uploaded data is transferred in a single response packet If block transfer mode is supported the uploaded data is transferred in multiple responses on the same request packet There are no limitations allowed concerning the maximum block size for the master Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to upload data and to use the mcUpload command National Instruments Corporation 6 105 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcXCPCopyCalPage Purpose Forces a copy transaction of one calibration page to another Format mcTypeStatus mcXCPCopyCal Page mcTypeTaskRef ECURefNum u8 SourceSegment u8 SourcePage u8 DestinationSegment u8 DestinationPage Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx SourceSegment SourceSegment specifies the logical data segment number source SourcePage SourcePage specifies the logical page number source DestinationSegment DestinationSegment specifies the logical data segment number destination DestinationPage DestinationPage specifies the logical
262. ling VI such as the Simple Error Handler source identifies the VI where the error occurred Description MC XCP Get Cal Page vi implements the XCP command GET_CAL_PAGE and queries the logical number for the calibration data page that is currently activated for the specified access mode and data segment Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request National Instruments Corporation 5 151 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC XCP Get ID vi Purpose Queries session configuration or slave device identification Format reference in type error in reference out id string error out Reference in is the reference to any opened A2L database a selected ECU or an ECU which is already connected with MC Database Open vi MC ECU Select vi MC ECU Open vi or MC ECU Connect vi The type of this reference depends on the property you want to get Type specifies the type of the requested identification ype sp yp q Type Description 0 ASCII text 1 ASAM MC2 filename without path and extension ASAM MC2 filename with path and extension URL where the ASAM MC2 file can be found AJJ N ASAM MC 2 file to upload 128 255 User defined Error in is a cluster which describes error conditions occurring before the VI executes If an error has already occurred the V
263. lkit User Manual Chapter 6 ECU M amp C API for C mcDAQListinitialize Purpose Defines a DAQ list on a specific DAQ list number and initializes the Measurement task for the specified Measurement channel list Initializes a Measurement task for the specified Measurement channel list Format mcTypeStatus mcDAQListInitialize cstr MeasurementNames mcTypeTaskRef ECURefNum i116 DAQListNo i32 DAQMode u32 DTO_ID 64 SampleRate mcTypeTaskRef DAQRefNum Input MeasurementNames Comma separated list of Measurement names to initialize as a task You can type in the channel list as a string constant or you can obtain the list from an A2L database file by using the mcGetNames function ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx DAQListNo DAQListNo specifies which DAQ list entry number should be used for the defined Measurement channel list for the selected ECU To query the available amount of DAQ List numbers on the ECU use mcPropECU_NumberOfDefinedDAQLists with the function mcGet Property To query the defined DAQ list numbers use mcPropECU_DAQListNumbers with mcGetProperty DAQMode DAQMode specifies the I O mode for the task For an overview of the I O modes including figures refer to the Basic Programming Model section of Chapter 4 Using the ECU M amp C API mcDAQModeDAQList Data is transmitted automatically by the ECU
264. ll objects of the specified type inside the ECU based on the name provided If you do not provide a name the first ECU in the A2L file is selected 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred Reference out is a copy of the reference which was passed to the reference in terminal Names list out returns the array of names one string entry per name To start a Measurement task or access a Characteristic for all channels returned from MC Get Names vi wire channel list to MC DAQ Initialize vi 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 status is TRUE if an error occurred code is the error code number identifying an error A value of
265. llowing C language code fragment illustrates how to call Win32 LoadLibrary to load the DLL for the ECU M amp C API include lt windows h gt include niemc h HINSTANCE NiMcLib NULL NiMcLib LoadLibrary niemcc d1l1 Next the application must call the Win32 Get ProcAddress function to obtain a pointer to each ECU M amp C Toolkit function that the application will use For each function you must declare a pointer variable using the prototype of the function For the prototypes of each ECU M amp C Toolkit function refer to Chapter 6 ECU M amp C API for C Before exiting the application you must unload the ECU M amp C Toolkit DLL as follows FreeLibrary NiMcLib National Instruments Corporation 3 3 ECU M amp C Toolkit User Manual Chapter 3 Application Development Application Development on CompactRIO or R Series Using an NI 985x or NI 986x C Series Module ECU M amp C Toolkit User Manual To run a project on an FPGA target with an NI 985x C Series module you need an FPGA bitfile lvbitx The FPGA bitfile is downloaded to the FPGA target on the execution host A bitfile is a compiled version of an FPGA VI FPGA VIs and thus bitfiles define the CAN analog digital and pulse width modulation PWM inputs and outputs of an FPGA target The ECU M amp C Toolkit includes FPGA bitfiles for several FPGA targets If your target is not included in the examples you can use the examples as a template an
266. lls an implementation specific action service on the ECU mcCCPDiagService Calls an implementation specific diagnostic service on the ECU mcCCPGetActiveCalPage Retrieves the ECU Memory Transfer Address pointer to the calibration data page mcCCPGetResult Uploads data from the ECU when the Memory Transfer Address pointer 0 MTAO has been set ECU M amp C Toolkit User Manual 6 2 ni com Table 6 2 Chapter 6 Functions for the ECU M amp C API for C Continued Function Purpose mcCCPGetSessionStatus Retrieves the current status of the Calibration Session mcCCPGetVersion Retrieves CCP version implemented in the ECU mcCCPMoveMemory Moves a memory block on the ECU mcCCPSelectCalPage Sets the specified address to be the start address of the calibration data page mcCCPSetSessionStatus Updates the ECU with the current state of the calibration session mcCharacteristicRead Reads all data from a named Characteristic on the ECU which is identified by the ECU Reference handle mcCharacteristicReadSi ngleValue Reads a single value from a named Characteristic on the ECU which is identified by the ECU Reference handle mcCharacteristicWrite Downloads data to a Characteristic for a selected ECU mcCharacteristicWriteS ingleValue Writes a single value to a named Characteristic on the ECU mcClearMemory Clears the contents of the specified ECU memory mc
267. lly set To establish communication through XCP with UDP or TCP the target ECU slave should be addressed by setting the following properties IP Address or hostname The ZP address refers to the identifier for a computer or device on a TCP IP network Networks using the TCP IP protocol route messages based on the IP address of the destination A hostname describes the unique name by which a device is known on a network Hostnames are used by various naming systems NIS DNS SMB etc Hostnames are high level aliases which ultimately correlate to unique network hardware MAC addresses Port number In TCP IP and UDP networks a port is an end point to a logical connection through which a client program specifies a server program on a computer in a network Port numbers range from 0 to 65536 but only port numbers 0 to 1024 are reserved for privileged services and designated as well known ports The ECU Connect function establishes communication to the selected ECU through CCP using the CCP CONNECT command or through XCP using the CONNECT command It establishes a logical connection to an ECU Unless a slave device ECU is unconnected it must not execute or respond to any command sent by the application The only exception to this 4 6 ni com Chapter 4 Using the ECU M amp C API rule is the Test command in which case the slave with the specified address may acknowledge the command Only a single slave can be connected to the applicati
268. ls a diagnostic service on the ECU MC CCP Get Active Cal Page vi Retrieves the ECU Memory Transfer Address pointer to the calibration data page MC CCP Get Result vi Uploads requested data MC CCP Get Session Status vi Retrieves the current calibration status of the ECU MC CCP Get Version vi Retrieves the version of the CCP implemented in the ECU MC CCP Move Memory vi Moves a memory block on the ECU MC CCP Select Cal Page vi Sets the beginning of the calibration data page MC CCP Set Session Status vi Updates the ECU with the current state of the calibration session MC Characteristic Read vi Reads data from a named Characteristic on the ECU which is identified by the ECU Reference handle The Poly VI returns a specific double 1D or 2D double array MC Characteristic Read Single Value vi Reads a value from a named Characteristic on the ECU which is identified by the ECU Reference handle MC Characteristic Write vi Writes the value s of a named Characteristic to an ECU identified by the ECU ref handle The Poly VI writes the selected type double 1D or 2D array MC Characteristic Write Single Value vi Writes a value to a named Characteristic on the ECU MC Clear Memory vi Clears the contents of a specified memory block MC Conversion Create vi Creates a signal conversion object in memory MC DAQ Clear vi Stops communication for the
269. lvbitx XCP CANI1 RIO1 c temp MyF pgaBitfile lvbitx uses XCP on named target RIO1 as compiled into the bitfile at c temp MyFpgaBitfile lvbitx National Instruments Corporation 5 87 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Event Create vi Purpose Creates an Event object in memory Format ECU ref in ECUMEC ECU ref out Event Name Event Number error out error in Input ECU ref in is the task reference is originally Create vi EE E reference that links to the selected ECU This returned from MC ECU Open vi or MC ECU Event Name identifies the event channel object Use this name as a reference in MC Measurement Create vi to identify the event channel Event Number specifies the generic signal source that effectively determines the data transmission timing To allow a reduction of the desired transmission rate a prescaler may be applied to the event channel The prescaler value factor must be greater than or equal to 1 and can be set using MC Set Property vi using the DAQ Prescaler property Error in is a cluster w H hich 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 status is TRUI E if an error occurred This VI will not execute when TF status is TRUE code is the error code number identifying an error A value of 0 means success A neg
270. m Reset function is MC Program Reset vi in LabVIEW and mcProgramReset in other languages Optional Steps for the XCP Protocol XCP Program Prepare An ECU using the XCP protocol might require an XCP PROGRAM_PREPARE command before a programming sequence is started This command can be issued with the XCP Program Prepare function It is MC XCP Program Prepare vi in LabVIEW and mcXCPProgramPrepare in other languages Set XCP Programming Properties XCP allows the programming process to be controlled by several variables These are the Compression Method Encryption Method Programming Method and Access Method properties They default to 0 but can be set to any value before the programming process starts The allowed values for these properties are ECU specific If any of these properties is set to a nonzero value an appropriate PROGRAM_FORMAT XCP command is issued before the programming takes place Note that the Access Method property also affects the Clear Memory function National Instruments Corporation 4 15 ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API XCP Program Verify After the memory programming XCP allows to verify whether the operation was successful by the PROGRAM_VERIFY XCP command The details of this command are highly ECU specific This command can be issued using the XCP Program Verify function It is MC XCP Program Verify vi in LabVIEW and mcXcPProgramVeri fy in other languages Additional
271. m the previous Measurement task function The task reference is originally returned from mcDAQInitialize and then reused by subsequent Measurement task functions NumberOfSamplesToRead Output StartTime ECU M amp C Toolkit User Manual Specifies the number of samples to read for the task For single sample input pass to this parameter If the initialized sample rate is zero you must pass NumberOfSamplesToRead no greater than 1 SampleRate of zero Means mcDAQRead immediately returns a single sample from the most recent message s received Returns the time of the first CAN sample in SampleArray This parameter is optional If you pass NULL for the StartTime parameter the mcDAQRead function proceeds normally If the initialized sample rate is greater than zero the Start Time is determined by the sample timing If the initialized SampleRate is zero the StartTime is zero because the most recent sample is returned regardless of timing StartTime uses the mcTypeTimestamp data type The mcTypeTimestamp data type is a 64 bit unsigned integer compatible with the Microsoft Win32 FILETIME type This absolute time is kept in a Coordinated Universal Time UTC 6 40 ni com Chapter 6 ECU M amp C API for C format UTC time is loosely defined as the current date and time of day in Greenwich England Microsoft defines its UTC time FILETIME as a 64 bit counter of 100 ns intervals that have elapsed since 12 00 a m Januar
272. mat UTC time is loosely defined as the current date and time of day in Greenwich England Microsoft defines its UTC time FILETIME as a 64 bit counter of 100 ns intervals that have elapsed since 12 00 a m January 1 1601 Because the timestamp is compatible with Win32 FILETIME you can pass it into the Win32 FileTimeToLocalFileTime function to convert it to the local timezone and then pass the resulting local time to the Win32 FileTimeToSystemTime function to convert to the Win32 SYSTEMTIME type SYSTEMTIME is a struct with fields for year month day and so on For more information about Win32 time types and functions refer to the Microsoft Win32 documentation SampleArray SampleArray returns the sample value s for each received CAN message The samples are returned as an array of arrays a 2D array one array for each channel initialized in the DAQ task The array of each channel must have NumberOfSamplesToRead entries allocated You must allocate SampleArray exactly as TimestampArray and the order of channel entries is the same for both NumberOfSamplesReturned Indicates the number of samples returned for each channel in SampleArray and the number of timestamps returned for each channel in TimestampArray The remaining entries are left unchanged zero Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an e
273. mples returned is equal to number of samples to read If you need to determine the number of channels in the task after initialization get the Number of Channels property for the task reference 1Chan NSamp Wfm Returns a single waveform for the first channel initialized in channel list The initialized sample rate must be greater than zero for this poly VI because each sample in the array indicates the value of the CAN channel at a specific point in time In other words the sample rate specifies a virtual clock that copies the most recent value from CAN messages for each sample time The changes in sample values from message to message enable you to view the CAN channel over time such as for comparison with other CAN or DAQ input channels This VI waits until all samples arrive in time before returning The start time of a waveform indicates the time of the first CAN sample in the array The delta time of a waveform indicates the time between each sample in the array as determined by the original sample rate ECU M amp C Toolkit User Manual 5 52 ni com Chapter5 ECU M amp C API for LabVIEW If the initialized sample rate is zero this poly VI returns an error If the intent is to simply read the most recent sample for a task use the 1Chan 1Samp Dbl type If no message has been received since you started the task a 0 is returned in all entries of the value waveform You can use error out to determine whether a new message has been received since
274. must call the DAQ Write function to output floating point samples The application typically calls DAQ Write in a loop until done The DAQ Write function is MC DAQ Write vi in LabVIEW or mcDAQWrite in other languages 4 12 ni com Chapter 4 Using the ECU M amp C API DAQ Clear DAQ Clear must always be the final function called for a specific Measurement task If you do not use DAQ Clear the remaining Measurement task configuration can cause problems in the execution of subsequent ECU M amp C applications Because this function clears the Measurement task the Measurement task reference is transferred into an ECU reference task handle To change the properties of a running Measurement task use DAQ Start Stop to stop the task Set Property to change the desired DAQ property then DAQ Start Stop to restart the Measurement task again The function to clear a DAQ list is MC DAQ Clear vi in LabVIEW or mcDAQClear in C Memory Programming The ECU Measurement and Calibration Toolkit allows you to issue a memory programming sequence for your ECU after you create an ECU Reference handle as described in the Basic Programming Model section The flowchart in Figure 4 6 illustrates the general process of a memory programming sequence of an ECU with the ECU M amp C functions A description of each step in the decision process follows the flowchart National Instruments Corporation 4 13 ECU M amp C Toolkit User Manual Chapter 4 Using the ECU
275. n cluster to error out status is TRUE if an error occurred Unlike other VIs this VI will execute when status is TRUE 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 source identifies the VI where the error occurred Output DB ref out is the task reference which links to the opened database file 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 status is TRUE if an error occurred ECU M amp C Toolkit User Manual 5 76 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Description MC ECU Deselect vi deselects the communication to the ECU After c
276. n error out Input DB reference in is the task reference from the initial database task VI The task reference is originally returned from MC Database Open vi 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 status is TRUE if an error occurred Unlike other VIs this VI will execute when status is TRUE 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 source identifies the VI where the error occurred 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 status is TRUE if an error occurred ECU M amp C Toolkit User Manual 5 60 ni com Chapter5 ECU M amp C API for LabVIEW 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 de
277. n error out Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Address is a cluster which contains the following values i Address specifies the address part of the active calibration page address i P National Instruments Corporation 5 15 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Extension contains the extension part of the active calibration page address Error out describes error conditions If the Error in cluster indicated an error the Error out cluster c
278. n externally calculated function for instance Win32 DLL UNIX shared object file etc The master retrieves the name of the external function file to be used for this slave from the ASAM MCD 2MC description file The CRC algorithms are specified by the following parameters Name Width Poly Init Refin Refout XORout XCP_CRC_16 16 0x8005 0x0000 TRUE TRUE 0x0000 XCP_CRC16_CITT 16 0x1021 OxFFFF FALSE FALSE 0x0000 XCP_CRC_32 32 32 0x04C11DB7 OxFFFFFFFF TRUE TRUE OxFFFFFFFF Name The name of the algorithm A string value starting with XCP_ Width The width of the algorithm expressed in bits This is one less than the width of the Poly Poly The polynomial This is a binary value specified as a hexadecimal number The top bit of the Poly should be omitted For example if the Poly is 0x10110 you should specify 0x06 An important aspect of this parameter is that it represents the unreflected polynomial The bottom of this parameter is always the least significant bit LSB of the divisor during the division regardless of whether the algorithm is reflected Init This parameter specifies the initial value of the register when the algorithm starts This is the value to be assigned to the register in the direct table algorithm In the table algorithm we may think of the register always commencing with the value zero and this value being XORed into the register after the nth bit iteration Thi
279. n the Memory Transfer Address pointer 0 MTAO has been set CCP only Format mcTypeStatus mcCCPGetResult mcTypeTaskRef ECURefNum u32 BlockSize u8 Data Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx BlockSize BlockSize determines the size of the data block to be uploaded from the ECU Output Data Data contains the data uploaded from the ECU memory Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description This function uploads data from the ECU It is assumed that the Memory Transfer Address 0 MTAO has already been set to the start address of the data to be uploaded Functions like mcCCPActionService or mcCCPDiagService implicitly set the Memory Transfer Address 0 MTAO to the beginning of their result To upload data from a specified address use mcUp1oad instead National Instruments Corporation 6 17 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcCCPGetSessionStatus
280. nction must have a unique name To achieve unique function names for the seed and key and checksum functions these functions have the module name in lower case followed by an underline as a prefix The following example shows a possible header file for a module used for seed and key and checksum calculation under VxWorks targets ifndef _ CCPECU_h__ define _ CCPECU_h__ brief defines the name of the Seed Key function SLE Here the name of the seed key function is defined The name of the seed key function is the name of the module in lower case letters followed by an underscore and the function name ASAPI1A_ CCP_ComputeKeyFromSeed todo replace the prefix ccpecu_ by the name of your module in lower case letters define SEED KEY NAME ccpecu_ASAP1A_CCP_ComputeKeyFromSeed brief defines the name of the Checksum function Here the name of the Checksum function is defined The name of the Checksum function is the name of the module in lower case letters followed by an underscore and the function name CalcChecksum todo replace the prefix ccpecu_ by the name of your module in lower case letters define CALC_CHECKSUM_NAME ccpecu_CalcChecksum struct TRange char pMem unsigned long l1Len F ifdef _ cplusplus extern C endif ECU M amp C Toolkit User Manual 4 24 ni com Chapter 4 Using the ECU M amp C API brief F
281. nds and data from the host to the slave device DTO ID sets the Data Transmission Object DTO ID which the ECU uses to respond to CCP commands and send data and status information to the CCP master application Baud rate sets the baud rate in use by the selected CAN interface This property applies to all tasks initialized with the NI CAN 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 can specify the advanced baud rate as 8000XXYY hex where YY is the value of Bit Timing Register 0 BTRO and XX is the value of Bit Timing Register 1 BTR1 Station Address sets the slave device station address A CCP address 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 must be unique for all ECUs sharing the same CAN Arbitration IDs National Instruments Corporation 5 73 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW ECU M amp C Toolkit User Manual Unless an ECU has been addressed by its station address the ECU must not react to CCP commands sent by the CCP master Byte Order sets 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 E
282. ng its data type and Propertyld refer to the Properties section SizeOfValue Number of bytes allocated for the Value output This size normally depends on the data type listed in the description of the property Output Value Returns the property value Property1d determines the data type of the returned value Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 72 ni com Properties Chapter 6 Table 6 4 Values for PropertylD Data Type Name Description u32 mcPropCANBaudRate Returns the CAN Baud rate for CCP or XCP on CAN which is used to send commands and data from the host to the slave device u32 mcPropChar_Address Returns the address of the selected Characteristic in the memory of the ECU u32 mcPropChar_ByteOrder Returns the specified byte order 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
283. ng sequence MC Set Property vi Sets a property for the specified A2L database file Measurement task or Characteristic The poly VI selection determines the property to set MC Upload vi Uploads data from an ECU MC XCP Copy Cal Page vi Forces a copy transaction of one calibration page to another MC XCP Get Cal Page vi Queries a calibration page setting MC XCP Get ID vi Queries session configuration or slave device identification MC XCP Get Status vi Queries the current session status from an ECU slave device MC XCP Program Prepares the programming of non volatile memory Prepare vi MC XCP Program Verify vi Performs a non volatile memory certification task on the ECU device MC XCP Set Cal Page vi Sets a calibration page MC XCP Set Request vi Performs a request to save session and device information to non volatile memory MC XCP Set Segment Sets the mode of a specified segment Mode vi ECU M amp C Toolkit User Manual 5 4 ni com Chapter5 ECU M amp C API for LabVIEW MC Build Checksum vi Purpose Calculates a checksum over a defined memory range within the ECU Format ECU ref in ECU ref out address type of checksum block size checksum error in error out Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs
284. ngth of actually calculated checksum 1 8 5 Flag field for commanding how the algorithm works Currently only bit 0 is defined Bit 0 0 pnChecksunm receives the algorithm checksum calculation result Bit 0 1 pnChecksunm points to a checksum that is compared within the DLL with the checksum that the algorithm calculates Returns TRUE if the checksums are identical FALSE otherwise All other bits are reserved and should be set to 0 TRange is defined as follows struct TRange char pMem unsigned long lLen National Instruments Corporation 4 21 ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API The calling convention is as defined in the WIN32 API Specification for ASAP Ib chapter 2 4 Checksum Algorithm Example The following example shows a possible header file for a library for checksum calculation checksum h Header file for Checksum Algorithm ifndef _CHECKSUM_H define _CHECKSUM_H ifdef _ cplusplus extern C endif ifndef DllImport define DllImport __declspec dllimport endif ifndef D11Export define D11Export __declspec dllexport endif ifdef CHECKSUMAPI_IMPL only defined by implementor of ChecksumApi define CHECKSUMAPI D11Export _ cdecl else define CHECKSUMAPI DllImport _ cdecl endif struct TRange char pMem unsigned long lLen F ifdef _ cplusplus extern C endi
285. nguage you use for application development determines how to access the ECU M amp C Toolkit APIs ECU M amp C Toolkit functions and controls are available in the LabVIEW palettes In LabVIEW the ECU M amp C Toolkit palette is located e Within the All Functions palette for LabVIEW 7 1 e Within the Addons palette for LabVIEW 8 0 and 8 1 The reference for each ECU M amp C Toolkit API function is in Chapter 5 ECU M amp C API for LabVIEW To access the reference for a function from within LabVIEW press lt Ctrl H gt to open the Help window click the appropriate ECU M amp C function and then follow the link The ECU M amp C Toolkit software includes a full set of examples for LabVIEW These examples teach programming basics as well as advanced topics The example help describes each example and includes a link you can use to open the VI Within LabWindows CVI the ECU M amp C Toolkit function panel is in Libraries ECU Measurement and Calibration Toolkit Like other LabWindows CVI function panels the ECU M amp C Toolkit function panel provides help for each function and the ability to generate code The reference for each API function is located in Chapter 6 ECU M amp C API for C You can access the reference for each function directly from within the function panel The header file for the ECU M amp C Toolkit APIs is niemc h The library for the ECU M amp C Toolkit APIs is niemcc 1ib National Instruments Corporation 3 1 ECU M amp
286. nnect vi Permanently disconnects the CCP communication to the selected ECU and ends the calibration session MC ECU Open vi Opens a specified A2L database and selects the first ECU found in the database If there are several ECUs stored in the A2L database use the Database Open and ECU Select VIs MC ECU Select vi Selects an ECU from the names stored in an A2L database MC Event Create vi Creates an Event object in memory MC Generic vi Sends a generic CCP or XCP command MC Get Names vi Gets an array of ECU names Measurement names Characteristic names Event names Calibration page names or Group names from a specified A2L database file MC Get Property vi Gets a property for the object referenced by the reference in terminal The poly VI selection determines the property to get MC Measurement Create vi Creates a Measurement object in memory National Instruments Corporation 5 3 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 1 ECU M amp C API Vis for LabVIEW Continued Function Purpose MC Measurement Read vi Reads a single Measurement value from the ECU MC Measurement Write vi Writes a single Measurement value to the ECU MC Program vi Programs a memory block on the ECU MC Program Reset vi Indicates the end of a programming sequence MC Program Start vi Indicates the start of a programmi
287. nstruments Corporation 5 39 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW returned For a description of the code wire the error cluster to a LabVIEW error handling VI such as the Simple Error Handler ated source identifies the VI where the error occurred Unit configures the measurement channel unit string You can use this value to display units such as volts or RPM along with the samples of the channel ECU ref out is the task reference that links to the selected ECU 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description Use MC Conversion Create vi to create a conversion object in memory instead of referring to measurement properties defined in the A2L database ECU M amp C Toolkit User Manual 5 40 ni com MC DAQ Clear vi Chapter5 ECU M amp C API for LabVIEW
288. nteger Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description If you are using the XCP protocol mcProgramStart implements the XCP command PROGRAM_ START This optional command the beginning of a programming sequence into a non volatile memory area If the slave device is not in a state which permits programming an error is returned The memory programming commands The end of a non volatile memory programming sequence is indicated by using the mcSet Property function For further information on how to use program ECU memory and to use the mcProgramStart command refer to the ASAM XCP Part 2 Protocol Layer Specification ECU M amp C Toolkit User Manual 6 92 ni com Chapter 6 ECU M amp C API for C mcSetProperty Purpose Sets a property of the driver the database the ECU a Characteristic a Measurement or a Measurement task Format mcTypeStatus mcSetProperty mcTypeTaskRef RefNum cstr Name u32 PropertyID u32 SizeOfValue void Value Input RefNum RefNum is any ECU M amp C task reference which consists of a valid link to the opened A2L database DBRefNum a selected ECU
289. ntrol applications such as within LabVIEW RT The third term indicates the data type used for each sample The type Dbl indicates double precision 64 bit floating point The type W m indicates the waveform data type The types ZD and 2D indicate one and two dimensional arrays respectively ECU M amp C Toolkit User Manual 5 50 ni com Chapter5 ECU M amp C API for LabVIEW 1Chan 1Samp Dbl Returns a single sample for the first channel initialized in channel list If the initialized sample rate is greater than zero this poly VI type waits for the next sample time and then returns a single sample This enables you to execute a control loop at a specific rate If the initialized sample rate is zero this poly VI immediately returns a single sample The samples output returns a single sample from the most recent message received If no message has been received since you started the task the value of 0 is returned in samples You can use error out to determine whether a new message has been received since the previous call to MC DAQ Read vi or MC DAQ Start Stop vi If no message has been received the warning code 3FF60009 hex is returned in error out If a new message has been received the success code 0 is returned in error out Unless an error occurs number of samples returned is one NChan 1Samp 1D Dbl Returns an array one entry for each channel initialized in channel list Each entry consists of a single sample The order of channel en
290. 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 source identifies the VI where the error occurred Description If an ECU offers a reduced and specific range of DAQ list entry numbers use MC DAQ List Initialize vi to setup your Measurement list MC DAQ List Initialize vi does not start the transmission of the DAQ lists from the ECU to the application or vice versa through CCP or XCP This enables you to use MC Set Property vi to change the properties of a Measurement task After you change properties use MC DAQ Start Stop vi to start the communication for the Measurement task To query the available DAQ list entry numbers use MC Get Property vi with the Poly option selection DAQ List Numbers ECU M amp C Toolkit User Manual 5 48 ni com Chapter5 ECU M amp C API for LabVIEW MC DAQ Read vi Purpose Reads samples from a Measurement task Format DAQ ref in DAQ ref out number of samples number of samples returned error in value error out Input DAQ ref in is the task reference from the previous Measurement task VI The task reference is originally returned from MC DAQ Initialize vi and then wired through subsequent Meas
291. ock sequence number of the new flash content file 0x80 0xFF User defined It is possible to use different access modes for clearing and programming ECU XCP Compression Method Sets the selected compression method used for MC Program vi 0 data is uncompressed Ox80 0xFF User defined ECU XCP Encryption Method Sets the selected encryption method used for MC Program vi 0x00 data is not encrypted 0x80 0xFF User defined ECU XCP Programming Method Sets the selected programming method used for MC Program vi 0x00 Sequential programming Ox80 0xFF User defined ECU M amp C Toolkit User Manual 5 140 ni com Chapter 5 ECU M amp C API for LabVIEW Table 5 6 ECU Specific Property Value Types for the POLY Input Value Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description ECU XCP CAN Baudrate Sets the Baud Rate in use by the NI CAN Interface Basic baud rates such as 125000 and 500000 are specified as the numeric rate Advanced baud rates are specified as 8000XXYY hex where YY is the value of Bit Timing Register 0 BTRO and XX is the value of Bit Timing Register 1 BTR1 of the CAN controller chip ECU XCP CAN CRO Id Sets the CRO ID Command Receive Object which is used to send commands and data from the host to the slave device ECU
292. ofString str ErrorString Input Status Nonzero status code returned from an ECU M amp C function SizeofString SizeofString buffer in bytes Output Errorstring ASCII string that describes Status Description When the status code returned from an ECU M amp C function is nonzero an error or warning is indicated This function is used to obtain a description of the error warning for debugging purposes The return code is passed into the Status parameter The SizeofString parameter indicates the number of bytes available in the string for the description The description is truncated to size SizeofString if needed but a size of 300 characters is large enough to hold any description The text returned in ErrorString is null terminated so it can be used with ANSI C functions such as printf For applications written in C or C each ECU M amp C function returns a status code as a signed 32 bit integer The following table summarizes the ECU M amp C use of this status Table 6 9 Description of Return Codes Status Code Definition Negative Error Function did not perform expected behavior Positive Warning Function performed as expected but a condition arose that may require attention Zero Success Function completed successfully ECU M amp C Toolkit User Manual 6 102 ni com Chapter 6 ECU M amp C API for C The application code should check the status returned from every ECU M amp C function
293. olicy 2 4 C procedure 2 2 terms defined 2 3 volume licensing 2 4 activating your software xv additional programming topics 4 16 generic CCP functions 4 17 generic XCP functions 4 18 Get Names 4 16 seed and key algorithm 4 19 Set Get Properties 4 16 application development on CompactRIO or R Series using NI 985x or NI 986x C Series module 3 4 ASAM definition 1 1 ASAM MCD 2MC communication properties Baudrate 4 6 C functions list of functions 6 2 mcBuildChecksum 6 6 mcCalculateChecksum 6 10 mcCCPActionService 6 12 mcCCPDiagService 6 14 mcCCPGetActiveCalPage 6 16 mcCCPGetResult 6 17 mcCCPGetSessionStatus 6 18 mcCCPGetVersion 6 19 mcCCPMoveMemory 6 20 mcCCPSelectCalPage 6 22 mcCCPSetSessionStatus 6 23 options table 6 23 mcCharacteristicRead 6 25 mcCharacteristicReadSingle Value 6 26 mcCharacteristicWrite 6 28 CRO ID 4 5 ae negi DTO ID 4 5 mcCharacteristicWriteSingle Value 6 29 Station Address 4 5 mcClearMemory ot with CAN 4 5 mcConversionCreate 6 32 mcDAQClear 6 34 mcDAQInitialize 6 35 mcDAQListInitialize 6 38 mcDAQRead 6 40 B mcDAQReadTimestamped 6 43 mcDAQStartStop 6 46 with UDP or TCP 4 6 overview l 1 basic programming model 4 3 f Characteristic Read and Write 4 7 mcDAQWrite 6 48 communication figure 4 4 meDatabaseClose 6 50 ECU Close 4 7 mcDatabaseOpen 6 51 National Instruments Corporation l 1 ECU M amp C Toolkit User Manual Index mcDoubleToText
294. olkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Upload vi Purpose Uploads data from an ECU Format ECU ref in ECU ref out address data block size t error out error in Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Address is a cluster which contains the following values E E Address specifies the address part of the source address in the ECU from which the memory block is copied Extension specifies the extension part of the source address Block size is the size of the data block in bytes to be uploaded 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 HE status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred ECU M amp C Toolkit User Manual 5 146 ni c
295. om Chapter5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Data is a byte array which receives the uploaded data from the ECU 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 ie E status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC Upload vi implements the UPLOAD command A data block of the specified length starting at the specified address is uploaded from the ECU MC Upload vi will set the Memory Transfer Address pointer MTAO to the appropriate value as defined in the Address cluster If you are using the CCP protocol MC Upload vi implements the UPLOAD command A data block of the specified length starting at the specified address is uploaded from the ECU MC Upload vi will set the Memory Transfer Address pointer MTAO to the appropriate value as defined in the Address clu
296. om mcECUSelectEx Address Configures the target address for the checksum operation in the ECU mcAddress is a C struct consisting of Address Specifies the address part of the target address Extension Extension contains the extension part of the target address BlockSize BlockSize determines the size of the block on which the checksum must be calculated ChecksumType ChecksumType returns the type of the calculated checksum For CCP ChecksumType is OxFF For XCP refer to the Description section Output SizeofChecksum SizeofChecksunm returns the size in bytes of the calculated checksum Checksum Checksum is the calculated checksum Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention ECU M amp C Toolkit User Manual 6 6 ni com Chapter 6 ECU M amp C API for C Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcBuildChecksum is used to calculate the checksum of a specified memory block inside the ECU starting at the selected Address If you are using the CCP protocol mcBuildCchecksum implements the CCP BUILD_CHKSUM command T
297. on Output ResultLength ResultLength returns the number of bytes that can be uploaded from the ECU as a result of the execution of the service The result of this service can be accessed by calling the function mcCCPGetResult right after mcCCPDiagService DataType DataType is a data type qualifier which provides information about the data type of the result of the diagnostic service ECU M amp C Toolkit User Manual 6 14 ni com Chapter 6 ECU M amp C API for C Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcCCPDiagService implements the CCP command DIAG_SERVICE which calls a diagnostic service on the ECU and waits until it is finished The selected ServiceNo specifies the diagnostic service that must be executed inside the ECU For more information about the available services that are implemented in the ECU refer to the documentation for the ECU The result of this service can be accessed by calling the function mcCCPGetResult right after mcCCPDiagService National
298. on at a time After a successful ECU Connect you can create a Measurement Task or read write a Characteristic The function to open and select an ECU is MC ECU Connect vi in LabVIEW and mcECUConnect in C ECU Disconnect The ECU Disconnect function permanently disconnects the specified slave and ends the measurement and calibration session When the measurement and calibration session is terminated all DAQ lists for the device are stopped and cleared and the protection masks of the device are set to their default values The function to disconnect an ECU is MC ECU Disconnect vi in LabVIEW or mcECUDisconnect in C ECU Close The MC ECU Close function deselects the ECU and closes the remaining database reference handle MC ECU Close must always be the final ECU M amp C function call If you do not use MC ECU Close the remaining task configurations can cause problems in the execution of subsequent ECU M amp C applications The function to close an ECU is MC ECU Close vi in LabVIEW To deselect the ECU and close the database reference handle in C call the function mcECUDeselect followed by mcDatabaseClose Characteristic Read and Write Access Characteristics To access the Characteristics of an ECU you must select and connect to the specified ECU through the procedure given above The function to open and select an ECU is MC ECU Open vi in LabVIEW or mcDatabaseOpen followed by mcECUSelectEx in C Once the ECU has been connected an E
299. ontains the same information Otherwise Error out describes the error status of this VI status is TRUE if an error occurred PTF 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 source identifies the VI where the error occurred Description MC CCP Get Active Cal Page vi retrieves the ECU Memory Transfer Address pointer of the active calibration data page MC CCP Get Active Cal Page vi implements the CCP command GET_ACTIVE_CAL_PAGE defined by the CCP specification ECU M amp C Toolkit User Manual 5 16 ni com Chapter5 ECU M amp C API for LabVIEW MC CCP Get Result vi Purpose Uploads requested data CCP only Format ECU ref in ECU ref out block size data error in error out Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 Block size is the size of the
300. onversion object in memory Format mcTypeStatus mcConversionCreate mcTypeTaskRef ECURefNum char ConversionName 64 Factor 64 Offset char Unit Input ECURefNum ECURefNum is the task reference that links to the selected ECU This reference is originally returned from mcECUCreate ConversionName ConversionName identifies the conversion object that handles measurement scaling Use this name as a reference in mcConversionCreate Factor Factor configures the scaling factor used to convert raw measurement data in the message to from scaled floating point units The factor is the A in the linear scaling formula AX B where X is the raw data and B is the scaling offset Offset Offset configures the scaling offset used to convert raw data in the measurement message to from scaled floating point units The scaling offset is the B in the linear scaling formula AX B where X is the raw data and A is the scaling factor Unit Configures the measurement channel unit string You can use this value to display units such as volts or RPM along with the channel samples Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may requir
301. or Handler source identifies the VI where the error occurred Description MC CCP Get Result vi uploads data bytes from the ECU It is assumed that the Memory Transfer Address 0 MTAO has been set by a previous VI like MC Generic vi with the command SET_MTA ECU M amp C Toolkit User Manual 5 18 ni com Chapter 5 MC CCP Get Session Status vi ECU M amp C API for LabVIEW Purpose Retrieves the current calibration status of the ECU CCP only Format status qualifier ECU ref in ECU ref out session status error in error out additional status Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU 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 Select vi and then wired through subsequent VIs error in cluster to error out status is TRUE status is TRUE if an error occurred This VI is not executed when 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 source identifies the
302. ot execute when status is TRUE 5 132 ni com Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred Reference out is a copy of the reference in terminal which can be wired through subsequent ECU M amp C VIs 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 status is TRUE if an error occurred 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 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 speci
303. page number destination Output None Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 106 ni com Chapter 6 ECU M amp C API for C Description mcXCPCopyCalPage implements the XCP command COPY_CAL_PAGE and forces the slave to copy one calibration page to another This command is only available if more than one calibration page is defined In principal any page of any segment can be copied to any page of any other segment but there may be restrictions Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request National Instruments Corporation 6 107 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcXCPGetCalPage Purpose Queries a calibration page setting Format mcTypeStatus mcXCPGetCal Page mcTypeTaskRef ECURefNum u8 Mode u8 Segment u8 Page Input ECURefNum ECURe fNum is the task reference which links to the selected ECU This reference is originally returned from mcE
304. perty 4 5 D deactivating a product xvii debugging an application 3 6 definition of activation terms 2 3 developing an application 3 1 diagnostic tools NI resources B 1 documentation conventions used in manual xiii NI resources B 1 related documentation xiv drivers NI resources B 1 DTO ID property 4 5 ni com E ECU API C 6 1 LabVIEW 5 1 ECU Characteristics definition 4 2 overview 1 4 ECU Close 4 7 ECU Connect 4 6 ECU databases 1 4 ECU Disconnect 4 7 ECU M amp C API additional programming topics 4 16 architecture figure 4 1 CCP functions overview 4 3 Channel functions 4 2 structure 4 1 XCP functions overview 4 3 ECU Measurements DAQ Clear 4 13 DAQ Read 4 11 DAQ Start Stop 4 10 DAQ Write 4 12 definition 4 2 DTO ID 4 10 ECU DAQ Initialize 4 10 ECU reference handle 4 10 flowchart figure 4 9 list 4 10 mode 4 10 overview 4 9 sample rate 4 10 ECU Open 4 5 ECU toolkit activation 2 2 API overview 4 1 basic programming model 4 3 Characteristics 1 4 National Instruments Corporation l 3 Index databases ASAM MCD 2MC 1 4 ASAP 1 4 definition 1 1 hardware and software requirements 2 10 installation 2 1 introduction 1 1 LabVIEW RT 2 5 license management 2 1 Measurements 1 4 examples NI resources B 1 F FTP transfers table 2 6 FTP with LabVIEW 2 9 FTP with LabVIEW RT graphical file transfer utility
305. poly VI type waits for the next sample time then writes a single sample for each channel This enables you to execute a control loop at a specific rate If the initialized sample rate is zero this poly VI immediately writes a single sample for each channel The samples output returns a single sample for each channel from the most recent message received If no message has been received for a channel since you started the task a 0 is returned in samples You can specify channels in channel list that span multiple messages A sample from the most recent message is returned for all channels You can use error out to determine whether a new message has been received since the previous call to MC DAQ Write vi or MC DAQ Start Stop vi If no message has been received for one or more channels the warning code 3FF60009 hex is returned in error out If a new message has been received for all channels the success code 0 is returned in error out Unless an error occurs number of samples returned is one The samples array is indexed by channel and the entry for each channel contains a single sample If you need to determine the number of channels in the task after initialization get the Number of Channels property for the task reference National Instruments Corporation 5 59 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Database Close vi Purpose Closes a specified A2L Database Format DB ref in error i
306. protocol The memory range of a single Characteristic can be structured in three ways e 0 dimensional a single value e _1 dimensional a curve of values e 2 dimensional a field of values A Characteristic may be defined as read only or read and write accessible 4 2 ni com Chapter 4 Using the ECU M amp C API ECU M amp C CCP and XCP Functions The ECU M amp C Channel functions do not expose the method used for ECU memory access However some applications may need specific CCP or XCP command sequences or custom designed commands which are not supported by the CCP or XCP protocols For these applications the ECU M amp C CCP functions and the ECU M amp C XCP functions provide access to the ECU information at a very low level Basic Programming Model The flowchart in Figure 4 2 illustrates the process to initiate communication to an ECU with the ECU M amp C Channel functions A description of each step in the decision process follows the flowchart National Instruments Corporation 4 3 ECU M amp C Toolkit User Manual Chapter 4 Using the ECU M amp C API Yes A2L file contains communication properties Using CCP or XCP on CAN Yes No y Set CRO ID Set IP Address or Hostname Set DTO ID Set Port Number Set Station Address Set Baudrate ECU Connect Yes No Measurement Task Characteristic Read Write G
307. purchase of a single copy of software included in your software kit on your Certificate of Ownership The serial number for hardware products is printed either on the product box or on the device Computer ID or A 16 character ID that uniquely identifies your computer or NI hardware Device ID generated during the activation process Activation Code A 20 character code that enables NI software to run on your computer based on your serial number and computer ID You generate and install an activation code by completing the activation process National Instruments Corporation 2 3 ECU M amp C Toolkit User Manual Chapter 2 Installation and Configuration Moving Software After Activation To transfer your software to another computer install and reactivate it on the second computer You are not prohibited from transferring your software from one computer to another Because activation codes are unique to each computer you will need a new activation code Follow the steps on the previous page to acquire a new activation code and reactivate your software Volume License Program Online Activation National Instruments offers volume licenses through the NI Volume License Program The NI Volume License Program makes managing software licenses and maintenance easy For more information refer to ni com vlp Activation is available on ni com activate 24 hours a day 7 days a week You can retrieve an activation code from any com
308. puter that has an Internet connection NI does not require that the computer on which you run NI software have Internet or email access Home Computer Use Privacy Policy National Instruments permits you to use this software at home Refer to the NI License Manager help file or the software end user license agreement in the installer or online at ni com legal license for more information National Instruments respects your privacy For more information about the National Instruments activation information privacy policy go to ni com activate privacy Upon successful activation you can use the product immediately 3 Note Ifthe ECU M amp C Toolkit was in use before you began the activation process you may need to restart it for the change to take effect Tip In the NI License Manager products that have not been activated are denoted either by a yellow stoplight or a red stoplight depending whether the product is in evaluation mode or is unusable Activated products are denoted by a green stoplight ECU M amp C Toolkit User Manual 2 4 ni com Chapter 2 Installation and Configuration LabVIEW Real Time RT Configuration PXI System LabVIEW Real Time RT combines easy to use LabVIEW programming with the power of real time systems When you use a National Instruments PXI controller as a LabVIEW RT system you can install a PXI CAN or PXI XNET card and use the ECU M amp C Toolkit to develop real time applications for C
309. r Object database task DLL DTO DTO ID National Instruments Corporation G 3 Command Return Message A CCP communication object used to send commands and data from a host device to a slave device The CRO is 8 bytes wide consisting of a Command byte a Command Counter byte and a 6 byte parameter data field CommandReceiveObject A CCP communication object used to send commands and data from a host device to a slave device The CRO is 8 bytes wide consisting of a Command byte a Command Counter byte and a 6 byte parameter data field CAN identifier of the Command Receive Object CRO Data Acquisition A single DAQ Measurement entry in a DAQ list A list of DAQ channels that is transmitted by the ECU Data acquisition mode A message sent from the slave device to the master device Command Return Message Event Message or Data Acquisition Message A task reference handle to the selected ASAM MCD 2MC database file Dynamic Link Library See Data Transfer Object CAN identifier of the DTO ECU M amp C Toolkit User Manual Glossary E ECU ECU M amp C Channel functions ECU reference ECU task Event Channel Extended arbitration ID Master ID Measurement Measurement task Memory Transfer Address MTA ECU M amp C Toolkit User Manual Electronic Control Unit An electronic device with a central processing unit performing programmed functions with its peripheral circuitry The part of the
310. r out HE Be status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred ECU M amp C Toolkit User Manual 5 124 ni com Chapter5 ECU M amp C API for LabVIEW ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC Measurement Write vi performs a single point write o
311. 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 mcDAQRead returns a single sample from the most recent messages received and greater than zero means that mcDAQRead returns samples timed at the specified rate For DAQMode of mcDAQModePolling SampleRate is ignored Output DAQRefNum DAQRefNum is the reference handle for the Measurement task Use this Measurement task reference in subsequent M amp C DAQ functions for this task Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value ECU M amp C Toolkit User Manual 6 36 ni com Chapter 6 ECU M amp C API for C Description mcDAQInitialize does not start the transmission of the DAQ lists on the ECU This enables you to use mcSet Property to change the properties of a Measurement task After you change properties use mcDAQStartStop to start the transmission of the Measurement task National Instruments Corporation 6 37 ECU M amp C Too
312. ration Protocol XCP Using NI CAN If you are using the CCP protocol with NI CAN hardware YYY can be associated with a defined NI CAN interface CANO CAN1 up to CAN63 CAN network interface names are associated with physical CAN ports using the Measurement and Automation Explorer MAX For example if you are using the CCP protocol on NI CAN interface CAN1 the value passed to Interface is CCP CAN1 The special string values CAN256 and ECU M amp C Toolkit User Manual 6 58 ni com Chapter 6 ECU M amp C API for C CAN257 refer to virtual interfaces Refer to the NI CAN Hardware and Software User Manual for detailed information on how to use virtual NI CAN ports If you are using the XCP protocol YYY can be associated with a XCP transport layer The transport layers may defined as follows e CANxx e TCP e UDP If you select CAN as the transport layer you must specify the NI CAN interface CANO CANI up to CAN63 CAN network interface names are associated with physical CAN ports using the Measurement and Automation Explorer MAX For example if you are using the XCP on NI CAN interface CAN2 the value passed to Interface is XCP CAN2 If you are using the XCP on UDP the value passed to Interface is XCP UDP If you are using the XCP on TCP the value passed to Interface is XCP TCP The special string values CAN256 and CAN257 refer to virtual interfaces Refer to the NI CAN Hardware and Software User Manual for d
313. ray Input channel data are received from the DAQ messages Use MC DAQ Read vi to obtain input samples as an array of sample timestamp pairs poly VI types ending in Timestamped Dbl Use this input mode to read samples with timestamps that indicate when each channel is received from the network Sample rate specifies the timing to use for samples of the task The sample rate is specified in Hertz samples per second A sample rate of zero means to sample immediately If the Mode is defined as DAQ list a sample rate of zero means that MC DAQ Read vi returns a single point from the most recent message received and greater than zero means that MC DAQ Read vi returns samples timed at the specified rate If the Mode is defined as Polling the sample rate is ignored 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error
314. re returning In other words the SampleRate specifies a virtual clock that copies the most recent value from CAN messages for each sample time The changes in sample values from message to message enable you to view the channel over time such as for comparison with other CAN or DAQ input channels To avoid internal waiting you can use mcGet Property to obtain nctPropSamplesPending property and pass that as the NumberOfSamplesToRead parameter to mcDAQRead If the initialized SampleRate is zero mcDAQRead immediately returns a single sample from the most recent message s received For this single point read you must pass the NumberOfSamplesToRead parameter as You can use the return value of mcDAQRead to determine whether a new message has been received since the previous call to mcDAQRead or mcDAQStartStop If no message has been received the warning code CanWarnOldData is returned If a new message has been received the success code 0 is returned If no message has been received since you started the task the default value of the channel nct PropChanDefaul1tValue is returned in all entries of SampleArray ECU M amp C Toolkit User Manual 6 42 ni com Chapter 6 ECU M amp C API for C mcDAQReadTimestamped Purpose Reads timestamped samples from a DAQ task initialized with the selected mode of mcDAQModeDAQListTimeStamped Format mcTypeStatus mcDAQReadTimestamped mcTypeTaskRef DAQRefNum u32 NumberOfSamplesToRead __in
315. re the error cluster to a LabVIEW error handling VI such as the Simple Error Handler National Instruments Corporation 5 35 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW source identifies the VI where the error occurred abet Characteristic value is the value to be set for the Characteristic ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC Characteristic Write Single Value vi writes a value to a defined Characteristic on the ECU which is identified by the ECU Reference handle The location to which the value is written is identified by the x and y indices If the Characteristic array has 0 or dimensions y and or x can be left unwired ECU M amp C Toolkit User Manual 5 36 ni com
316. re the error occurred Description MC XCP Set Segment Mode vi implements the XCP command SET_SEGMENT_MODE and sets the selected segment into the specified mode If Mode 0 the segment disables the FREEZE mode if Mode 1 the segment is set to FREEZE mode through an XCP STORE_CAL_REQ operation Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to set up a request ECU M amp C Toolkit User Manual 5 170 ni com ECU M amp C API for C This chapter lists the ECU M amp C functions and describes the format purpose and parameters Unless otherwise stated each ECU M amp C function suspends execution of the calling thread until it completes The functions in this chapter are listed alphabetically Section Headings The following are section headings found in the ECU M amp C API for C functions Purpose Each function description includes a brief statement of the purpose of the function Format The format section describes the format of each function for the C programming language Input and Output The input and output parameters for each function are listed Description The description section gives details about the purpose and effect of each function List of Data Types The following data types are used with functions of the ECU M amp C API for C Table 6 1 Data Types for the ECU M amp C API for C Data Type Purpose i8 8 bit signed integer il6 16 b
317. rect byte ordering for this function For more information about the user defined commands and their parameters refer to the documentation for the ECU National Instruments Corporation 6 67 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcGetNames Purpose Retrieves a comma separated list of ECU names Measurement names Characteristic names Event names Characteristic pages or Group names from a specified A2L database Format mcTypeStatus Input RefNum Type ECU M amp C Toolkit User Manual mcGetNames mcTypeTaskRef RefNum u32 Type cstr ECUName u32 SizeOfNamesList str NameList RefNum is any ECU M amp C task reference which consists of a valid link to the opened A2L database DBRef Num a selected ECU ECURefNum or a Measurement task DAQRefNum RefNum must be valid for the related Type Specifies the Type of names to return 0 mcTypeECUNames Returns a list of ECU names You can pass one of the returned names to mcECUSelectEx 1 mcTypeMeasurementNames Returns a list of Measurement names You can pass the returned NamesList to mcDAQInitialize 2 mceTypeCharacteristicNames Returns a list of Characteristic names You can pass a single name out of the NamesList to mcCharacteristicWrite or mcCharacteristicRead 3 mceTypeEventChannelNames Returns a list of Event Channel names 4 mcTypeDefinedPagesNames Returns a list of Calibration page names 5 mcType
318. reen e R a EE AR EEE 4 7 ECU COSE nno i cseveceeSeeens cos rE E A E EE AEE E A E E 4 7 Characteristic Read and Write eeseeeseeeeeseeeeseesessesesessessressesrersessrereersreseeset 4 7 ACCESS Ch t cteristics Serseri eieren ise ee e aaa 4 7 Characteristic Read uniata E A 4 8 Characteristic Write snninerone n eaea na e idii 4 8 Measurement Task e eea sided RE AR EE AE aa E Taas 4 9 DAQ Initialize nnn i eset tities elias E EER nee 4 10 DAQ Start Stopien reai a a R A a S 4 10 DAQ Reads icci niin neiaa aa Satan aes eo aa eri a 4 11 DYOR i ERNE EE E hes eaa cides Gaal sliel Asai 4 12 DAQ Clear no Sater tial Ae hin cat Nee ees atl ae ethad ia ease 4 13 Memory Programming siesena a T a 4 13 Program Starte anean aieas s o as A E E AEA nis 4 14 Clear MEMOry ssori aee naaasar reniri ea nana Aeaee Eoo REEE Eais 4 15 Programi sorena A O E E EE EE 4 15 Program RSet tisscscasssiccuseesssssppcoecgsagcabescacaateeesadeaseents ahasioweadensesnaees 4 15 Optional Steps for the XCP Protocol 0 eee eee ees eeeeeeeeteeeseeeeees 4 15 Additional Programming Topics 0 cc eeeeeceseececseceseeseceseeseessesseesaeeseseaseseeeseseeeneeaes 4 16 Get Names araia aeea hack hake hast ocheach E A AEE r Meebo a a 4 16 Set Get Properties jipeni o n a a a a a ai ag 4 16 Generic CCP Functions ienesa aA EA as ob cb ead boca ea aAA TE ARREA 4 17 Generic XCP Functions iiid erana aa na an TOSA ERE EAEE ERARE 4 18 Seed and Key Algorithm eee ceseesecesecsecesecseeeeecec
319. related to the NI XNET hardware naming under Devices and Interfaces in MAX 5 80 ni com Chapter5 ECU M amp C API for LabVIEW CompactRIO or R Series If using CompactRIO or R Series hardware you must provide a bitfile that handles the CAN communication between the host system and FPGA To access the CAN module on the FPGA you must specify the bitfile name after the for example CCP CANI MyBitfile lvbitx To specify a special RIO target you can specify that target by its name followed by the bitfile name for example XCP CAN RIO1 MyBitfile lvbitx Currently only a single CAN interface is supported RJO defines the RIO target name as defined in your LabVIEW Project definition The vbitx filename represents the filename and location of the bitfile on the host You may use just the filename without the folder if the bitfile is in the same folder as the LabVIEW Project vproj DB path is a path to a A2L database file from which to get channel names The file must use a A2L extension You can generate A2L database files with several 3rd party tools EA 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 status is TRUE if an error occurred This VI will not execute when status is TRUE code is the error code number identifying an error A value of 0 means success A negative value means
320. riptions of the available Characteristics inside the ECU e Descriptions of how to access the ECU over CAN 3 Note Use of the ECU M amp C Toolkit requires an existing ASAM MCD 2MC database file These files can be generated by various third party utilities A database editor for ASAM MCD 2MC databases is not part of the ECU M amp C Toolkit ECU Measurements The ECU M amp C Toolkit provides the user access to ECU internal physical values defined by their names in the ASAM MCD 2MC database file Based on this information the ECU M amp C Toolkit communicates through CCP or XCP to the ECU A DAQ data acquisition list can be set up which sends ECU internal data synchronously or asynchronously to the CCP or XCP master The ECU M amp C Toolkit provides a way to configure several Measurement channels into a single Measurement task The term task refers to a list of measurements channels read or written together A common use of the task concept is to read DAQ channels available on the ECU ECU Characteristics ECU M amp C Toolkit User Manual ECU Characteristics are maps of ECU internal variables which may be used as calibration information or set point information The ECU memory content of Characteristics can be read or even changed with the help of the ECU M amp C Toolkit 1 4 ni com Installation and Configuration This chapter explains how to install and configure the ECU M amp C Toolkit Installation This section di
321. ristic function to output scaled floating point samples The application typically calls Write Characteristic on demand Calling Write Characteristic in a loop can cause significant network traffic as Characteristics may contain large amounts of data The function to write a Characteristic is MC Characteristic Write vi in LabVIEW or mcCharacteristicWrite in C Before writing a Characteristic it may be helpful to verify the dimension of the Characteristic based on the definition in the ASAM MCD 2MC database file Depending on the dimension of the Characteristic use the appropriate Write function for writing a double a 1D array of doubles or a 2D array of doubles The function to verify a dimension of a named Characteristic is MC Get Property vi with the parameter Characteristic Dimension in LabVIEW or mcGetProperty with the parameter mcPropChar_Dimension in C 4 8 ni com Chapter 4 Using the ECU M amp C API Measurement Task To create a Measurement task you need to select available Measurement signals from an ASAM MCD 2MC database file Create a valid ECU Reference handle as described in the Access Characteristics section The flowchart in Figure 4 3 shows the process to perform an ECU Measurement task A description of each step in the decision process follows the flowchart ECU DAQ Init ECU DAQ Start Stop DAQ list or Polling mode ECU DAQ Write ECU DAQ Read ECU DAQ Clear ECU Close
322. rm using a sample rate gt 0 Input channel data are received from the DAQ messages Use MC DAQ Read vi to obtain input samples as single point array or waveform 5 46 ni com Chapter5 ECU M amp C API for LabVIEW Mode 1 Polling In this mode the data from the Measurement task are acquired from the ECU whenever the MC DAQ Read vi is called Mode 2 STIM List In this mode the data from the Measurement task are sent to the ECU whenever MC DAQ Write vi is called Mode 3 Timestamped read The data is transmitted from the ECU in equidistant time intervals as defined in the A2L database The data can be read back with MC DAQ Read vi as timestamped data array Input channel data are received from the DAQ messages Use MC DAQ Read vi to obtain input samples as an array of sample timestamp pairs Poly VI types ending in Timestamped Dbl Use this input mode to read samples with timestamps that indicate when each channel is received from the network Sample rate specifies the timing to use for samples of the task The sample rate is specified in Hertz samples per second A sample rate of zero means to sample immediately If the Mode is defined as DAQ List a sample rate of zero means that MC DAQ Read vi returns a single point from the most recent message received and greater than zero means that MC DAQ Read vi returns samples timed at the specified rate If the Mode is defined as Polling the sample rate is ignored Error in is a cl
323. rning is returned For a description of the code wire the error cluster to a LabVIEW error handling VI such as the Simple Error Handler source identifies the VI where the error occurred MC Double To Text vi performs text conversion for measurement or characteristic values Especially if the measurement or characteristic has an associated COMPU_VTAB type scaling the textual representation of the value is returned If no such value is present either because the object does not have a text scaling or the value does not have a textual representation in the table a string representation of the double value is returned National Instruments Corporation 5 65 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Download vi Purpose Downloads data to an ECU Format ECU ref in ECU ref out address data error out error in Input ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Address is a cluster which contains the following values Address specifies the address part of the destination address Extension contains the extension part of the destination address Data contains the information to be downloaded 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
324. rogram Reset vi may be used to reset a slave device for other purposes For further information on how to use program ECU memory and to use the MC Program Reset vi command refer to the ASAM XCP Part 2 Protocol Layer Specification National Instruments Corporation 5 129 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Program Start vi Purpose Indicates the start of a programming sequence Format ECU ref in ECU ref out error in error out Input ECU M amp C Toolkit User Manual ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire t
325. rror which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description Each returned sample corresponds to a received CAN message for the measurement channels initialized in the DAQ channel list For each sample mcDAQReadTimestamped returns the sample value and a timestamp that indicates when the message was received Because the timing of samples returned by mcDAQReadTimestamped is determined by when the message is received the initialized sample rate is not used ECU M amp C Toolkit User Manual 6 44 ni com Chapter 6 ECU M amp C API for C The function does not wait for messages but instead returns samples from the messages received since the previous call to mcDAQReadTimestamped The number of samples returned is indicated in the NumberOfSamplesReturned output up to a maximum of NumberOfSamplesToRead messages If no new message has been received NumberOfSamplesReturned is 0 and the return value indicates success National Instruments Corporation 6 45 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcDAQStartStop Purpose Starts the transmission of the DAQ lists assigned to the Measurement task on the ECU Format mcTypeStatus Input DAQRefNum
326. rror 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred ECU ref out is the task reference that links to the selected ECU 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred 5 74 ni com Chapter5 ECU M
327. s Corporation 5 33 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task 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 Description Poly VI Types status is TRUE if an error occurred 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 source identifies the VI where the error occurred Table 5 4 Poly VI Types for the Characteristic Parameter VI Type Description Parameter DBL Writes a single double value to the selected Characteristic name Curve 1D Writes a dimensional array of double values to the selected Characteristic name Field 2D Writes a 2 dimensional array of double values to the selected Characteristic name ECU M amp C Toolkit User Manual 5 34 ni com Chapter5 ECU M amp C API for LabVIEW MC Characteristic Write Single Value vi Purpose Writes a value to a named Characteri
328. s data from a named Characteristic on the ECU which is identified by the ECU Reference handle The Poly VI returns a specific double 1D or 2D double array Format characteristic name ECU ref in ECU ref out characteristic ener error out Input Characteristic name is the name of the Characteristic defined in the A2L database ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred This VI is not executed when status is TRUE 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 source identifies the VI where the error occurred National Instruments Corporation 5 29 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output Por ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for
329. s in the execution of subsequent applications Because this function clears the Measurement task the Measurement task reference is not given as an output but is transferred into an ECU reference task handle To change properties of a running Measurement task use mcDAQStartStop to stop the task mcSet Property to change the desired DAQ property then mcDAQStartStop to restart the Measurement task ECU M amp C Toolkit User Manual 6 34 ni com Chapter 6 ECU M amp C API for C mcDAQInitialize Purpose Initializes a Measurement task for the specified Measurement channel list Format mcTypeStatus mcDAQInitialize cstr MeasurementNames mcTypeTaskRef ECURefNum i32 DAQMode u32 DTO_ID 64 SampleRate mcTypeTaskRef DAQRefNum Input MeasurementNames Comma separated list of Measurement names to initialize as a task You can type in the channel list as a string constant or you can obtain the list from an A2L database file by using the mcGetNames function ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx DAQMode DAQMode specifies the I O mode for the task For an overview of the I O modes including figures refer to the Basic Programming Model section of Chapter 4 Using the ECU M amp C API mcDAQModeDAQList Data is transmitted automatically by the ECU using DAQ lists The data can be read back with the mcDAQRead as Single point data
330. s parameter should be specified as a hexadecimal number Refin A Boolean parameter If it is FALSE input bytes are processed with bit 7 being treated as the most significant bit MSB and bit 0 being treated as the least significant bit If this parameter is TRUE each byte is reflected before being processed ECU M amp C Toolkit User Manual 6 8 ni com Chapter 6 ECU M amp C API for C Refout A Boolean parameter If it is set to FALSE the final value in the register is fed into the XORout stage directly If this parameter is TRUE the final register value is reflected first XORout This is a width bit value that should be specified as hexadecimal number It is XORed to the final register value after the Refout stage before the value is returned as the official checksum For more detailed information about CRC algorithms refer to http www repairfaq org filipg LINK F_cre_v34 html National Instruments Corporation 6 9 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcCalculateChecksum Purpose Calculates the checksum of a data block in memory Format mcTypeStatus mcCalculateChecksum mcTypeTaskRef ECURefNum u32 BlockSize u8 Data u8 TypeOfChecksum u8 SizeOfChecksum u32 Checksum Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx BlockSize BlockSize determines the size of the block on which the
331. scribes the error status of this VI status is TRUE if an error occurred 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 source identifies the VI where the error occurred 5 96 ni com Description Poly VI Types Chapter 5 Table 5 5 Poly Values for Value Output ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description DB File Name Returns the A2L Database file name with which the task has been opened The value of this property cannot be changed using MC Set Property vi ECU Byte Order Returns 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 National Instruments Corporation 5 97 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU Seedkey Checksum DLL Path This proper
332. scription of the code wire the error cluster to a LabVIEW error handling VI such as the Simple Error Handler source identifies the VI where the error occurred Description MC Database Close vi must always be the final M amp C VI called for each communication task If you do not use MC Database Close vi the remaining task configurations can cause problems in the execution of subsequent Measurement and Calibration applications MC Database Close vi is an advanced function for database handling In most cases it is sufficient to use MC ECU Close vi instead Unlike other VIs MC Database Close vi will execute when status is TRUE in Error in Because this VI clears the task the task reference is not wired as an output National Instruments Corporation 5 61 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Database Open vi Purpose Opens a specified A2L Database Format DB path DB ref out error in error out Input DB path is a path to a A2L database file from which to get channel names The file must use a A2L extension You can generate A2L database files with several 3rd party tools 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 status is TRUE if an error occurred This VI will not execute when status is TRUE code is the error code number i
333. scusses the installation of the ECU M amp C Toolkit for Microsoft Windows 3 Note You need administrator rights to install the ECU M amp C Toolkit on your computer ee at Insert the ECU M amp C Toolkit CD into the CD ROM drive Open Windows Explorer Access the CD ROM drive Double click on autorun exe This will launch the software interface Start the installation The installation program will guide you through the rest of the installation process When installation is complete the National Instruments License Manager will launch automatically to activate your license License Management Overview License management is the process of controlling access to products based on an explicit license agreement The ECU M amp C Toolkit requires an activated license in order to launch so a license must be acquired and activated before the product can be used The activation process involves using the Activation Wizard to send the following information to National Instruments National Instruments Corporation The product you are activating ECU Measurement and Calibration Toolkit The serial number of the product The version of the product Your name 2 1 ECU M amp C Toolkit User Manual Chapter 2 Installation and Configuration e Your organization e A computer ID that uniquely identifies your system National Instruments uses this information to generate an activation code which is used to activate the ECU M amp
334. set correctly by the ECU M amp C Toolkit itself ECU M amp C Toolkit User Manual 5 100 ni com Chapter 5 Table 5 5 Poly Values for Value Output Continued ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU CCP ID Returns the slave device identifier This ID information is optional and specific to the ECU implementation For more information about the CCP slave ID refer to the documentation for the ECU ECU CCP ID Data Byte Returns a data type qualifier of the slave device identifier This ID information is optional and specific to the ECU implementation For more information about the CCP slave ID refer to the documentation for the ECU ECU CCP Interface Returns the interface initialized for the task such as with MC DAQ Initialize vi ECU CCP Master ID Returns CCP Master ID information 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 National Instruments Corporation 5 101 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description ECU CCP SeedKey Cal Returns th
335. several session states inside the ECU StatusQualifier and AdditionalStatus contain additional status information The content of these parameters is ECU specific and not defined by CCP For more information about the parameter SessionStatus refer to the description of mcCCPSetSessionStatus ECU M amp C Toolkit User Manual 6 18 ni com Chapter 6 ECU M amp C API for C mcCCPGetVersion Purpose Retrieves CCP version implemented in the ECU CCP only Format mcTypeStatus mcCCPGet Version mcTypeTaskRef ECURefNum u8 MajorVersion u8 MinorVersion Input ECURef Num ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Output MajorVersion MajorVersion returns the major version number of the CCP implementation MinorVersion MinorVersion returns the minor version number of the CCP implementation Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcCCPGetVersion can be used to query the CCP version imp
336. sfer Because activation codes are unique to each computer you will need a new activation code Refer to How Do I Activate My Software to acquire a new activation code and reactivate your software Deactivating a Product To deactivate a product and return the product to the state it was in before you activated it right click the product in the NI License Manager tree and select Deactivate If the product was in evaluation mode before you activated it the properties of the evaluation mode may not be restored Using Windows Guest Accounts NI License Manager does not support Microsoft Windows Guest accounts You must log in to a non Guest account to run licensed NI application software National Instruments Corporation xvii ECU M amp C Toolkit User Manual Introduction The ECU Measurement and Calibration ECU M amp C Toolkit contains a development system for an electronic control unit ECU based on existing ASAM standards The function set of the ECU M amp C Toolkit enables engineers to optimize and verify the functionality of electronic controller devices Most ECUs interact with other ECUs external sensors and actuators in a Controller Area Network CAN During the development and verification phase of an ECU engineers access the ECU for acquired data Measurement or to adjust parameters inside the ECU itself calibration Since the bandwidth and number of identifiers for a CAN network are limited the Association for
337. sk with the DAQ Start Stop function The DAQ Start Stop function is MC DAQ Start Stop vi in LabVIEW or mcDAQStartStop in C You can also start the Measurement task implicitly by issuing DAQ Read 4 16 ni com Chapter 4 Using the ECU M amp C API After the task is started you may need to change properties again To change properties within the application use the DAQ Start Stop function to stop the Measurement task Set Property to change properties then start the task again You also can use the Get Property function to get the value of any property The Get Property function returns values whether the task is running or not The Get Property function is MC Get Property vi in LabVIEW or mcGetProperty in C Generic CCP Functions The generic ECU M amp C CCP functions provide direct access to the CCP commands on a very low programming level For further information for the use and parameters of the CCP commands refer to the CAN Calibration Protocol Specification Version 2 1 Table 4 1 provides an overview of the CCP commands and their corresponding LabVIEW VIs or C functions Table 4 1 Overview of the CCP Commands with Related VIs and C Functions CCP Command LabVIEW VI Name C Function Name ACTION_SERVICE MC CCP Action Service vi mcCCPActionService BUILD_CHKSUM MC Build Checksum vi mcBuildChecksum CLEAR_MEMORY MC Clear Memory vi mcClearMemory DIAG_SERVICE MC CCP Diag Service vi mcCCPDiagService DN
338. specification Type Name Description 0x01 XCP_ADD_11 Add BYTE into a BYTE checksum ignore overflows 0x02 XCP_ADD_12 Add BYTE into a WORD checksum ignore overflows 0x03 XCP_ADD_ 14 Add BYTE into a DWORD checksum ignore overflows 0x04 XCP_ADD_22 Add WORD into a WORD checksum ignore overflows block size must be modulo 2 0x05 XCP_ADD_24 Add WORD into a DWORD checksum ignore overflows block size must be modulo 2 0x06 XCP_ADD_44 Add DWORD into DWORD ignore overflows block size must be modulo 4 0x07 XCP_CRC_16 Refer to CRC error detection algorithms 0x08 XCP_CRC_16_CITT Refer to CRC error detection algorithms 0x09 XCP_CRC_32 Refer to CRC error detection algorithms OxFF XCP_USER_ DEFINED User defined algorithm in externally calculated function If type of checksum is returned as OxFF XCP_USER_DEFINED the slave can indicate that the master for calculating the checksum must use a user defined algorithm implemented in an externally calculated function for instance Win32 DLL UNIX shared object file etc The master gets the name of the external function file to be used for this slave from the ASAM MCD 2MC description file or from a property which can be set For a detailed description of the checksum algorithm refer to the XCP Part 2 Protocol Layer Specification National Instruments Corporation 5 7 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW
339. specification Type Name Description 0x01 XCP_ADD_11 Add BYTE into a BYTE checksum ignore overflows 0x02 XCP_ADD_12 Add BYTE into a WORD checksum ignore overflows 0x03 XCP_ADD_14 Add BYTE into a DWORD checksum ignore overflows 0x04 XCP_ADD_22 Add WORD into a WORD checksum ignore overflows blocksize must be modulo 2 0x05 XCP_ADD_24 Add WORD into a DWORD checksum ignore overflows blocksize must be modulo 2 0x06 XCP_ADD_44 Add DWORD into DWORD ignore overflows blocksize must be modulo 4 0x07 XCP_CRC_16 Refer to CRC error detection algorithms 0x08 XCP_CRC_16_CITT Refer to CRC error detection algorithms 0x09 XCP_CRC_32 Refer to CRC error detection algorithms OxFF XCP_USER_ DEFINED User defined algorithm in externally calculated function For a detailed description of the checksum algorithm refer to the mcBuildChecksum command or the XCP Part 2 Protocol Layer Specification For more detailed information about CRC algorithms please refer to http www repairfaq org filipg LINK F_cre_v34 html National Instruments Corporation 6 11 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C meCCPActionService Purpose Calls an implementation specific action service on the ECU CCP only Format mcTypeStatus mcCCPActionService mcTypeTaskRef ECURefNum ul6 ServiceNo u8 Params 4 u8 ResultLength u8 DataType Input ECURefNum ECURefNum is the task ref
340. specify the CAN interface to use for this CCP task The interface input uses a ring typedef in which value 0 selects CANO value 1 selects CAN1 and so on As the ECU M amp C API is based on the NI CAN Channel API the NI CAN Frame API cannot be used on the same CAN network interface simultaneously If the CAN network interface is already initialized in the Frame API this function returns an error National Instruments Corporation 5 85 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Output ECU ref out is the task reference which links to the selected ECU 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC ECU Select vi creates an ECU reference handle linked to the selected ECU name MC ECU Select vi does not start communication This enables you to use MC Set Property vi to change the propert
341. status is TRUE if an error occurred This VI will not execute when status is TRUE code is the error code number identifying an error A value of 0 means success A negative value means error VI did not execute 5 64 ni com Output Description Chapter5 ECU M amp C API for LabVIEW 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task TextValue is the resulting converted text string If the value specified is listed in a COMPU_VTAB scaling for the characteristic or measurement specified in object name the respective text is returned If no such value is available a string representation of the double value is returned 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 status is TRUE if an error occurred 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 wa
342. ster If you are using the XCP protocol MC Upload vi implements the XCP command UPLOAD A data block of the specified length starting at the specified address is uploaded from the ECU The Memory Transfer Address pointer MTAO is post incremented by the given number of data elements If the slave device does not support block transfer mode all uploaded data is transferred in a single response packet If block transfer mode is supported the uploaded data is transferred in multiple responses on the same request packet For the master there are no limitations allowed concerning the maximum block size For further information on how to upload data and to use the MC Upload vi command refer to the ASAM XCP Part 2 Protocol Layer Specification National Instruments Corporation 5 147 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC XCP Copy Cal Page vi Purpose Forces a copy transaction of one calibration page to another Format source page source segment ECU ref in destination segment destination page error in ECU ref out error out Input Source page specifies the logical page number of the source data page Source segment specifies the logical segment number of the source data page ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Destination pag
343. stic on the ECU Format characteristic name ECU ref in x error in characteristic value ECU ref out error out Input Characteristic name is the name of a Characteristic stored in the A2L database file to which one value may be written ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs x is an input that refers to the array offset if the Characteristic is defined in the A2L database file as 1 or 2 dimensional If the Characteristic is defined as having 0 dimensions the input can be left unwired y is an input that refers to the array offset if the Characteristic is defined in the A2L database file as 2 dimensional If the Characteristic is defined as having 0 or 1 dimensions the input can be left unwired 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 Hoo Ee status is TRUE if an error occurred This VI is not executed when status is TRUE 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 wi
344. struments Corporation 2 5 ECU M amp C Toolkit User Manual Chapter 2 3 Installation and Configuration Note You can use the ECU M amp C Toolkit with LabVIEW 2009 or newer on CompactRIO Systems only To use the ECU M amp C Toolkit on the LabVIEW RT system you must also download the ASAM MCD 2MC database file to the RT target The LabVIEW Real Time Engine that runs on the PXI LabVIEW Real Time controller supports a File Transfer Protocol FTP server You can access the LabVIEW RT target FTP server using any standard FTP utility for transferring files to and from the hard drive or compact flash The following sections demonstrate how to transfer files from and to your LabVIEW Real Time target using various FTP clients DOS Command Prompt amp You can run a native FTP client from the DOS command prompt on a Windows PC To open the FTP client click Start gt Run to open the user command dialog box Type command and click Enter This opens a window with a DOS prompt Then use the following table to enter a sequence of commands that may be used to access the FTP server of your RT target Note w x y z represents the IP address of the RT target in this document Table 2 1 Example of FTP Transfer Command Result ftp Open a connection to the FTP server open w x y Z username Enter your username and password here or press the Enter key twice if these security settings have not been applied password help
345. surement task National Instruments Corporation 5 45 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC DAQ List Initialize vi Purpose Defines a DAQ list on a specific DAQ list number and initializes the Measurement task for the specified Measurement channel list Format DAQ List No measurement list ECU ref in mode sample rate error in DTO_ID DAQ ref out error out Input A Bau ECU M amp C Toolkit User Manual DAQ List No specifies which DAQ list entry number should be used for the defined Measurement channel list for the selected ECU To query the available DAQ List numbers on the ECU use MC Get Property vi and select DAQ List Number in the Poly VI Measurement list is the array of channel names to initialize as a Measurement task Each channel name is provided in an array entry ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs Mode specifies the I O mode for the task For an overview of the I O modes including figures refer to the Basic Programming Model section of Chapter 4 Using the ECU M amp C API Mode 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 a sample rate 0 or as wavefo
346. t control applications such as within LabVIEW RT e The third term indicates the data type used for each sample The type Dbl indicates double precision 64 bit floating point The type Wfm indicates the waveform data type The types ZD and 2D indicate one and two dimensional arrays respectively ECU M amp C Toolkit User Manual 5 58 ni com Chapter5 ECU M amp C API for LabVIEW 1Chan 1Samp Dbl Writes a single sample for the first channel initialized in the channel list If the initialized sample rate is greater than zero this poly VI type waits for the next sample time and then writes a single sample This enables you to execute a control loop at a specific rate If the initialized sample rate is zero this poly VI immediately writes a single sample If no message has been received since you started the task the value of 0 is returned in samples You can use error out to determine whether a new message has been received since the previous call to MC DAQ Write vi or MC DAQ Start Stop vi If no message has been received the warning code 3FF60009 hex is returned in error out If a new message has been received the success code 0 is returned in error out NChan 1Samp 1D Dbl Writes an array one entry for each channel initialized in the channel list Each entry consists of a single sample The order of channel entries in samples is the same as the order in the original channel list If the initialized sample rate is greater than zero this
347. t of Calibration page names 5 mcTypeGroupNames Returns a list of Group names 6 mcTypeGroup_SubGroupNames Returns a list of Subgroup names of the specified Group name 7 mcTypeGroup_MeasurementNames Returns a list of Measurement names within the specified Group 6 70 ni com Output Chapter 6 ECU M amp C API for C 8 mceTypeGroup_CharacteristicNames Returns a list of Characteristic names within the specified Group ECUName If the Type mcTypeMeasurementNames or Type mcTypeCharacteristicNames and RefNum contains a DBRefNum the corresponding ECU name must be referenced in order to access ECU specific properties If RefNum contains an ECURefNum or DAQRefNum the parameter ECUName is ignored and can be set to NULL SizeOfNamesList Number of bytes required for mcGetNames to return all names for the specified ECUName and Type After calling mcGetNamesLength you can allocate an array of size SizeofNamesList then pass that array to mcGetNames using the same input parameters This ensures that mcGetNames will return all names without error Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention
348. t64 TimestampArray double SampleArray u32 NumberOfSamplesReturned Input DAQRef Num DAQRefNum is the task reference that links to the selected measurement task This reference is originally returned from mcDAQInitialize or mcDAQListInitialize NumberOfSamplesToRead Specifies the number of samples to read for the task Output TimestampArray Returns the time at which each corresponding sample in SampleArray was received in a CAN message The timestamps are returned as an array of arrays 2D array one array for each channel initialized in the task The array of each channel must have NumberOfSamplesToRead entries allocated For example if you call mcDAQInitialize with ChannelList of myDAQ1 myDAQ2 then call mcDAQReadTimestamped with NumberOfSamplesToRead of 20 both TimestampArray and SampleArray must be allocated as __int64 mcTypeTimestamp TimestampArray 2 20 double SampleArray 2 20 The order of channel entries in TimestampArray is the same as the order in the original DAQ channel list To determine the number of channels in the DAQ task after initialization get the mcPropDAQ_NumChannel1s property for the DAQ task reference Each timestamp in TimestampArray uses the__ int 64 data type compatible with the Microsoft Win32 FILETIME type This National Instruments Corporation 6 43 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C absolute time is kept in a Coordinated Universal Time UTC for
349. tabase u32 mcPropChar_Unit_Size Returns the number of bytes to be allocated if you call mcGet Property with the parameter mcPropChar_Unit f64 mcPropChar_X Axis Returns X axis values on which the Characteristic is defined Valid if the selected Characteristic is 1 or 2 dimensional f64 mcPropChar_Y_Axis Returns Y axis values on which the Characteristic is defined Valid if the selected Characteristic is 2 dimensional u32 mcPropCmd_EXCHANGE_ID Returns whether or not the EXCHANGE _ID command should be suppressed during connection to the ECU u32 mcPropCROID Returns the CRO CAN Identifier Command Receive Object for CCP or XCP on CAN which is used to send commands and data from the host to the slave device u32 mcPropDAQ_DTO_ID Returns the DTO ID Data Transmission Object which is used by the ECU to respond to send data from the DAQ lists to the CCP master nctType mcPropDAQ_DTO_Task NI CAN task reference to the CAN Task Taskref assigned to the DTO ID of the Measurement task str mcPropDAQ_EventChannel Returns the selected event channel name to Name which the Measurement task is assigned ECU M amp C Toolkit User Manual 6 74 ni com Chapter 6 ECU M amp C API for C Table 6 4 Values for PropertylID Continued Data Type Name Description u32 mcPropDAQ_EventChannel Returns the number of bytes to be allocated if Name_Size you call mcGet Property with the parameter
350. task 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description MC DAQStart Stop vi is optional to start or stop transmission of the DAQ lists for an M amp C Measurement task to use MC DAQ Read vi If you do not specify MC DAQ Start Stop vi Start DAQ list before your first Read VI it is implicitly performed by the first MC DAQ Read vi call After you start the transmission of the DAQ lists you can no longer change the configuration of the task with MC Set Property vi You must call MC DAQ Start Stop vi Stop DAQ list first ECU M amp C Toolkit User Manual 5 56 ni com Chapter5 ECU M amp C API for LabVIEW MC DAQ Write vi Purpose Writes samples to an ECU DAQ list Format DAQ ref in DAQ ref out number of samples 1Chan 1Samp 1D Dbl error out error in Input DAQ ref in is the task reference from th
351. te order 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 Measurement Comment Returns the Comment string of the selected Measurement Measurement Data Type Returns the data type of the Measurement task Measurement Extension Returns the extension part of the address This optional parameter may contain additional address information defined in the A2L database For instance it can be used to distinguish different address spaces of an ECU multi microcontroller devices National Instruments Corporation 5 117 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description Measurement _ Is Virtual Indicates whether the Measurement is virtual Virtual Measurements are not transmitted by the ECU but are calculated in the application They return an error when opened in a DAQ list Measurement Maximum Returns the maximum value of the Measurement Measurement Minimum Returns the minimum value of the Measurement Measurement Read Only Returns TRUE if the selected Measurement is read only and can only be accessed through MC DAQ Read vi or returns FALS
352. terface Returns the interface initialized for the task such as with mcDAQInitialize National Instruments Corporation 6 77 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 4 Values for PropertyID Continued Data Type Name Description u8 mcPropECU_MasterID Returns CCP master ID information This ID information is optional and specific to the ECU implementation For more information about the CCP master ID information refer to the documentation for the ECU str mcPropECU_Name Returns the name of the selected ECU opened by mcECUSelectEx u16 mcPropECU_DAQList Returns an array of DAQ list numbers for all Numbers DAQ lists defined in the A2L file u32 mcPropECU_TimingFactor Returns the used timing factor which you can use to increase CCP or XCP command timeout values For details on the default Command Timeout values refer to the CCP or XCP Protocol Specification ul6 mcPropDAQList_Max Returns the maximum length of the DAQ list Length u32 mcPropDAQList_CANId Returns how to select the CAN ID for the SelectMode specified DAQ list 0 CAN_ID_FIXED The CAN Identifier is a predefined fixed number 1 CAN_ID_VARIABLE The CAN Identifier is a variable number 2 CAN_ID_DTO_ID The CAN Identifier is the same as the DTO identifier u32 mcPropDAQList_CANId Returns the CAN ID for the specified DAQ list if mcPropDAQList_CANIdSelectMode
353. that indicates whether the ECU supports the optional CCP Command UNLOCK National Instruments Corporation 5 105 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU Misc Timing Factor Returns the used timing factor which you can use to increase CCP or XCP command timeout values For details on the default Command Timeout values refer to the CCP or XCP Protocol Specification ECU XCP Compression Method Returns the selected compression method used for MC Program vi 0 data is uncompressed 0x80 0xFF User defined ECU XCP Encryption Method Returns the selected encryption method used for MC Program vi 0x00 data is not encrypted 0x80 0xFF User defined ECU M amp C Toolkit User Manual 5 106 ni com Table 5 5 Poly Values for Value Output Continued Chapter 5 ECU M amp C API for LabVIEW Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description ECU XCP Access Method Returns 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 Ox80 0xFF User defined It is poss
354. the ECU Format mcTypeStatus mcProgram mcTypeTaskRef ECURefNum mcAddress Address u32 BlockSize u8 Data Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Address Configures the target address for the programming operation in the ECU mcAddress is a C struct consisting of Address Specifies the address part of the programming address Extension Extension contains the extension part of the address BlockSize BlockSize determines the size of the data block which is transferred to the ECU and used for programming from the MTAO target Data data contains the byte array that is transmitted to the ECU Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value National Instruments Corporation 6 89 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Description If you are using the CCP protocol mcProgram implements the CCP command PROGRAM The command is used to program the specified data into
355. the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description If an ECU offers a reduced and specific range of DAQ list entry numbers use the mcDAQList Initialize function to setup your Measurement list mcDAQListInitialize does not start the transmission of the DAQ lists from the ECU to the application or vice versa through CCP or XCP This enables you to use mcSet Property to change the properties of a Measurement task After you change properties use mcDAQStartStop to start the communication for the Measurement task To query the available DAQ list entry numbers use mcGet Property with the property mcPropECU_DAQListNumbers National Instruments Corporation 6 39 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcDAQRead Purpose Reads samples from a Measurement task Samples are obtained from received CAN messages Format mcTypeStatus Input DAQRefNum mcDAQRead mcTypeTaskRef DAQRefNum u32 NumberOfSamplesToRead mcTypeTimestamp StartTime mcTypeTimestamp DeltaTime 64 SampleArray u32 NumberOfSamplesReturned DAQRe Nun is the task reference fro
356. the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description Get a comma separated list of ECU Measurement Characteristic or Event Channel names from a specified A2L database file If using mcGetNames to query the list of supported event channels on an ECU the event channels might be stored inside the ECU instead of the A2L file To query these event channel names from the ECU directly connect to the ECU using mcECUConnect before calling mcGetNames National Instruments Corporation 6 69 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcGetNamesLength Purpose Retrieves the amount of memory required to store the names returned by mcGetNames Format mcTypeStatus mcGetNamesLength mcTypeTaskRef RefNum u32 Type cstr ECUName u32 SizeOfNamesList Input RefNum RefNum is any ECU M amp C task reference which consists of a valid link to the opened A2L database DBRef Num a selected ECU ECURefNum or a Measurement task DAQRefNum RefNum must be valid for the related Type Type Specifies the Type of names to return ECU M amp C Toolkit User Manual 0 mcTypeECUNames Returns a list of ECU names 1 mcTypeMeasurementNames Returns a list of Measurement names 2 mceTypeCharacteristicNames Returns a list of Characteristic names 3 mceTypeEventChannelNames Returns a list of Event Channel names 4 mcTypeDefinedPagesNames Returns a lis
357. the name of a measurement channel stored in the A2L database file you want to read ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred ECU ref out is the same as ECU ref in Wire the task reference to subsequent VIs for this task Value returns a single sample for the Measurement channel initialized in measurement name 5 122 ni com Chapter5 ECU M amp C API for LabVIEW Error out describes error conditions If the Error in cluster indicated an 2H error the Error out cluster contains the same information Otherwise Error out describes the error status of this VI status is TRUE if an error occurred code
358. the transmission of the DAQ lists for an ECU M amp C Measurement task If you do not specify MC DAQ Start Stop vi before your first DAQ Read or DAQ Write function MC DAQ Start Stop vi is implicitly performed by the first DAQ Read or DAQ Write call After you start the transmission of the DAQ lists or STIM lists you can no longer change the configuration of the Measurement task with Set Property MC DAQ Start Stop vi is implicitly performed by DAQ Clear to stop transmission of the DAQ lists 4 10 ni com Chapter 4 Using the ECU M amp C API The function to start a DAQ list is MC DAQ Start Stop vi in LabVIEW or mcDAQStartStop inC DAQ Read The application must call the DAQ Read function to obtain floating point samples The application typically calls DAQ Read in a loop until done The Read function is MC DAQ Read vi in LabVIEW all types that do not end in Time amp Dbl or mcDAQRead in other languages The behavior of Read depends on the initialized sample rate and the selected mode sample rate 0 DAQ Read returns a single sample from the most recent message s received from the network One sample is returned for every channel in the DAQ Initialize list Figure 4 4 shows an example of DAQ Read with a sample rate 0 A B and C represent messages for the initialized channels def represents the default value 0 If no message is received after the start of the application the default value 0 is returned along with a warning
359. this task Characteristic is a poly output value which represents the data read from the ECU The type of the poly output is determined by the poly VI selection For information on the different poly VI types provided by MC Characteristic Read vi refer to the Poly VI Types section To select the data type right click the VI go to Select Type and select the type by name 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 status is TRUE if an error occurred 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 source identifies the VI where the error occurred Description Poly VI Types Table 5 3 Poly VI Types for the Value Parameter VI Type Description Parameter DBL Returns a single double value for the selected Characteristic name Curve 1D Returns a 1 dimensional array of double values for the selected Characteristic name Field 2D Returns a 2 dimensional array of double values for the selected Characteristic name ECU M amp C Toolkit
360. tion arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description Use the function mcEventCreate to create an Event object in memory instead of referring to a predefined Event Channel in the A2L database Assign the event channel object by name to a DAQ List in mcMeasurementCreate National Instruments Corporation 6 65 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C mcGeneric Purpose Sends a generic command Format mcTypeStatus mcGeneric mcTypeTaskRef ECURefNum u8 Command u8 Data u32 DataSize u32 Timeout u8 ErrorCode u8 ReturnValue u32 ReturnValueSize Input ECURefNum ECURefNum is the task reference which links to the selected ECU This reference is originally returned from mcECUSelectEx Command Command is the CCP command code to send to the ECU Data Data contains the parameters of the command as an array of bytes For more information about the parameters of the user defined commands implemented in the ECU refer to the documentation for the ECU DataSize DataSize defines the number of bytes the array size passed in the input parameter Data Timeout Timeout specifies the maximum number of milliseconds to wait for a response from the ECU If the Timeout expires before an ECU response occurs the error mcErrorTimeout is returned Output ErrorCode ExrrorCode describes the error returned
361. tries in samples is the same as the order in the original channel list If the initialized sample rate is greater than zero this poly VI type waits for the next sample time then returns a single sample for each channel This enables you to execute a control loop at a specific rate If the initialized sample rate is zero this poly VI immediately returns a single sample for each channel The samples output returns a single sample for each channel from the most recent message received If no message has been received for a channel since you started the task a 0 is returned in samples You can specify channels in channel list that span multiple messages A sample from the most recent message is returned for all channels You can use error out to determine whether a new message has been received since the previous call to MC DAQ Read vi or MC DAQ Start Stop vi If no message has been received for one or more channels the warning code 3FF60009 hex is returned in error out If a new message has been received for all channels the success code 0 is returned in error out Unless an error occurs number of samples returned is one The samples array is indexed by channel and the entry for each channel contains a single sample If you need to determine the number of channels in the task after initialization get the Number of Channels property for the task reference 1Chan NSamp 1D Dbl Returns an array of samples for the first channel initialized in channel l
362. turns the data type of the Characteristic Characteristic Dimension Returns the dimension of a Characteristic 0 0 dimension The Characteristic can be accessed read write through a double value 1 1 dimension The Characteristic can be accessed read write through a one dimensional array of double values 2 2 dimensions The Characteristic can be accessed read write through a two dimensional array of double values Characteristic _ e Extension Returns additional address information For instance it can be used to distinguish different address spaces of an ECU multi microcontroller devices Characteristic Maximum Returns the maximum value of the Characteristic ECU M amp C Toolkit User Manual 5 110 ni com Table 5 5 Poly Values for Value Output Continued Chapter 5 ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description Characteristic Minimum Returns the minimum value of the Characteristic Characteristic Read Only Returns if a Characteristic is set to Read Only In this case it is not allowed to call MC Characteristic Write vi for this Characteristic Characteristic Sizes Returns the array Sizes for X and Y direction of the Characteristic Characteristic Unit Returns the unit string defined for this Characteristic in the A2L database
363. ty determines the directory where the ECU M amp C Toolkit expects to find the Seedkey or Checksum DLL If the property is an empty string default the ECU M amp 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 ECU Checksum DLL Name Returns the file name of the Checksum DLL used for verifying the checksum ECU Command Byte Order Returns the byte order for the defined Measurement or Characteristic 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 ECU M amp C Toolkit User Manual 5 98 ni com Table 5 5 Poly Values for Value Output Continued Chapter 5 ECU M amp C API for LabVIEW Type Hierarchy Sub Hierarchy Sub 1 Sub 2 Param Description ECU Name Returns the Name of the selected ECU opened by MC ECU Open vi or MC ECU Select vi ECU DAQ List Number Returns an array of DAQ list numbers for all DAQ lists defined in the A2L file ECU CCP Baud Rate Returns the Baud Rate in use by the Interface Basic baud rates such as 125000 and 500000 are specified as the numeric rate Advanced baud rates are specified as 8000XXYY hex where YY is the value of Bit Timing Register 0 BTRO and XX is the
364. u32 mcPropOptCmd_SET_S_ Sets whether the ECU supports the optional STATUS CCP Command SET_S_STATUS u32 mc PropOptCmd_SHORT_UP Sets whether the ECU supports the optional CCP Command SHORT_UP u32 mcPropOptCmd_START_ Sets whether the ECU supports the optional STOP_ALL CCP Command START_STOP_ALL u32 mcPropOptCmd_TEST Sets whether the ECU supports the optional CCP Command TEST u32 mc PropOptCmd_UNLOCK Sets whether the ECU supports the optional CCP Command UNLOCK u8 mcPropPGM_ AccessMethod Selects the selected access mode for mcProgram and mcClearMemory 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 ECU M amp C Toolkit User Manual 6 98 ni com Chapter 6 ECU M amp C API for C Table 6 5 ECU Specific Value Types for the PropertyID Input Value Continued Data Type Name Description u8 mcPropPGM_Compression Selects the selected compression method used Method for mcProgram 0 Data is uncompressed default Ox80 0xFF User defined u8 mcPropPGM_Encryption Selects the selected encryption method used for Method mcProgram 0 Data is not encrypted default Ox80 0xFF User defined u8 mcPropPGM_Programming Selects the selected programming method used M
365. ues CAN256 and CAN257 refer to virtual interfaces Refer to the NI CAN Hardware and Software User Manual for detailed information on how to use virtual NI CAN ports Using NI XNET If you are using NI XNET hardware and select the xxx yyy syntax the ECU M amp C Toolkit uses the XNET NI CAN compability library XCL internally if the XNET interface is defined in MAX under NI CAN Devices To force use of the native XNET API you must define a unique interface name that differs from the NI CAN compatible interface name under XNET Devices or use the xxx yyy ni_genie_nixnet syntax The interface name is related to the NI XNET hardware naming under Devices and Interfaces in MAX The extension ni_genie_nixnet directs the ECU M amp C Toolkit to use the native NI XNET API National Instruments Corporation 6 63 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C CompactRIO or R Series If you are using CompactRIO or R Series hardware you must provide a bitfile that handles the CAN communication between the host system and the FPGA To access the CAN module on the FPGA you must specify the bitfile name after the for example CCP CAN1 MyBitfile lvbitx To specify a special RIO target you can specify that target by its name followed by the bitfile name for example XCP CAN RIO1 MyBitfile lvbitx Currently only a single CAN interface is supported RIO1 defines the RIO target name as defined in your LabVIEW Project
366. unction to calculate a key from a given seed to unlock an ECU resource This function calculates a key from a given seed so that you are able to unlock the access to an ECU resource The seed is generated by the ECU and needs to be queried before you can unlock an ECU resource bool SEED_KEY_NAME unsigned char Seed lt Seed provided by the ECU unsigned short SizeSeed lt Size of the seed provided by the ECU unsigned char Key lt Pointer to a buffer to return the key unsigned short MaxSizeKey lt Size of the buffer provided to lt return the key unsigned short SizeKey lt returns the size of the calculated key __attribute__ section export brief Function to calculate a checksum over a given memory range This function calculates a checksum over a given memory range The function is used for example to verify data after a download or programming action bool CALC_CHECKSUM_NAME struct TRange ptr lt Description of the memory area lt to be checked int nRanges lt Number of memory blocks to be checked unsigned char pnCheckSum lt Pointer to a buffer to return lt the checksum int pnSignificant lt Size of the buffer to lt veturn the checksum unsigned short nFlags lt flags for calculating the checksum attribute__ section export ifdef _ cplusplus endif endif __CCPECU_
367. unication MC Database Open vi is an advanced function for database handling In most cases it is sufficient to use MC ECU Open vi instead National Instruments Corporation 5 63 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Double to Text vi Purpose Converts a numerical value to a text string using a COMPU_VTAB type of scaling Format object name 7 ECU ref in ECUME amp C ECU ref out object type P TextValue value error out error in Input El E E H E ECU M amp C Toolkit User Manual object name indicates the object measurement or characteristic for which the COMPU_VTAB scaling is performed If no COMPU_VTAB scaling is available for the object TextValue is just a string representation of the value specified in value ECU ref in is the task reference that links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs object type is a U32 ring that indicates the type of the object named in object name Valid values are 1 Measurement Name 2 Characteristic Name value is the numerical value to be converted For example this could have been returned from MC Characteristic Read vi or MC Measurement Read vi 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
368. upports the optional CCP Command GET_SEED ECU CCP Optional MOVE Returns a Boolean value Commands that indicates whether the ECU supports the optional CCP Command MOVE ECU CCP Optional PROGRAM Returns a Boolean value Commands that indicates whether the ECU supports the optional CCP Command PROGRAM ECU M amp C Toolkit User Manual 5 104 ni com Chapter 5 ECU M amp C API for LabVIEW Table 5 5 Poly Values for Value Output Continued Sub Hierarchy Type Hierarchy Sub 1 Sub 2 Param Description ECU CCP Optional PROGRAM 6 Returns a Boolean value Commands that indicates whether the ECU supports the optional CCP Command PROGRAM_6 ECU CCP Optional SELECT CAL Returns a Boolean value Commands PAGE that indicates whether the ECU supports the optional CCP Command SELECT_CAL_PAGE ECU CCP Optional SETS STATUS Returns a Boolean value Commands that indicates whether the ECU supports the optional CCP Command SET_S_STATUS ECU CCP Optional SHORT UP Returns a Boolean value Commands that indicates whether the ECU supports the optional CCP Command SHORT_UP ECU CCP Optional START STOP Returns a Boolean value Commands ALL that indicates whether the ECU supports the optional CCP Command START_STOP_ALL ECU CCP Optional TEST Returns a Boolean value Commands that indicates whether the ECU supports the optional CCP Command TEST ECU CCP Optional UNLOCK Returns a Boolean value Commands
369. urement task VIs Measurement task For single sample Poly VI types MC DAQ Read vi always returns one sample so this input is ignored 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 Number of samples specifies the number of samples to read for the status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred National Instruments Corporation 5 49 ECU M amp C Toolkit User Manual Chapter 5 Output ECU M amp C API for LabVIEW DAQ ref out is the same as DAQ ref in Wire the task reference to subsequent VIs for this task Number of samples returned indicates the number of samples returned in FOr the samples output Value is a poly output that returns the samples read from the received CAN messages of the DAQ list The type of the poly output is determined by the poly VI selection For information on the different poly VI types provided
370. uses XCP on CAN interface 2 and so on with the form CANx e XCP UDP ni_genie_nixnet uses XCP on UDP e XCP TCP ni_genie_nixnet uses XCP on TCP Using CompactRIO or R Series e CCP CAN1 RIO1 c temp MyFpgaBitfile lvbitx uses CCP on named target RIO1 as compiled into the bitfile at c temp MyFpgaBitfile lvbitx e XCP CAN1 RIO1 c temp MyFpgaBitfile lvbitx uses XCP on named target RIO1 as compiled into the bitfile at c temp MyFpgaBitfile lvbitx 3 Note You can download the ASAM MCD 2MC database configuration file to a LabVIEW RT target by the File Transfer Protocol FTP An FTP file transfer is possible within MAX Refer to the LabVIEW Real Time Graphical File Transfer Utility section of Chapter 2 Installation and Configuration for instructions on performing an FTP transfer through MAX National Instruments Corporation 5 83 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC ECU Select vi Purpose Selects an ECU based upon the names stored in an A2L database Format protocol and interface DB ref in ECU ref out ECU name error out error in interface Input ECU M amp C Toolkit User Manual protocol and interface selects target communication protocol CCP or XCP and the desired interface to use for this task The interface input uses a string xxx yyy where xxx defines one of the two available protocols CCP or XCP and yyy defines the desired interface to use like
371. using DAQ lists The data can be read back with the mcDAQRead as Single point data using sample rate 0 or as waveform using a ECU M amp C Toolkit User Manual 6 38 ni com Output Chapter 6 ECU M amp C API for C sample rate gt 0 Input channel data is received from the DAQ messages mcDAQModePolling In this mode the data from the Measurement task are uploaded from the ECU whenever mcDAQRead is called DTO_ID DTO_ID is the CAN identifier for the Data Transmission Object DTO used to transmit the data from the DAQ lists to the host The default value is 1 which means that the DTO ID used to transmit the DAQ list data is the same that is used for the rest of the CCP communication SampleRate SampleRate specifies the timing to use for 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 mcDAQRead returns a single sample from the most recent messages received and greater than zero means that mcDAQRead returns samples timed at the specified rate For DAQMode of mcDAQModePolling SampleRate is ignored DAQRef Num DAQRefNum is the reference handle for the Measurement task Use this Measurement task reference in subsequent M amp C DAQ functions for this task Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means
372. uster 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 status is TRUE if an error occurred This VI will not execute when status is TRUE 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 source identifies the VI where the error occurred National Instruments Corporation 5 47 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW DTO_ID is the CAN identifier for the Data Transmission Object DTO used by the ECU to transmit the DAQ list data to the host If the DTO_ID terminal is unwired the ECU will use the same identifier for sending the DAQ list data as for the normal CCP communication DAQ ref out is a task reference for the Measurement task created Wire this task reference to subsequent VIs for this Measurement task 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 status is TRUE if an error occurred code is the error code
373. vi implements the XCP command PROGRAM The command is used to program a non volatile memory segment in the ECU slave The end of the programming sequence is indicated by using the MC Program Reset vi command which executes the XCP command PROGRAM_RESET The slave device will move into a disconnected state Usually a hardware reset of the slave device is executed This command may support block transfer similar to the commands DOWNLOAD and DOWNLOAD_NEXT For further information on how to use the MC Program vi and details on block mode transfers refer to the ASAM XCP Part 2 Protocol Layer Specification National Instruments Corporation 5 127 ECU M amp C Toolkit User Manual Chapter 5 ECU M amp C API for LabVIEW MC Program Reset vi Purpose Indicates the end of a programming sequence Format ECU ref in ECU ref out error in error out Input ECU M amp C Toolkit User Manual ECU ref in is the task reference which links to the selected ECU This reference is originally returned from MC ECU Open vi or MC ECU Select vi and then wired through subsequent VIs 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 status is TRUE if an error occurred This VI is not executed when status is TRUE code is the error code number identifying an error A value of 0 means success A negative value me
374. which links to the selected ECU This reference is originally returned from mcECUSelectEx Address Specifies the address part of the target address Extension Contains the extension part of the target address CodeSize CodeSize determines the size of data to be downloaded Output Return Value The return value indicates the status of the function call as a signed 32 bit integer Zero means the function executed successfully A negative value specifies an error which means the function did not perform the expected behavior A positive value specifies a warning which means the function performed as expected but a condition arose that may require attention Use the mcStatusToString function of the ECU M amp C API to obtain a descriptive string for the return value Description mcXCPProgramPrepare may be used to indicate a data download as a pre condition for non volatile memory reprogramming The Memory Transfer address MTA pointer is set to the volatile memory location specified by the parameters Address and Extension The download itself is done by using subsequent standard commands like mcDown1oad The slave device must ensure that the target memory area is available and it is in an operational state which permits the download of code If not an error will be returned ECU M amp C Toolkit User Manual 6 116 ni com Chapter 6 ECU M amp C API for C mcXCPProgramPrepare implements the optional XCP PROGRAM_PREPARE command defined by the
375. x80 0xFF User defined It is possible to use different access modes for clearing and programming u8 mcPropPGM_Compression Returns the selected compression method used Method for mcProgram 0 Data is uncompressed default Ox80 0xFF User defined National Instruments Corporation 6 83 ECU M amp C Toolkit User Manual Chapter 6 ECU M amp C API for C Table 6 4 Values for PropertyID Continued Data Type Name Description ug mcPropPGM_Encryption Returns the selected encryption method used for Method mcProgram 0 Data is not encrypted default 0x80 0xFF User defined ug mcPropPGM_Programming Returns the selected programming method used Method for mcProgram 0 Sequential programming default 0x80 0xFF User defined ECU M amp C Toolkit User Manual 6 84 ni com Chapter 6 ECU M amp C API for C mcMeasurementCreate Purpose Creates a Measurement object in memory Format mcTypeStatus mcMeasurementCreate mcTypeTaskRef ECURefNum char MeasurementName mcAddress Address 132 DataType u8 DataSize char ConversionName Input ECURefNum ECURe Num is the task reference which links to the selected ECU This reference is originally returned from mcECUCreate Address Configures the target address for the programming operation in the ECU mcAddress is a C struct consisting of Address Specifies the address part of the programming address
376. xSizeKey unsigned short SizeKey Seed Pointer to seed data SizeSeed Size of seed data length of Seed Key Pointer where DLL should insert the calculated key data MaxSizeKey Maximum size of Key SizeKey Should be set from DLL corresponding to the number of data inserted to Key at most MaxSizeKey Result The value FALSE 0 indicates that the key could not be calculated from seed data for example MaxSizeKey is too small TRUE 0 indicates success of key calculation ifdef _ cplusplus endif endif _SEEDKEY_H ECU M amp C Toolkit User Manual 4 20 ni com Chapter 4 Using the ECU M amp C API Checksum Algorithm ASAM proposed a WIN32 API function to have a common interface to implement the checksum algorithms for verifying ECU calibration and program data For details refer to the ASAM Seed and Key and Checksum Calculation API Version 1 0 Definition for a Checksum Algorithm Function name BOOL CalcChecksum struct TRange ptr int nRanges BYTE pnChecksum int pnSignificant WORD nFlags Parameter Description 1 Pointer to an array of ranges stored in structures of type TRange 2 Number of ranges stored in the array that parameter 1 points to 3 Pointer to a byte array where the checksum must be stored The DLL writes a maximum of 8 bytes so the caller should reserve space for 8 bytes of data 4 Le
377. y 1 1601 Because mcTypeTimestamp is compatible with Win32 FILETIME you can pass it into the Win32 FileTimeToLocalFileTime function to convert it to the local time zone and then pass the resulting local time to the Win32 FileTimeToSystemTime function to convert to the Win32 SYSTEMTIME type SYSTEMTIME is a struct with fields for year month day and so on For more information on Win32 time types and functions refer to the Microsoft Win32 documentation DeltaTime Returns the time between each sample in SampleArray This parameter is optional If you pass NULL for the DeltaTime parameter the mcDAQRead function proceeds normally If the initialized sample rate is greater than zero the DeltaTime is determined by the sample timing If the initialized sample rate is zero the DeltaTime is zero because the most recent sample is returned regardless of timing DeltaTime uses the mcTypeTimestamp data type The delta time is a relative 64 bit counter of 100 ns intervals not an absolute UTC time Nevertheless you can use functions like the Win32 FileTimeToSystemTime function to convert to the Win32 SYSTEMTIME type In addition you can use the 32 bit LowPart of DeltaTime to obtain a simple 100 ns count because values for SampleRate as slow as 0 4 Hz are still limited to a 32 bit 100 ns count SampleArray Returns a 2D array one array for each channel initialized in the task The array of each channel must
378. y these event channels use MC Get Property vi with the Group Is Root parameter Note For more details on how to query the Group information out of an A2L file refer to the installed advanced example Read A2L Group vi in the Example Finder ECU M amp C Toolkit User Manual 5 94 ni com Chapter5 ECU M amp C API for LabVIEW MC Get Property vi Purpose Gets a property for the object referenced by the reference in terminal The poly VI selection determines the property to get Format name reference in reference out value error out error in Input Name specifies an individual channel within the task defined by reference in The default unwired value of name is empty which means the property applies to the entire task not a specific channel If a property relates to Measurement or Characteristic channels and does not apply to the entire task but an individual channel or message within the task you must wire the name of a Measurement or Characteristic channel from channel list into the name input For other properties you must leave name unwired empty Reference in is the reference to any opened A2L database a selected ECU or an ECU which is already connected with MC Database Open vi MC ECU Select vi MC ECU Open vi or MC ECU Connect vi The type of this reference depends on the property you want to get Error in is a cluster which describes error conditions occurring before the VI executes

Download Pdf Manuals

image

Related Search

Related Contents

CASEMENT/SLIDER AIR CONDITIONER  Bedienungsanleitung - Service  Compustar P2BSHLEDR User's Manual    Kambrook KT97 User's Manual  REF 90015 See MAX COMM™ Software package for installation CD  Trident Arkon 12"  バッテリーフリーマウス 400-MA003 取扱説明書 ご  ユーザーズガイド  Astronomie - Observer les étoiles, 14 - Repérer  

Copyright © All rights reserved.
Failed to retrieve file