LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx timing number of samples vs. Analog Wfm 1Chan NSamp number of samples

I am using the following sequence: AITemp.vi -> Sample Clock.vi ->Start task.vi -> Analog Wfm 1 Chan NSamp.vi -> end Task.vi

 

What is the difference between setting the number of samples/channel in the Sample Clock.vi and the number of samples/channel in the Analog Wfm.vi? Obviously I am very green with LabView but both seem possible. Thanks in advance.

0 Kudos
Message 1 of 5
(5,513 Views)

Hi,

 

If I understand correctly, your code is set up as follows.  The samples per channel on the sample clock vi is a control, i.e. input, while the number of  samples written per channel on the waveform is an indicator, output.  This would be a display of the number that was written to the sample.  

 

 

Example.png

 

 

There are also examples that are installed with the DAQmx driver that I recommend taking a look at.  They are a great starting point and you may find something that fits your needs.  They are in the NI Example Finder.  In LabVIEW go to Help>>Find Examples and once the NI Example Finder opens select Hardware Input/Output>>DAQmx>>Analog Measurements>>Temperature

 

This document is also a helpful document that is worth reviewing.

 

Hopefully this helps!

 

 

 

Regards,


h_baker
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(5,485 Views)
Thanks for the response. It seems that when I place the Analog Wfm 1 Chan NSamp vi on the block diagram it is expecting number of samples as an input rather than as an output (indicator) that you wired in your example. I have wired both the the sample clock and the read vi with a common constant (e.g. 1000 samples). It seems to work but I am not sure why? It seems redundant to me. 
0 Kudos
Message 3 of 5
(5,466 Views)

Are you sure that we are talking about the same vi?  This is a polymorphic vi and its inputs/outputs will vary depending on which selection you have made.   Either way I am glad to hear that you have it working. Context Help is a useful tool that I always personally leave on.  It shows all of the inputs/outputs the subvi has with an explanation, as well as, a link to navigate to the detailed help. You can either use CTRL+H or Help>>Show Context Help.

 

CH.jpg 

Regards,


h_baker
National Instruments
Applications Engineer
0 Kudos
Message 4 of 5
(4,866 Views)

Hi,

 

The DAQmx Timing VI (Sample Clock) and the DAQmx Read VI (Analog Wfm 1 Chan NSamp) configure different aspects of your DAQmx task.  When you call the DAQmx Timing VI, you are specifying the rate at which you would like to sample data, and if your task is a finite task, the total number of samples you would like to acquire.  Essentially, this controls the timing of your acquisition.  When you start your task, your hardware will begin to acquire data as specified.  For most operations, this acquired data will collect in a buffer in your computer's memory.  When you configure the number of samples property on the DAQmx Read Vi (Analog Wfm 1 Chan NSamp), you are really specifying how many samples of data to read out of this buffer.  To summarize, the input on the DAQmx Timing VI is used to configure how your device will sample data, and the input on the DAQmx Read VI will configure how you retrieve that data.

 

That's a very brief explanation which I hope helps clarify things.  If not, please reply and I'll try to clarify things further.

Dan

0 Kudos
Message 5 of 5
(4,848 Views)