LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number of Data Samples

You have a few problems.

 

1.  You have a control that is called "sample" but it's label is not visible.  It has the number 100 in it.  You have a text label above it that says "sampling rate".  But you have that wired in the "number of samples" input of the N channel, N samples DAQmx giving you a 1-D array of waveforms.  (each waveform represents 1 channel.  So is 100 supposed to be the sampling rate, or the number of samples you want to acquire?

2.  The 1-D array of waveforms goes into a From DDT express VI.  (dynamic data type).  So that array of waveforms gets coerced into the dynamic data type (which can have any number of possible definitions for the underlying data.)  That express VI converts it to a 1-D array of doubles.  It is set for automatic, so I don't know exactly what conversion it is doing.  My guess is that it is giving you a 1-D array where each element represents a channel, and that it is the last sample collected in that channel.  So now you've gone from 100 samples collected down to 1 sample (for each channel.)

3.  You than turn that array into a cluster of 16 elements. and feed it into a subVI called "Angle IN" that you didn't include, so now we have no idea what is going on inside of it.

 

Be carefule with your datatypes.  Avoid express VI's.  I think you are losing data because of that unnecessary conversion through the dynamic datatype.

 

 

0 Kudos
Message 11 of 19
(582 Views)

Dear Ravensfan,

 

Thanks for your reply. I will follow your suggestions and let you know what happens once I complete..

 

0 Kudos
Message 12 of 19
(564 Views)

Hi,

Now I have read the data into 1D array and plotting the same as a graph. Now I am getting 1000 samples per second upto 30 seconds..

If I run the VI more than 30 seconds My data quantity gets lesser. i.e;

 

I am getting 30k data upto 30 seconds..

 

If I run the VI for 45 seconds, I am getting only 40k data.

 

If I run the VI for 73 seconds, I am getting only 52k data..

 

I want to know the reason for this.,

 

Is there any limitation in memory of a VI or array size.. or if it is anything else, please guide me to solve this prob..

 

0 Kudos
Message 13 of 19
(515 Views)

Hi Arul,

 

mind to attach your VI in it's current state?

(Or show a snippet of its BD?)

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 14 of 19
(512 Views)

Sorry GerdW,

 

Here is the VI..

0 Kudos
Message 15 of 19
(506 Views)

As it is very lengthy one, please see the code from starting from case selector - Start case structure..

 

 

0 Kudos
Message 16 of 19
(505 Views)

Hi Arul,

 

I'm sorry, but I'm not willing to debug a VI with a BD size of 9266×3275 pixel (~12 times the size of a FullHD display!) and using way too much local variables!

 And I also don't support code with (atleast) 4 levels of sequence structures with some loops and case structures mixed in in between!

 

Clean up, clean up, clean up.

Use more subVIs.

Remove Rube-Goldberg code.

Use unique control/indicator names! (There is a control named "Stop" and an indicator with the very same name - and additionally local variables of "Stop"…)

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 17 of 19
(499 Views)

Here is the cleaned Vi for your reference. As missed Vi's has only calculations, didnt attach..

0 Kudos
Message 18 of 19
(492 Views)

Hi Arul,

 

it's a bad idea to build up arrays in a loop. It's a bad idea to add just one sample per iteration to those arrays. It's especially bad when those arrays are getting bigger in size…

 

Learn about:

- avoiding local variables, there are still too many in your VI

- using proper coding schemes, like state machines and producer-consumer scheme

- using memory efficient coding style as has been mentioned in the LabVIEW help

- efficient programming in general: why do you need to convert arrays to clusters?

 

 

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 19 of 19
(485 Views)