Using NI-VCOM Toolkit to Define the Custom Checksum for CAN Application

Updated Nov 7, 2022



  • Vehicle Communication Toolkit



Compared to NI-XNET custom checksum, Vehicle Communication Toolkit has its advantages that it can add the checksum algorithm on a single frame, instead of a CAN channel. Additionally, NI-VCOM defines many common checksum algorithms, and the users just need to choose one in the RBSConfig application. If users' algorithm is too special and can't find in the list of checksum algorithm, there is a way to define the specific checksum algorithm.

1. Setup the compiling toolchain Using the NI Linux Real-Time Cross Compile Toolchain with Visual Studio Code
2. Prepare the C code file 'NIXNETCustomInterfaceCAN.cpp' that contains your checksum (CRC) algorithm. The following screenshot is an example of a checksum algorithm. The checksum signal is byte7 and the checksum algorithm is that checksum = U8 (byte0 +byte1 +byte2 +byte3 +byte4 +byte5 +byte6)
In the if condition, "nxFrame->Identifier == 0x128" means that only the frame 0x128 will add this checksum algorithm. "nxFrame->Payload [7] != 2" means that if the value of checksum signal is equal to 2, the defined algorithm won't work. it is a way to insert the fault of checksum. 
Without the condition of "nxFrame->Identifier == 0x128", the specific checksum algorithm will add to all the transmission frames. 
If you don't want to insert the checksum fault for the frames, you can remove the condition of "nxFrame->Payload [7] != 2".
3. Compile the NIXNETCustomInterfaceCAN.cpp to file without any errors.
The so file can be found in the folder "......\build\bin\"
4.  Using WebDAV to Transfer Files to Real-Time Target - NI to copy the .so file to your target, e.g. ‘/c/ni-rt/NIVeriStand/Custom Devices/PROVEtechRBS/’ and configurate the RBS configurator as following screenshot.