Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

nxSystemOpen returns no interfaces or devices until MAX is started and chassis reset

Solved!
Go to solution

I'm trying to write an XNET application. My problem is that upon hardware power-up I can't detect or connect to any devices or interfaces until I launch MAX and reset the cDAQ chassis (NI 9191) which contains the CAN module (NI 9862). Once I do this, the application works. I can unload MAX and the software will continue to work until I cycle power on the chassis. The example programs behave the same way. What can I do programmatically so my users don't have to launch MAX first?

0 Kudos
Message 1 of 6
(4,678 Views)

Hello Brad,

 

 

It could be that the antivirus software, or network settings are initially blocking the communication with the chassis, until NI MAX is opened. Have you verified this behavior in other computers, also see how if there are changes in the Windows Device Manager before and after you open NI MAX, testing this could help narrow down the sourve of the issue.

 

Cheers,

0 Kudos
Message 2 of 6
(4,653 Views)
Solution
Accepted by topic author Mr._Brad

You can use the NI-System Configuraiton API to discover cDAQ/XNET devices and then configure them for use programatically. Most of the things you can do in MAX can be done programmatically via the System Configuration API. It even includes some examples in Hardware Input and Output -> System Configuration although they are not XNET specific.

Jeff L
National Instruments
Message 3 of 6
(4,651 Views)

Both devices (the cDAQ chassis and the XNET module) show up in Windows Device Manager (on different entries) even with the chassis powered off.  When I perform a chassis reset (from within MAX), Device Manager redraws itself, so some event is taking place.  But I can't detect any differences in the Device Manager entries afterwards.

 

After power-up, the MAX entry for the XNET module is displayed as 'NI 9862 "Unknown"', with a yellow exclamation icon.  The cDAQ chassis entry looks OK.

 

Selecting the 9862 displays the following message:

 

"The firmware update completed, but the device encountered a problem. Make sure the selected firmware is valid and retry the firmware update. If the problem persists, contact National Instruments for support.
Firmware update is required for this device"

 

Performing a reset of the chassis fixes everything.  The 9862 is then displayed as 'NI 9862 "CAN1"'.

 

cDAQ-9191 firmware: 1.7.0f0
NI 9862 firmware: 14112110

 

Jeff: I stumbled upon the System Configuration API, and have just started looking into it.  One more thing to learn!

 

0 Kudos
Message 4 of 6
(4,640 Views)

Any success fixing the auto discover of the XNET cards without using the API?

Facing the same problem with the XNET card not detected on power up of the cDAQ.

0 Kudos
Message 5 of 6
(2,853 Views)

I had to use the SystemConfiguration API to get it to work.  What I did (C#):

 

// Create a new instance of a NI SystemConfiguration object.
var session = new SystemConfiguration("");

 

// Create a new instance of a NI Filter.
Filter filter = new Filter(session, FilterMode.MatchValuesAll);

 

// Set the desired filter properties.
filter.IsNIProduct = true;
filter.IsDevice = true;
filter.IsChassis = true;    // chassis are devices, too

 

// Search for the hardware.
ResourceCollection rcChassis = session.FindHardware(filter);

 

// Reset each chassis.
foreach (ProductResource chassis in rcChassis)
        chassis.Reset();

 

I hope this helps.

0 Kudos
Message 6 of 6
(2,846 Views)