Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Woes with NIDAQmxBase on a Mac

Some of what you are saying does not sound right, at least in version 2.1 of the driver.

The primary thread of any Mac app is going to call into the HIToolbox. Since it is not thread-safe and 2.1 of the driver calls it, it cannot be used in any other thread other than that primary thread! And you can't use it in that thread either because tasks block the GUI.

Come to think of it, you can't use it in multiple threads of any program because that would be causing the HIToolbox to be called from both of those threads.

I don't know if 3.1 is affected the same way, but I'm assuming it is.
0 Kudos
Message 11 of 17
(1,442 Views)

Hi Maurice-

I received your product suggestion; thanks for filing it.

I would like to emphasize that the NI-DAQmx Base code itself does not call into HIToolbox directly but that LabVIEW (the environment in which NI-DAQmx Base is developed and compiled for release) has some reliance on HIToolbox.  However, the DMA and USB streaming processes for NI-DAQmx Base are external, non LabVIEW-based libraries that run safely "under the hood" in seperate threads from the main NI-DAQmx Base API threads. 

So, you should be able to adjust your use of the API to avoid blocking your application's GUI.  Without knowing more about your application I would offer these suggestions:

 

I'll assume you are performing some kind of multi-point analog or digital input operation, either finite or continuous.  The DAQmx Base read functions are designed to block until either the requested number of points become available or until the user-defined timeout expires. 

One way to avoid prolonged blocking is to read more often by requesting smaller data sets with each call to DAQmx Base read.  In the case of a finite acquisition you may need to replace a single call to DAQmx Base read with multiple calls in a loop.  For continuous mode, you should already be using a looped DAQmx Base read operation so you could simply lower the number of points read with each iteration and then reassemble the complete data set at a later, more convenient time for your application.

DAQmx Base write operations are not designed to block under normal operation, so you shouldn't need any adjustments to AO or DO tasks.

Hopefully these suggestions will be helpful to improve performance for your app.

Tom W
National Instruments
0 Kudos
Message 12 of 17
(1,427 Views)
We were thinking about getting a USB-6281, but interestingly, though the knowledgebase article has been updated, it specifically leaves out 6281 implying that the two are NOT compatible. Is that really true?


0 Kudos
Message 13 of 17
(1,352 Views)

Hi maurice-

Yes, the KnowledgeBase is indeed true.  NI-DAQmx Base does not support USB-622x/625x/628x devices at this time (spring 2008), so support for those devices is unfortunately limited to Windows currently.  We do not have plans to add them in the next release of NI-DAQmx Base, but could consider it for future releases.  Please feel free to file a product suggestion here to request support for that device if you need it.

Thanks-

Tom W
National Instruments
0 Kudos
Message 14 of 17
(1,347 Views)
OK, I am now looking at the 621x series and the list is very specific. It says it supports the 6210, 6211, and 6215, which implies that it doesn't work with the 6212 and 6216, both of which are the ones that happen to support cable connections and also are 400 kHz. Is that really the case? How could the incompatibility be so specific?
0 Kudos
Message 15 of 17
(1,340 Views)
I am looking closely at the specs am wondering whether it's not really that it's incompatible, but incomplete. The 6212 and 6216 support 32 (or is 24?) digital lines whereas the others only 4. Could it simply be that Mac mxbase doesn't address the remaining digital lines, but otherwise would work fine?
0 Kudos
Message 16 of 17
(1,338 Views)
Hi maurice-
 
Unfortunately, no.  They 6212 and 6216 devices are similar to the other 621x devices but there are some fundamental differences.  The reason they're not supported by DAQmx Base is simply that we haven't implemented support for them yet in DAQmx Base.  That said, they will definitely not work in any capacity with the current release.  For now, only the 6210/6211/6215/6218 are supported.
 
Let me know if you need more clarification.  Thanks-
Tom W
National Instruments
0 Kudos
Message 17 of 17
(1,330 Views)