LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sampling

here is the file. if you could please make some considerations about it and the things you have been teaching me, if it is more clear for you now i would be very very grateful. thank you so so much for all your kindness.

0 Kudos
Message 11 of 24
(1,126 Views)

I looked at your VI and can now explain some things.

 

Your DAQ Assistant appears to be set to sample at 2000 samples per second (fs) and to return 50 samples on each channel every time it is called.  This is what we had determined previously.

 

The data coming out of the DAQ Assistant is Dynamic Data Type, which means it can be many different kinds of things.  In this case it contains a 1D array of waveforms.  The Waveform data type includes at timestamp (t0), a sampling interval (dt = 1/fs = 1/2000 = 500E-6 s), and an array Y of DBL. Because it returns 50 samples on each call, the arrays are 50 elements long.

 

Immediately after the DAQ Assistant the DDT is converted to a 1D array of DBL.  I wrote a little test program to determine what data is in that 1D array.  So far as I know it is not documented anywhere in the help files. My program shows that for this case the values in the 1D array of DBL are the last values in each waveform.  This means that the data coming from the 12-element Index Array includes the last of every 50 samples for each channel.  Thus, my earlier estimate that your effective sampling rate is 40 samples/second is correct.  These values and the 12 calculated values from the formula node are converted to text and eventually saved in the Excel file.  49 of every 50 points acquired by the DAQ Assistant are never used.

 

The Convert from DDT can be set to return an array of waveforms.  That would allow you to get all the data but will require complete re-writing of most of the rest of your VI.  You need to decide whether you want the data enough to do the work.

 

There is no need for the 2 ms Wait. The DAQ Assistant performs a wait that lasts 40 ms.

 

The Style Guidelines recommend that the front panel and the block diagram be designed to fit on one screen without scrolling. I was able to squeeze your block diagram to fit on my screen, just barely.

 

The formulas which generate the outputs of the formula node are hidden. It is generally a good idea to document algorithms.  It is even more important when the code cannot be seen.  I would probably implement those calculations in native LV code, put it into a subVI, and configure it to handle arrays of data.  Then it would be very easy to change the number of samples processed and possibly the number of channels with very little programming change.

 

There are other things I would do differently, but those are more programming style than functional issues, so I will not discuss those.

 

Lynn

0 Kudos
Message 12 of 24
(1,112 Views)

thank you som m,uch Lynn. i have had other exams. i am returning to this subject now. anyway, thank you soso much for youyr kindness and big help. thank you

0 Kudos
Message 13 of 24
(1,090 Views)

i am sorry but i was studying your answers.i know that this is stupid but i dont underestand. you said

 

''The DAQ Assistant is sampling at 2000 samples per second. It is reading 50 samples at each read.  2000/50 = 40. So, reading 40 times per second ''

my question is: if it reads 2000 per second and reads 50, this not means it is reading 50 times per second.??

 

''So the program saves to file one data point for every 50 data points the DAQ Assistant acquired. 49 of 50 = 98% = the fraction of the data which is not saved.''

i also did not understand where do you take this 49... can you explain me?

 


 i have had many exams and i will be evaluated tomorrow on this. if you could give me any help in this questions i would be very grateful.thank you very very much for your kindness

0 Kudos
Message 14 of 24
(1,087 Views)

The analog to digital converter (A/D) in the board converts its input voltage to a digital number (samples) 2000 times per second. Thus, each sample is taken 1/2000 second = 0.5 ms after the previous sample.  Each call to the DAQ Assistant "grabs" 50 samples. The time to accumulate 50 samples is 50 * 0.5 ms = 25 ms. The Reading Rate then is 1/(25 ms) = 40 Hz.  If nothing else slows down the loop containing the DAQ Assistant, the loop would run 40 times per second and you would get 40 readings (each of which contains 50 samples) per second.

 

Each reading from the DAQ Assistant is a Dynamic Data Type which has a waveform with 50 data points hidden inside. Your code converts that Dyanmic Data to a single scalar value. So you start with 50 data points. You use one of them. 50 - 1 = 49. 49/50 = 98%.  I could have said equivalently that you are only saving 2% (1/50) of the data but I wanted to emphasize the 98% which was being discarded.

 

Lynn

0 Kudos
Message 15 of 24
(1,069 Views)

ohh thank you so much. it was very clear. can you also clarify me this last time:

 

''The DAQ Assistant controls the driver for the DAQ board and passes the settings to the board.''

 

my daq assistant is changing volts into length and newton (acquired by transducers and forcee sensors). my question is, the values arrive in labview in volt and then they change when they ''find'' the daq,

 

or, they are somehow changed in the ni card before entering in the labview software?

 

i am sorry, i know that i may have wrong ideas about this, but i can t seem to understand this. 

__

anda at last when you say

''Your code converts that Dyanmic Data to a single scalar value.''-can you tell me where it is done, just in case tomoroow someone ask me please

 

 

thank you very very much. this is so important for me thank you

 

 

0 Kudos
Message 16 of 24
(1,065 Views)

I recommend that you look through the help files (click in the Detailed Help links in the context help window) as they are the place to look first for explanations.  You do not always get everything you want to know there, but it is the best place to start.

 

An overview of data acquisition: The components: A computer with expansion slots or communications ports. A data acquisition device which is plugged into an expansion slot or communucations port on the computer. A computer operating system (program). A driver for the data acquisition device (program). An application program.  In the case of the DAQ Assistant there are at least two programs as part of the driver. One is a .dll which talks to the board and the other is the DAQmx/LabVIEW parts which gets data from the .dll and passes it to the rest of the LV program.

 

When the application program wants data, it tells the OS. The OS calls the driver. The driver tells the DAQ device to get some data.  The driver receives the data from the DAQ device. The driver tells the OS the data is ready. The OS tells the application program the data is available. Repeat.

 

At the most fundamental level the data acquisition device takes a voltage input and converts it to an integer (for example 16 bits). The DAQ Assistant or DAQmx VIs can convert that integer to volts of meters or newtons.

 

Did you knwo that you can open the front panel of the DAQ Assistant and then the block diagram to see how it does things?

 

Lynn

0 Kudos
Message 17 of 24
(1,060 Views)

i know this are stupid quesions, but this is allvery new and quick to me. but thank you really.

 

can you tell me what do you mean with OS means? thank you so mchu rfor all your kindness really:)

0 Kudos
Message 18 of 24
(1,044 Views)

IS it operating system and labview for LV ?thank you very much(please this is my last question, if you can answer me please sorry)

0 Kudos
Message 19 of 24
(1,037 Views)

Yes.  I see you got an answer in your other thread.

 

I try to minimize the use of abbreviations in threads started by people new to LabVIEW (LV), so I apologize for confusing you this time.

 

Lynn 

0 Kudos
Message 20 of 24
(1,025 Views)