LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx "wait for next sample clock" never shows "is Late" !

That is not the case.
I configured the daqmx to aquire one sample , but the rate is 3
So it is configured to aquire one sample , 3 times in a second,
If you run the program you will see that it is indeed aquiring 3 points per second.
0 Kudos
Message 11 of 30
(862 Views)

no it is configured to acquire one sample with a sample interval of 0.33333 s. However for one sample the sample rate doesn't even has any influence because it will acquire one sample and then stop, so there is no chance the sample interval will ever get involved, although it is a safe bet that the according counters are programmed anyhow, but who cares.

 

Once a task is stopped (and having acquired the required amount of samples automatically stops it) you have to at least rearm the task again in order to get anymore samples acquired.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 12 of 30
(859 Views)
Ok
Can you send me a vi that will give me the is late error ?
0 Kudos
Message 13 of 30
(854 Views)

You don't really want to listen nor think! Play with the parameters of your Task configuration and you should be quickly able to come up with something. If you feel that is to difficult you should really try something else than programming.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 14 of 30
(845 Views)

I checked this again.

you are sooo wrong my friend.

I work in a sample mode  - "Hardware Timed Single Point "

which means : (found that in the help) :

Acquire or generate samples continuously using hardware timing without a buffer.

 

the samples per channel parameter : "specifies the number of samples to acquire or generate for each channel in the task if sample mode is Finite Samples. If sample mode is Continuous Samples, NI-DAQmx uses this value to determine the buffer size".

 

if you only run the vi that i attached you will see that the loop is running 3 times per second.

 

 

0 Kudos
Message 15 of 30
(842 Views)

@hookso wrote:

I checked this again.

you are sooo wrong my friend.

I work in a sample mode  - "Hardware Timed Single Point "

which means : (found that in the help) :

Acquire or generate samples continuously using hardware timing without a buffer.

 

the samples per channel parameter : "specifies the number of samples to acquire or generate for each channel in the task if sample mode is Finite Samples. If sample mode is Continuous Samples, NI-DAQmx uses this value to determine the buffer size".

 

if you only run the vi that i attached you will see that the loop is running 3 times per second.

 

 


Well but "Hardware Timed Single Point" is most likely not "Continous Samples" mode. I can't run the VI easily on this machine as I have not apropriate hardware available here.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 16 of 30
(840 Views)

that's right, that what i meant :

in hardware timed single point, this parameter has no influence. it does nothing, even if i write there 1000.

i'm talking with facts now :

how you explain the fact the the loop is running 3 times per second untill i stop it,

and when i click on delay it will insert 3 sec delay to the loop ,and still the "is late" parameter will not return  "true" ?

0 Kudos
Message 17 of 30
(830 Views)

most likely because while the sampling is controlled by the hardware clock there is no consideration for being late. The sampling will simply happen in the background without any buffer and the DAQmx Read will retrieve whatever sample is there, or wait until one is there. There is no consideration for anything like buffer overflow (the flag that causes sampling late?  to return true) since technically there is no buffer.

 

Yes you could argue that this should be implemented but much more than a product improvement suggestion will be hard to push through here.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 18 of 30
(825 Views)

If i had a buffer i did not need the is late function , because i could check if the buffer has more than one sample.

and if it is, i will know that i'm late - that the software loop is not keeping up with the buffer filling up.

 

please take a quick look at this : 

NI-DAQmx Hardware-Timed Single Point Lateness Checking

http://www.ni.com/white-paper/3215/en/

 

the first example will show you that this "daqmx wait for next sample clock" function has been made for these situations,

when you have no buffer and you want to check if you missed reading a sample.

 

 

 

0 Kudos
Message 19 of 30
(818 Views)

Okay some more basic questions- as I can't run your example here either.

 

How long is your wait?

When you run with the wait enabled, you can confirm that you see the sampling occur at a lower rate?

After the loop has run at least twice, when you hit stop do you see any error messages?

0 Kudos
Message 20 of 30
(809 Views)