Configuring Cyclic Timing for CAN Frames in NI-XNET Python API

Updated Oct 30, 2025

Reported In

Driver

  • NI-XNET

Programming Language

  • Python

Issue Details

I need to send a CAN frame at a fixed interval using NI-XNET API for Python. I can create frames and sessions, but I’m not sure how to configure cyclic timing. The documentation mentions set_can_tx_time, but doesn't provide an example on how to apply this. I want to know how to set the frame as cyclic and to define the transmission interval (e.g., 100 ms).

Solution

To configure cyclic timing for a CAN frame in nixnet, you set two properties on the frame object:

  • can_timing_type — defines the timing mode (cyclic or event-based).
  • can_tx_time — specifies the transmission interval in seconds.

 

First, access the frame object from your database (static or dynamic).

 

frame = db.clusters['CAN_Cluster'].frames['Frame_1']

 

Then, set the cyclic timing properties as shown below. For can_timing_type use the constant values in

 

frame.can_timing_type = nixnet.constants.FrmCanTiming.CYCLIC_DATA

frame.can_tx_time = 0.100 # 100 ms interval

Once these properties are set, any session using this frame will transmit the frame automatically at the specified interval.

Additional Information

For other CAN Frame Timing options and constants refer to nixnet.constants.FrmCanTiming in the nixnet API documentation.