Configuring Cyclic Redundancy Checks (CRCs) and Counters for Outgoing NI-XNET CAN Frames
- Updated2025-01-27
- 2 minute(s) read
Configuring Cyclic Redundancy Checks (CRCs) and Counters for Outgoing NI-XNET CAN Frames
Specify the bytes for outgoing frames of NI-XNET CAN interfaces to include in CRCs and add counters that increment each time the frame transmits across the bus.
- Launch your project in the VeriStand Editor.
- In the Project Files pane, left-click a system definition file (.nivssdf) and select Configure in System Explorer.
- Click in the configuration tree.
- Click a port.
- On the CAN Port Configuration page, click the Automatic Frame Processing tab.
-
Click the Installed automatic frame processing binary
files drop-down to select a file to use for frame
processing.
Note VeriStand supports CRC-8 and CRC-16 length polynomials.
-
Configure the CRC.
-
In the Polynomial field, enter a generator polynomial for the
CRC.
This field requires a decimal number. VeriStand converts this number to binary form to create the polynomial.
-
In the Initial CRC field, enter an initial value to use for the CRC
calculation.
This field requires a decimal number. VeriStand converts this number to binary form.
- In the Final XOR field, enter a value to XOR with the calculated CRC.
- Optional: If you want to reverse the order of the bits in the CRC before writing data into the data stream, select Reflected.
-
In the Polynomial field, enter a generator polynomial for the
CRC.
- In the configuration tree, under the CAN port, right-click an outgoing frame and select Add Automatic Frame Processing Data.
- Expand Automatic Frame Processing to view the configuration pages for the CRC and counter.
-
Click CRC to display the CRC Configuration page, and
configure CRC settings.
- Under CRC Settings, specify the first included byte and last included byte for the CRC.
-
In the Storage offset [byte] field, specify a number of bytes to offset
the byte where CRC data is stored.
Note The CRC is always the last byte in the data. Set this value to n-1, where n is the number of bytes in the data, to avoid dropping frame data from the CRC.
- Optional: If you want to specify a trigger channel to trigger writing data, click Use alternate channel?.
-
Select Counter to display the XNET Counter
Configuration page, and configure the counter.
-
Under Counter Settings, enter the Width [bit] of
the counter.
The maximum width is 8.
- Specify the Initial value to start the counter.
- Optional: If you want to specify offsets for counter data, enter a Storage offset [byte] and a Bit offset [bit].
- Optional: If you want to specify a trigger channel to use to trigger writing data, click Use alternate channel?.
-
Under Counter Settings, enter the Width [bit] of
the counter.
- Save the system definition file.
Related Information
- Importing NI-XNET Frames
Import incoming or outgoing frames from an NI-XNET database.