取消
顯示結果 
搜尋替代 
您的意思是: 

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 積分
1 條訊息(共 3 條)
3,664 檢視
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
下載全部
2 條訊息(共 3 條)
3,653 檢視
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 積分
3 條訊息(共 3 條)
3,647 檢視