Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a card ID from NIDAQ

NI provides some decent examples of how to process digital IO but I'm looking for the NIDAQ equivalent to the instrument *IDN? command.  What about card features, such as number of ports, kind of ports, etcetera?

   ...Dan
0 Kudos
Message 1 of 3
(3,579 Views)
Hello Dan,

There are now ways to query more information about the hardware in your system with DAQmx.  I have attached a VI and a screenshot of how to do this in LabVIEW.  Similar calls can be made in other ADEs.  Basically you have device properties that allow you to read information about the device.  In the example I posted it returns the device type (i.e. PCI-6251) and the digital input ports on that device.

I hope this helps,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
Download All
Message 2 of 3
(3,568 Views)
Thanks.  I had actually been looking for a C language solution since I have LV 7.0 and NI doesn't support it.  I finally found it, I'm using the following with good success:

        if (DAQmxGetDevDOLines("Dev1", DAQlist, 1024) < 0) {PROCESS_ERROR3};
        sscanf(DAQlist+strlen(DAQlist)-11, "port%d/line%d", &cards, &channels); cards++; channels++;
        if (DAQmxGetDevProductType("Dev1", DAQlist, 1024) < 0) {PROCESS_ERROR3};
        LV_str_cp(switch_unit->ID, DAQlist);

This finds the number of ports (cards) and lines (channels) and product type.

I often mix LabView and C programming -- I don't have to worry about version support when the drivers are in C.

   ...Dan
0 Kudos
Message 3 of 3
(3,562 Views)