06-19-2010 07:14 AM - edited 06-19-2010 07:17 AM
Hello,
We have an application which must enumerate all of the devices connected to the system, and there may be anywhere from zero to three M or E Series DAQ boards installed in the system.
We use the DAQmxGetSystemInfoAttribute/DAQmx_Sys_DevNames approach to enumerate the devices.
The first step is to determine the size of the character buffer needed to hold the device names as follows:
char * dummy = 0;
int buffer_size = daqmxdll->DAQmxGetSystemInfoAttribute(DAQmx_Sys_DevNames, dummy, 0);
The second step is to allocate memory for the character buffer and then call the same DAQmxGetSystemInfoAttribute function again as follows:
char name_buffer = calloc(buffer_size,sizeof(char));
int result = daqmxdll->DAQmxGetSystemInfoAttribute (DAQmx_Sys_DevNames, name_buffer, buffer_size);
This approach outlined above is working just fine when there are actual devices installed in the system
We are having a problem with the first call to "DAQmxGetSystemInfoAttribute" when there are no devices present in the system (i.e., such as a laptop which has NIDAQmx installed, but which does not have any interface boards installed).
The first call to DAQmxGetSystemInfoAttribute (i.e., where we are just trying to learn the correct buffer size) hangs and never returns.
We are observing this behavior on a laptop with NIDAQmx 8.9 (January 2009) installed on it.
There is one other post on this forum (four months ago) where another user reported a similar problem (using a fresh install of NIDAQmx 8.9.5 - see link below), so I don't think we are the only ones who have seen this problem:
I'm wondering if NIDAQmx is attempting to enumerate something "out there" across some kind of internet or USB link or something.
Any help on this would be much appreciated.
Thanks.
06-21-2010 03:51 PM
Hi Michael-
When the function hangs, is it only after you have removed devices that were previously installed? I wonder if MAX still has an entry for them and you are trying to pull information from an entry in MAX that doesn't actually physically exist in the system. When you remove a device, MAX still lists it, but it should show up with a white icon overlaid with a red X. Try deleting this entry/entries and running the program again.
I haven't seen where this issue has been reported or fixed, but you might also try installing the newest version of DAQmx, version 9.1.1, found here. Check to make sure that it will play nice with your system setup and hardware first.
I hope this helps. Best of luck with your application!