Using NI Automotive Toolkit in C/C++ Programming

Updated Apr 26, 2023

Reported In

Software

  • ECU Measurement and Calibration Toolkit
  • Automotive Diagnostic Command Set Toolkit

Issue Details

Can I use NI Automotive toolkit, Automotive Diagnostic Command Set Toolkit (ADCS) or ECU Measurement and Calibration Toolkit (ECU MC) in C or C++?

Solution

Both NI ADCS and NI ECU MC Toolkit software supports Microsoft Visual C/C++ 6.

For file path information of examples and libraries, please refer to the manual:
Automotive Diagnostic Command Set (CAN and LIN) Help
ECU Measurement and Calibration Toolkit (CAN) Help

Examples are provided in a single .c file. To use them in C++, simple change the extension to .cpp. Both toolkit support 32-bit and 64-bit application. 

To prevent compilation error, the configuration has to be done in Visual Studio:
1. C/C++ >> General >> Additional Include Directories:
    • $(NIEXTCCOMPILERSUPP)\include;%(AdditionalIncludeDirectories)
2. Linker >> General >> Additional Library Directory:
    • For 32-bit application: $(NIEXTCCOMPILERSUPP)\lib32\msvc;%(AdditionalLibraryDirectories)
    • For 64-bit application: $(NIEXTCCOMPILERSUPP)\lib64\msvc;%(AdditionalLibraryDirectories)
3. Linker >> Input >> Additional Dependencies:
    • For ADCS: NIDiagCS.lib
    • For ECU MC: niemcc.lib

Please note that Demo ECUs are only available in LabVIEW.

Additional Information

C examples for NI-XNET driver are provided with Visual Studio project file, .vcproj. You can try running the shipping examples for NI-XNET if you encounter with any compilation error with the above toolkit.
The typical path to the examples folder is:
C:\Users\Public\Documents\National Instruments\NI-XNET\Examples\MS Visual C