Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQmx Base, invoke nodes ???

Hi-
I was referred to post my question here in the DDK forum. I have LV7 and NI-DAQmx Base 2.0.0 on a MAC platform. There is no NI-DAQmx 8.0 (full version) for MAC so I am stuck with the Base. I am trying to setup a continuous AI-DMA task but having problems making sure the buffer doesnt overrun, underflow, etc. I was told this is a problem with Base, and it is obvious, there is no way (using the Base VIs) to query the state of the buffer so you can dynamically change the number of samples requested during each "read" so that the buffer doesnt empty or overfill. I am writting my own VI that is based on the lower-level VIs in Base. I've got it all working but I would like to get more information on what I am doing. I found some 'invoke' node looking block and have used it to start/stop the DMA transfer and it is working. However there are many options and I'd like to know where I can go and read about them. Note, I cant find this invoke node in any of my toolboxes, I only found it in the low-level VIs and have to copy/paste it to use it. The node needs a "hardware exec ref" and then provides several options. When I right click on it I get these options:

Set Write Caching
Flush Write Cache
DMA Config
DMA Start
DMA Read
DMA Write
DMA Stop
DMA Reset
DMA Swap Mode


I can play around with these (mainly start/read/stop/reset) but I would like actual documentation. There is no 'right click -> Help' and I have already experience some strange, non-obvious behavior so I really just need to read the documentation. Soo... where can I find information about this special "DMA" invoke node? I've attached some test code, just so it is easier to identify what I am looking at. The test VI doesnt have any of the task creation, timing, etc.. but you should need those to identify this node.

thanks-
brad
0 Kudos
Message 1 of 4
(8,154 Views)
Unfortunately, there is no documentation (internal to NI or publically available) on the DMA invoke nodes.  The best "documentation" is reading the NI-DAQmx Base code.  The nodes are intended to be used as part of NI-DAQmx Base and not used individually.
 
With that said, you should be able to create your own read vi that monitors the samples to read.  Are you having issues?  Is there a specific question you have?  From looking at your code, you are using the right methods.  If you are doing a continuous acquisition, you merely need to call DMA Read in a loop. DMA Start and DMA Stop are called in DAQmx Base Start and Stop vis respectively.
 
Also, the best place to request a feature (e.g. samples left in buffer) for NI-DAQmx Base is the Product Suggestion form on http://digital.ni.com/applications/psc.nsf/default?OpenForm&temp1=&node=
0 Kudos
Message 2 of 4
(8,142 Views)
hi malcolm thanks for the reply-

I've got it 'mostly' working now. I am not sure how to 'flush' the cache.. I am collecting data for around 30-60seconds and then storing the data in RAM, then I stop the DMA transfer, process the data, save to disk, manipulate external devices through labview and then I want to restart the DMA transfer to get the next set of data. However I want to make sure I dont have any residual data in the DMA buffer from the previous cycle of start/stop. Can I use the "Flush Write Cache" node? or Can I use the "DMA Read" RLP node AFTER the DMA Stop node to empty out the buffer? Or does each instance of DMA START / DMA READ empty the cache? I will play around with my program to try and get these answers, but it sure would be nice to just read in a document how everything is behaving.

I am also having a few issues trying to get the DMA transfer started... seems I need to run the NI-DAQmx configuration utility everytime I start labview in order for it to work properly. Once it works, I can start/stop to my heart's content but once I restart Labview then I have problems again.

Brad
0 Kudos
Message 3 of 4
(8,129 Views)

I'd recommend starting and stoping the dat using DAQmx Start and Stop.  Without them, you may get a FIFO overflow on the device and end up with a device in a bad state.If you look in DAQmx Base Stop, we stop the device and then call DMA Stop and DMA clear.  It is the Clear that empties the buffer.  You could also read all remaining data out of the buffer and throw it away, but you'll add complexity. 

On the initialization issue, can you run a standard example when you first start LabVIEW?  Have you removed any other VIs from the example (Create Task, Create channel, etc)?

Hope this helps.

0 Kudos
Message 4 of 4
(8,121 Views)