03-04-2008 03:06 PM
03-05-2008 02:02 AM
You can use these functions to get the list of available devices in the system:
size = DAQmxGetSystemInfoAttribute (DAQmx_Sys_DevNames, NULL, 0); // Get the buffer size
// Allocate the buffer
DAQmxGetSystemInfoAttribute (DAQmx_Sys_DevNames, buffer, size); // Get the list of devices
The first instruction returns the size of the buffer to allocate and pass to the following instruction to get the list of devices in the system. After this is done, with DAQmxGetDeviceAttribute you can retrieve all desired attributes of a device: here for example how to retrieve device type:
DAQmxGetDeviceAttribute ("Dev1", DAQmx_Dev_ProductType, msg, 1024);
03-07-2008 03:30 AM - edited 03-07-2008 03:31 AM
03-07-2008 04:01 AM
I never used a PXI system so this is only a guess... Could it be that after removing a device from the chassis it is still listed in max as a "simulated" device? If so, you can query the appropriate property and verify it:
DAQmxGetDeviceAttribute ("Dev1", DAQmx_Dev_IsSimulated, &simulated);
03-07-2008 07:36 AM
Hi all,
I know from experience that MAX will store the name of a device. If the device is remove and put back in the pc, MAX will restore its previous name to it. Well, at least that is what I've notice with the NI USB 8451. I can only guess that MAX stores device names by the ID / serial number. Those numbers will be unique to each device and allow for such flexibility.
I did not see either of those functions DAQmxGetSystemInfoAttribute or DAQmxGetDeviceAttribute in the NI-DAQmx C Reference Help.
Or I am not looking good enough, but I do see them present in the .h file so that is good enough for me. I probably should start using the Libraries box in CVI.
.
03-12-2008 03:32 PM
I just tried this out, and it works!!!
Would have been sooner, but sleep kept getting in the way.
Thanks everyone!!!