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.

Before you begin, import an outgoing CAN frame.
  1. Launch your project in the VeriStand Editor.
  2. In the Project Files pane, left-click a system definition file (.nivssdf) and select Configure in System Explorer.
  3. Click Targets » Controller » Hardware » Chassis » NI-XNET » CAN in the configuration tree.
  4. Click a port.
  5. On the CAN Port Configuration page, click the Automatic Frame Processing tab.
  6. 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.
  7. Configure the CRC.
    1. 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.
    2. 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.
    3. In the Final XOR field, enter a value to XOR with the calculated CRC.
    4. Optional: If you want to reverse the order of the bits in the CRC before writing data into the data stream, select Reflected.
  8. In the configuration tree, under the CAN port, right-click an outgoing frame and select Add Automatic Frame Processing Data.
  9. Expand Automatic Frame Processing to view the configuration pages for the CRC and counter.
  10. Click CRC to display the CRC Configuration page, and configure CRC settings.
    1. Under CRC Settings, specify the first included byte and last included byte for the CRC.
    2. 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.
    3. Optional: If you want to specify a trigger channel to trigger writing data, click Use alternate channel?.
  11. Select Counter to display the XNET Counter Configuration page, and configure the counter.
    1. Under Counter Settings, enter the Width [bit] of the counter.
      The maximum width is 8.
    2. Specify the Initial value to start the counter.
    3. Optional: If you want to specify offsets for counter data, enter a Storage offset [byte] and a Bit offset [bit].
    4. Optional: If you want to specify a trigger channel to use to trigger writing data, click Use alternate channel?.
  12. Save the system definition file.