CAN (VCOM)

Add VCOM to VeriStand

After creating a VeriStand project, open System Explorer and add “VCOM” under “Custom Device”.

Adding VCOM as VeriStand custom device

Open the VCOM Configurator

Select the newly added custom device and open the VCOM Configuration UI.

Opening VCOM Configuration UI

Configure general settings

The top section contains general settings. The following adjustments are optional:

  1. Debug Level

    • Debug Level: 2 (default) -> least amount of information in the VCOM log files

    • Debug Level: 1 -> more debug information

    • Debug Level: 0 -> most detailed log files

  2. SysClock - “Timer Period(us)”

    • 10000 µs (default)

    • Determines the loop iteration time of the VCOM engine

    • This base time is the fastest possible cyclic output for the VCOM session

    • Under Windows: 10000 µs is common and useful. 5000 µs is possible. Not recommended to go lower than that

    • Under Linux: If needed 1000 µs possible

VCOM general settings and timing

Add the CAN function module

For the Rest-Bus Simulation configuration, add “CAN” under “Function Modules”.

Adding CAN function module

Select NI-XNET

Add “NI-XNET”.

Selecting NI-XNET interface

Add a Hardware Port

Next, add a “Hardware Port” for each CAN port participating in the Rest-Bus Simulation. Existing port configurations can be duplicated.

Adding CAN hardware port

Configure the CAN Hardware Port

Select the newly created “Hardware Port” to open its settings. Set the following six parameters for a basic CAN Rest-Bus Simulation:

  1. HW Port: The alias for the targeted CAN port in NI-MAX

  2. BitRate(bps): nominal/arbitration bit rate, typically 500000 for CAN and CAN FD

  3. Data BitRate(bps): data-phase bit rate, typically 2000000 for CAN FD

  4. Network descriptor (ARXML in this example; DBC and LDF are also supported)

    1. Browse for the network descriptor file

    2. Confirm the selected descriptor file

  5. After loading the network descriptor file, the dropdown next to “Cluster Name” is populated with the available clusters. Select the cluster containing the PDUs or services to be used in the RBS.

  6. Select the channel name from the available listings in the dropdown control.

Loading CAN network descriptor

CAN hardware port parameter settings

Configure TX and RX Peers

Add a “TX Peer” if the Hardware Port is intended to transmit messages. Add an “RX Peer” if the Hardware Port is intended to receive messages.

Configuring CAN TX and RX peers

Configure a loopback test

For a simple loopback configuration, add the “TX Peer” (sending endpoint) to the first CAN port and the “RX_Peer” to the second CAN port.

CAN loopback TX and RX peer configuration

Save the VCOM configuration

The basic VCOM configuration is complete. Click “Save” in the upper-right corner, confirm that the configuration was saved, and close the configurator.

Saving VCOM configuration

Confirm the signal selection

After closing the configurator, the VCOM custom device checks for any changes to the signal list. The user has now the chance to select specific portions of the signal list to optimize performance. Unused signals will just create overhead to the overall execution. Press “Done” to add all signals from the config.

Selecting VCOM signals

Save the VeriStand system definition

Click the “Save” icon and close System Explorer.

The tree view on the left contains the available signals and “VCOM – Status”. Next, create a new screen.

Creating VeriStand screen

Monitor VCOM status

Drag and drop the “VCOM Status” from the tree view on the left onto your new screen panel. The “VCOM – Status” information is particularly useful for the very first runs of your VCOM configuration (besides the VCOM log files) to get immediate feedback about the execution state of the VCOM engine.

VCOM status panel

The three most relevant items from “Status” are:

  1. State: Indicates the current state of the VCOM engine:
    • “Idle”: Initial value
    • “Starting”
    • “Running”
    • “Stopping”
    • “Error”
  2. Overrun Count: Counts VCOM loop iterations that take longer than the configured loop period. A few overruns may occur during initialization, but the count should not increase continuously. If it does, reduce the signal count to improve performance. If the VCOM loop cannot maintain its configured timing, RBS output timing will be inaccurate.
  3. RE_StepAll: The sum of the time-consuming function calls within one VCOM engine iteration, in µs. This value should be lower than “Execution Time”, which measures the actual loop iteration time. “Execution Time” targets the configured SysClock “Timer Period(us)” under “General Settings”.

Review the signal hierarchy

The tree view on the left shows the hierarchy of the Rest-Bus Simulation configuration. The shipped example contains the following representative structure.

CAN signal hierarchy

Enable transmissions

VCOM adds the so called “TX_enable” signals (besides others) to the actual signals described in the database. These “TX_enable” signals will activate the specific portion of the Restbus configuration. To activate a specific PDU you need to set the according “TX_enable” signal to “1” but also all other “TX_enable” signals in the whole path from “HW Port” down to the PDU. (The RX_Peer under CAN does not require “TX_enable” signals.) A typical hierarchy is:

  1. HW Port (yellow)

  2. ECU (green)

  3. Container PDU (red)

  4. PDU (purple)

Deploy the VeriStand project

Drag all relevant “TX_enable” signals and PDUs onto the screen panel. Click the “Idle” icon in the upper-left corner and deploy the project.

Deploying VeriStand project

Start the communication

After deployment finishes, set all “TX_enable” signals (blue) to “1”.

CAN loopback signals and status

Once all “TX_enable” signals are set to “1”, the TX_Peer starts transmitting cyclic PDU messages at the configured cycle time (here: 10 ms). The Kickout signal can trigger PDU transmission independently of the cyclic timing. Some PDUs may only be transmitted when triggered by the “TX_kickout” signal.