Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Read number of iteration of regenerating task

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,

 

V-F
0 Kudos
Message 1 of 6
(3,379 Views)

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

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 6
(3,372 Views)

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,

V-F
0 Kudos
Message 3 of 6
(3,370 Views)

 

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

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 6
(3,360 Views)

Oops, here's the example I mentioned in the previous post:

 

-Kevin P

 

 

query num samps.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 6
(3,357 Views)

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,

V-F
0 Kudos
Message 6 of 6
(3,354 Views)