05-13-2011 02:30 AM
Hi all,
I send on a DI port an array, which is periodicaly written (regeneration is allowed). The array size is 8, and when I want to write 800 samples, the array is well written 100 times.
The question is : while my task is running, is it possible to read the number of the sample written (in my case, a number between 0 and 799) without using a counter ?
Best regards,
05-13-2011 08:15 AM
Sure, in LabVIEW you'd just use a DAQmx Write property node and select the property Status->Total Samples Per Channel Generated. You can query it while the task is running to track progress.
-Kevin P
05-13-2011 08:34 AM
Hi,
thanks for your reply.
It doesn't give the expected behaviour : for exemple, I want to write 5000 points.
When I start, the TotalSampPerChanGenerated start to 2000, then grows up to 5000, and stops at 5000 while every samples aren't written. then my task stops.
I want to read in "real time" the number of samples written on my port.
So when I start the task, it begin to 0, and when the last sample is written, it finished to 5000...
Regards,
05-13-2011 11:50 AM
Well, I know the technique *can* work because I've used it quite a bit. My guess is that your code is written such that your queries are not happening when you'd like or as often as you'd like.
Here's a really simple example. It's based on AO so I could test it on an M-series board, but DO should behave the same way. The main idea I'm showing here is that after starting the task, you can query the task frequently and get a continuously increasing result back for the property "TotalSampPerChanGenerated".
If this doesn't help you, can you post your DAQmx code?
-Kevin P
05-13-2011 12:07 PM
Oops, here's the example I mentioned in the previous post:
-Kevin P
05-13-2011 12:16 PM
Hi,
thanks for your reply.
I'm writing on a DO port, triggered by an external input. So I want to know which sample i'm writing.
The code is a little bit complicated, si it's hard to attache it. What I know is that the property node "TotalSamplePerChanGenerated" is continuously readen, and reach the maximum before the output effectively reach the end...
Best regards,