Skip to content

Unable to start CAN session in Subordinate Mode #273

@CEngelbrecht

Description

@CEngelbrecht

Using the NI-XNET Bus Monitor, it is possible to run in Subordinate mode. This does not seem to be an option when creating a CAN session using this python library, as far as I can tell.

I would like to replicate the functionality of the NI-XNET Bus Monitor in a python script using this library, but the only way to monitor traffic when multiple XNET sessions are already running is if the Bus Monitor is in Subordinate mode. The can_lstn_only parameter does not achieve this goal. Am I missing something?

import nixnet

database_name = 'CAN'
cluster_name = 'CAN'
input_frame = 'FCC_A_CRC'
interface1 = 'CAN1'

with nixnet.FrameInQueuedSession(
        interface1,
        database_name,
        cluster_name,
        input_frame) as input_session:

    input_session.intf.can_lstn_only = True

    input_session.start()

    frames = input_session.frames.read(count)
    
    for frame in frames:
        print('Received frame:')
        print(frame)

The above code produces this error when the input_session is created:

nixnet.errors.XnetError: NI-XNET: (Hex 0xBFF6300D) You tried to open the same frame twice. This is not permitted. Solution: open each frame only once

The frame has already been opened by the LabVIEW program that is reading/writing over the interface, using the XNET database specified. Again, in the Bus Monitor this is not an issue when subordinate mode is selected. Is this not supported in this library?

  • OS: Windows 10
  • Python version: 3.6
  • NI-XNET version: 18.5

Installed packages and version

nixnet (0.3.1)
pip (9.0.3)
setuptools (39.0.1)
six (1.15.0)
xlrd (1.2.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions