Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

multifunction DAQ- configuration of data acquisition in LabVIEW

Solved!
Go to solution

I'm having doubts regarding the acquisition of data in the LabView environment. I used the block diagram (Figure 1) below to review the update of values read for a loop execution.

Block 1 was used to enable a task (first steps) with 3 channels (al) Analog input AI3 and even configure the channel. In this case, the data bus (data-block 4) are construindos by 4 columns of data (obtained from the task 3 more AI3).

The block 2 is used to set the sampling rate in this case is 1 Hz (1 sample per channel x 1 Rate).

In this case it worked as I expected (Figure 2). Allowing the conclusion that the time between each sample was 1 second. The saw took one second in the iteration.

The second step was to change in block 3 the amount of data sampled in accordance with Figure 3 channel.

Now each channel showed 10 samples, whereas there are 4 channels configured, we have 40 samples. In this case the iteration time was 10seconds (point at 1Hz and 10 samples per channel-figure 4).

 

The first question is what is the time between each sample obtained by channel?

 

In this type of configuration (multiple channels) Block 3 provides 10 samples in each channel, so as sampling is performed, ie, the block gets 3 10 samples from a channel and passes to the next channel or gets 1 comp each channel and repeats this process until 10 samples per channel?

 

What would be the best method to ensure that the interval between each sample is constant?

 

If anyone knows any text that explains what the function of blocks of data acquisition please inform.

 

Thank you

Gabriel

 

0 Kudos
Message 1 of 8
(4,942 Views)
I don't understand your VI and some of your statements. You have hardware timed single input but the DAQmx read is set for n samples. You mention a loop but there is no loop in your code. You would use that timing with a single sample DAQmx read inside a loop. You would use finite samples and n samples if you wanted a single acquisition and no loop. Have you tried any of the shipping examples?
0 Kudos
Message 2 of 8
(4,913 Views)

Hi, Gabriel,

 

Firts of all, you need to think better regarding your sample rate and number of samples. If you want to collect 10 samples at a rate of 1 Sample/s, you need to adjust your Timing Sample Clock with different values, using 10 as number of samples and 1 as rate. I saw in Figure 1, that you set you number of samples as 10 and your rate as 10. The same problem with your code in figure 3, you set your sample rate as 1 and your number of samples as 1. As you are not using continuous acquisition, your code will only get 1 sample.

 

Second, you can take a look at this material:

 

Getting Started with NI-DAQmx Basic Programming: https://www.ni.com/en/support/documentation/supplemental/06/getting-started-with-ni-daqmx--main-page...

 

 

Here you can find some examples regarding reading multiple channels using DAQmx: https://www.ni.com/en/search.html?pg=1&ps=10&sn=catnav:sup.exm&q=daqmx%20read%20multiple%20channels

 

 

Pedro Ivo da Cruz
Engenharia de Aplicações
0 Kudos
Message 3 of 8
(4,900 Views)

Hello Dennis, thanks for helping.

Well I'm trying to explore the part of the LabView data acquisition. I'm trying to find out how it really is the data sampling (multichannel). Probably was not clear that the task "first steps" consists of three channels defined in NI max al. Figure 2 present the results of sampling we note that the data output by 4 vectors were constructed (data from the task "first steps" + a configured channel in LabView), in which case it contains 1 single sample of each channel.
Block 1 was inserted to verify the possibility to configure the channel directly in LabView and thus generate a task without needing to go to Nimax software for it.

So the questions begin the first case (Figure 1).

Defining in block 2 the sampling rate = 1 and the number of samples per channel = 1, and further defining the block 3 1 sample per channel, confirmed that the execution time of the VI was 1 second. The output data was first sample from each channel. I wonder what is the time between each sample?

In case 2, block 3 has changed the number of samples per channel. In this situation the VI took approximately 10 seconds to run. So I was confused to conclude which is the time between each sample, because in this case I have 40 samples available in vector output (10 samples per channel x 4 channels).
How do I understand what is the time between each sample?


Thank you

Gabriel

0 Kudos
Message 4 of 8
(4,895 Views)

Hi, Gabriel, now I understood what is your doubt.

 

See in figure 3 that you set your rate as 1 Sample/s. You have 4 channels, so you get data at this rate in each channel. In 10 seconds, you will get 10 samples in each channel, and the samples between each sample is 1 second.

 

Now, what I didn't understand yet is if you want to know what is the time between samples from different channels, or between samples from the same channel.

Pedro Ivo da Cruz
Engenharia de Aplicações
0 Kudos
Message 5 of 8
(4,887 Views)

Hello Pedro_ thanks for the help!

I would like to know the two times.

Well I'm trying to explore the block 2 (DAQmx Timing).

The goals of the discussion are:

What is the best way to configure a data acquisition using this configuration block (considerendo multiple channels)?

As the rate parameters: sample mode: samples per channel, interfere with the duration of the VI?

The time between a sample and the other the same channel?

And time lost among a sample of 1 channel and a second channel sample?


I did some tests to try to answer the above questions:


Case 1:

In block 2 of Figure 3:
Changed the number of samples per channel 1 to 4.
The sampling rate = 1.
The changes did not affect the duration of the VI.

case 2
I changed the number of samples per channel in block 2 to 10
The sampling rate = 1.

Changed in block 3 the amount of sample per channel from 1 to 10.

In this case the duration of VI was 10 seconds.

0 Kudos
Message 6 of 8
(4,878 Views)
Solution
Accepted by topic author Gabriel.

Well, there are many ways to read signals from multiple signals, and each one will present a different behaviour. I coudn't see in your codes how you are acquiring from mutiple channels, because in both codes, you are setting just one channel. Take a look at this figure:

 

 

Here you can see how to set multiple channels using DAQmx, using commas to separate the channels. Regarding the ways different ways that you can read the signals, you can look at the links that I sent in my first post to learn more about them.

 

In a few words, the time between the samples from the same channel is T = 1/Fs, where Fs is the sample rate. There is not a rule to determine the time between samples from different channels, because it will depend of the way that you did your code, and as I sad, there is different ways to do this. You can acquire the samples at the same time, or you can configure your code to read a fixed number of points from a channel and then read another fixed number of samples from another channel (https://forums.ni.com/t5/Archive-TKB/Reading-Multiple-Signals-from-a-Single-Physical-Channel-Using/t...). You can acquire a finite number of points, or you can acquire continuously. Again, take a look at the material that I've already sent. It will help you to find the better way to do your code depending of your application.

 

Regards,

Pedro

 

 

Pedro Ivo da Cruz
Engenharia de Aplicações
0 Kudos
Message 7 of 8
(4,854 Views)

Ok,

Thanks for the tips and helps for me to enteder the operation of this programacção step in LabView.

0 Kudos
Message 8 of 8
(4,814 Views)