Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Mode: Sample on demand

Solved!
Go to solution

Hi ppls,

 

I got a short question (probably a pretty stupid one Smiley Surprised). So what's the difference between 1 Sample on demand and 1 hardware timed sample? I do know that the hardware timed sample use the sample clock of the DAQ card. I thought, that the sample on demand might sample one point and that's it, but somehow it also samples all the time (How do I know the sample rate of the sample on demand option).

 

Thanks, I appreciate ur help! 

0 Kudos
Message 1 of 4
(8,892 Views)

From the help:

 


 

In hardware-timed single-point sample mode, samples are acquired or generated continuously using hardware timing and no buffer. You must use the sample clock or change detection timing types. No other timing types are supported.

 

Use hardware-timed single-point sample mode if you need to know if a loop executes in a given amount of time, such as in a control application.

Because there is no buffer if you use hardware-timed single-point sample mode, ensure that reads or writes execute fast enough to keep up with hardware timing. If a read or write executes late, it returns a warning.

 

Continuous Pulses (HW Timed Updates) is hardware-timed single point for counter output.


 

 

As for what it means and when to use it?  No idea.  I can't think of a time that having a hardware timed single point sampleing would be useful.  But I'm guessing there is someone that needed this feature otherwise NI wouldn't have support for it.

0 Kudos
Message 2 of 4
(8,885 Views)

Thanks, for ur comment! I guess hardware timed single points are used for controllers (like a pid)  ...  How works the Hardware on Demand thing? I mean, how does the program know if there is a demand or not? If a loop executes every 500µs (the read.vi is in the loop), does that mean that there is a demand every 500µs?

 

 

0 Kudos
Message 3 of 4
(8,883 Views)
Solution
Accepted by topic author HakunaMatata13

 

I'm pretty sure the only time I've used hw-timed single point sampling mode was indeed for an output on a controller running RT.    You write the sample using DAQmx Write and then the board will output it on the next sample clock edge.  It helps you maintain hw-based deterministic timing for output control signals even when there's jitter in the software execution time of the control.

 

The "regular" kind of On-Demand sampling does not use a hw sample clock.  In the case of an input, an A/D conversion is performed immediately whenever you call DAQmx Read.  There's no waiting time until the next clock edge, the DAQmx Readvi just does its business as fast as it can whenever you call it.

 

To answer your question specifically, "demand" is defined as "every time you call DAQmx Read".  If you are calling it once every loop that executes every 500 usec, then your sample rate is, nominally, 2 kHz.  Note that even in the very best-case scenario you should expect an easily measurable amount of jitter in this kind of software-timed sampling.

 

 

-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.
Message 4 of 4
(8,866 Views)