Log Bus Traffic with NI-XNET Bus Monitor While Running NI-XNET Application

Updated Mar 11, 2024

Environment

Driver

  • NI-XNET

Can I use the NI-XNET Bus Monitor to monitor or log CAN, LIN or FlexRay bus traffic while my NI-XNET based application is running at the same time in parallel?

This is possible when the interface NI-XNET Bus Monitor is set to Subordinate mode. A subordinate session uses the cluster and interface configuration from other sessions, in this case the user application; for more details see NI-XNET Hardware and Software Manual page 4-62. Moreover, this does not require any code to be added to the application.

Perform the following steps to configure and run Subordinate mode logging:
  1. Start the XNET Bus Monitor.
  2. In XNET Bus Monitor choose Settings menu >> Interface and Database Settings
  3. Select the NI-XNET you want to use under Interface Name.
  4. Set Run Mode to Subordinate.
  5. If you want to use a database to decode signals from frames check Assign Database Alias (opional), select your database under Alias Name and select your cluster under Cluster Name.
 
 
  1. Choose Settings menu >> Logging, check Enable logging to disk, and set your logging format and destination file name.

Note: When running the application on an RT target, you will not see the "browse" option (the yellow folder icon). The log files will be stored on the RT target at the path: /home/lvuser. See Tools Available for File Transfer/Access on NI Linux Real-Time Targets .
  1. Click the Start button in NI-XNET Bus Monitor. Note that at this point logging will not yet start as the NI-XNET Bus Monitor is waiting for the application to start the session.
  2. Run your application. When the application starts communicating over NI-XNET the logging will start.
  3. Click the Stop button in NI-XNET Bus Monitor to stop logging. Note that even if you stop your application the NI-XNET Bus Monitor will keep logging and you have to stop it manually.