Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I determine the maximum multi-channel sampling rate and number of channels under DAQmx Base?

I've developed an A/D acquisition application in C which works cross-platform, using DAQmx under Windows and DAQmx Base under Linux. On the Windows side, I'm able to automatically determine the maximum multi-channel sampling rate for a given device using DAQmxGetDevAIMaxMultiChanRate(). I can also get the list of available AI channels using DAQmxGetDevAIPhysicalChans(), and then count the channels in the list to calculate the maximum number. There does not seem to be any equivalents to these two functions in DAQmx Base 3.4.0, so for now I've had to hard-code these values for the device I'm currently using. That's not a good long-term solution as I want to be able to support different A/D devices. How do I automatically determine these device properties in a C program under DAQmx Base?

 

Thanks,

Gilles

0 Kudos
Message 1 of 4
(3,397 Views)

According to the DAQmx Base 3.x C Function Reference Help, you're right in that those particular property functions aren't listed as they are in DAQmx.  I'll continue looking into finding a workaround on this issue for you.

Regards,
Austin S.

National Instruments
Academic Field Engineer
0 Kudos
Message 2 of 4
(3,359 Views)

   The full list of functions that are included in DAQmx Base are located in the header file for your installed driver.  You may have already seen this, but you can find this under C:\Program Files\National Instruments\NI-DAQmx Base\Include.  There are several additional functions included in this file that will work in DAQmx Base, but just not included in the C Function Help Reference that I was referring to in my previous post.  I looked through these functions and there were still only two device property functions listed there, while DAQmx had many more including the two that you mentioned in your original post.  You might be able to find something similar that could work for you in there, but I didn't see anything of the sort, specifically the two you were looking for.

 

One option that you do have, however, is downloading DAQmx 8.0.2 for Linux, assuming that it is compatible with your hardware.  It is the latest version of DAQmx that is available for Linux and should have the full functionality that you're looking for.

Regards,
Austin S.

National Instruments
Academic Field Engineer
0 Kudos
Message 3 of 4
(3,341 Views)

Thanks, Austin.  I wasn't aware of DAQmx 8.0.2 for Linux.  When I started on this project on March 9, the only DAQmx for Linux I could find was older, and supported RHEL 4, but not RHEL 5 or Scientific Linux 5 (which I'm currently using).  I see that version 8.0.2 does support RHEL 5, so it may open up some new options when I start working with NI PCI DAQ boards.  Unfortunately, right now I'm trying to support a USB device (USB-6210) which the Linux version of DAQmx doesn't support.

 

Using DAQmxBase 3.4.0 for Linux, I see only one declared device property function in /usr/local/natinst/nidaqmxbase/include/NIDAQmxBase.h, namely DAQmxBaseGetDevSerialNum(), which doesn't do me much good.  The declaration for DAQmxBaseGetDevProductType() is commented out, as is that for DAQmxBaseGetDeviceAttribute(). My Linux code currently calls the "lsdaq" utility via popen() to get a list of installed devices and their product types, which is a tad slow but works fine apart from that.  For the device properties, I've resorted to manually coding a list of properties that matter to my application (max multi-channel rate, no. of channels, bits per sample) for each supported device type, and embedding that list in an environment variable passed to my program. It then searches the list for the product type reported by lsdaq, and uses the attributes in that list.

 

E.g.: NIDAQATTRS="PCI-6010/200000/16/16 ... USB-6210/250000/16/16 USB-6211/250000/16/16 USB-6215/250000/16/16 USB-6218/250000/32/16"

 

Not ideal, but it beats hardcoding everything.

0 Kudos
Message 4 of 4
(3,334 Views)