LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Help] Multiple cDaq NI-9181 Modules Detection Issue...

Solved!
Go to solution

I have a problem. I have a PC running LabVIEW 2012. I want to connect a cDAQ NI-9181 module to it, which has a NI-9263 module connected to it via Ethernet.

 

The issue is I have a number of these NI-9181/NI-9263 combo's and any one pair can be connected to the PC at a time. The NI-9263 module must have a VISA alias of "TS_AnOp1".

 

So I wrote a VI that goes through all the network devices that are NI-9263 modules and renames them to unique names "NI9263-xx" when xx is a incrementing number (using System VI's). Next I scan the system and filter out on "Service Type" = "NI Network Resource" and "IsPresent" = Present. I then search for the "NI cDAQ-9181" module and run self-test on it. Self-test has to be run otherwise the software can see the 9181 module but not what is plugged into it!

 

I then repeat the search filtering on "IsPresent" = Present, and "ConnBusType" = cDAQ. I find the NI 9263 module and rename it to "TS_AnOp1" (using system VI').

 

The issue is "Is Present" returns true for all the modules. So if I plug one in on a refresh system the above works fine. If I remove the first module and plug in the second, the filtering on IsPresent returns true for both modules! The Self-Test on the first one errors (timeout), the self-test on the second one errors (not reserved for use on the system).

 

The other method I tried was to get a list of all the DAQmx devices. Then try to reset all the NI-9263 devices. The one that does not error is the live one. This works until you turn off the PC, then MAX loses the NI-9263 module (hence the self-test messing about above). LabVIEW can see multiple NI-9181 modules (one is live the reset are stale). I cannot see how to find the live one as self-test errors on all of them and IsPresent is useless!

 

Is there a LabVIEW call to reserve the live NI-9181 module? I could poll all the NI-9181 modules. The one that errors with "Not Reserved" I could then reserve and re-run self-test.

 

Note: LabVIEW 2012 cannot delete MAX entries (this would be the best solution). 😞

 

Christopher Povey

Principle Test Systems Engineer for BAE Systems.
0 Kudos
Message 1 of 3
(2,561 Views)
Solution
Accepted by topic author ChristopherPovey

Try to reserve and unreserve CDAQ during the initailization of CDAQ in your labview code.


CLD Using LabVIEW since 2013
Message 2 of 3
(2,541 Views)

@kartiknattar wrote:

Try to reserve and unreserve CDAQ during the initailization of CDAQ in your labview code.


That works to a degree. It does mean that all the "boxes" containing the cDAQ and AnOp modules will have to be installed in NI MAX on every PC that could use them. Once done though it switches between them no problems.

 

Thanks.

Christopher Povey

Principle Test Systems Engineer for BAE Systems.
0 Kudos
Message 3 of 3
(2,534 Views)