1. Setup the compiling toolchain
Using the NI Linux Real-Time Cross Compile Toolchain with Visual Studio Code2. 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
libNIXNETCustomInterfaceCAN.so 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 c
opy the .so file to your target, e.g. ‘/c/ni-rt/NIVeriStand/Custom Devices/PROVEtechRBS/libNIXNETCustomInterfaceCAN.so’ and configurate the RBS configurator as following screenshot.