10-06-2005 08:35 AM
joyce,
Looks like we're getting closer, eh? I have a few comments that I hope will help.
...using Express Write LMF , I get 4 columns of data: x1| counts | x2 | analog voltagex1 and x2 are almost exactly the same (sometimes differ by 0.001, but would be synchronized again later on). So is this "really" synchronized reading ?
I have assigned the same Sample Clock to both AI and CI but I choose "hardware timed single point" for AI. I have tried "continuous" mode for AI (setting AI DataXferMech to "Interrupts" because I don't have enough DMA channel) but the "x" values (timing) are not the same. At the end, I think the current configuration seems to work best for my purpose.
10-07-2005 11:47 AM
10-07-2005 02:48 PM
Sorry for combining ideas unnecessarily. My comments about the event structure were just a statement of habit and personal preference -- it has no real bearing on data synchronization.
If you're not yet familiar with the event structure, don't worry about it for this app. However, I would still add a call to "Wait (msec)" inside the main While loop so you don't burn CPU unnecessarily. Somewhere around a 50-200 msec wait is probably about right.
Query for # of available samples and if large enough, go ahead and read that same # from both buffered tasks. This is where synchronization is kept.
-Kevin P.
11-17-2005 07:05 PM
How did you change the DMA channel property to eliminate problem?
11-18-2005 10:26 AM
03-28-2006 09:26 AM
A very general comment for future readers: typically the AI subsystem on a board will have a bigger on-board FIFO for data scheduled for transfer to system RAM than the counter subsystem. While joyce had success giving DMA to the AI task and interrupts to the counter task, I think one might often avoid DAQmx transfer errors better by giving DMA to the counter subsystem -- especially when acquiring only a couple AI channels or so.
It's probably one of those system-dependent things, so check it out for yourself.
-Kevin P.
03-29-2006 05:39 PM
10-10-2006 09:38 AM
10-10-2006 09:58 AM
Hi
Just a small change in my previous post. As the data should be acquired each counter will be a seperate task.
I have also gone through this document http://digital.ni.com/public.nsf/allkb/c326f7d33ca6db0e86256dfe008043b7
I have set the transfer meachanism for the 4 th counter to interrupt before the BeginReadMultiSampleInt32 and for all other counters it is set to DMA. But still I get an error stating the resources are reserved.
Anything else has to be done for the interrupts to work?
Thanks
Mullya
10-10-2006 11:17 AM