LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collect data into an array and average it.

You misunderstood me.

I just want to know if something needs to be changed in the picture.
Array (2d) of data comes from 1. From 2, averaging occurs. Everything works here. But I want to check - right or wrong. To do this, I want to collect several arrays from 3 and write them to txt (excel).

I can't invent of how to take a 1d array from each iteration and write to a file. Or make a multidimensional array of 1d arrays and then save it.

0 Kudos
Message 11 of 19
(604 Views)

Is this the same question as the previous thread? https://forums.ni.com/t5/LabVIEW/Collect-data-into-an-array-and-average-it/m-p/4097795?profile.langu...

 

To save Your data array, use https://zone.ni.com/reference/en-XX/help/371361R-01/glang/write_delimited_spreadsheet/

 

It is the first VI in the "File" palette.

0 Kudos
Message 12 of 19
(595 Views)

Hi Fizikaman,

 


@Fizikaman wrote:

I just want to know if something needs to be changed in the picture.


The counter used to compare with "Kol-wo ciklow" should be an integer. No need for any orange float here.

As has been said before: the inner while loop is non-sense! Anchor the shift registers at the outer loop border!

 

Why don't you attach your VI? We cannot debug or edit images using LabVIEW…

 


@Fizikaman wrote:

I can't invent of how to take a 1d array from each iteration and write to a file. Or make a multidimensional array of 1d arrays and then save it.


Learn the LabVIEW basics: using an autoindexing tunnel converts your 1D array into a 2D array.

Read the help on WriteDelimitedFile function to learn how to save 1D or 2D arrays…

 

Edit after merging your threads:

  • Please attach the current state of your VI. The VI above is nearly 3 weeks old by now…
  • Learn about DATAFLOW and avoid local variables (because of race conditions).
  • Think about usage of "Formula" ExpressVIs for those very simple formulas. Do you really need numeric constants with 32 decimal digits for handling measurement data? (This is numerical non-sense!)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 19
(583 Views)

Nearly. In that thread, I asked how to average the data.

And in this thread I am asking how to check the averaging I wrote.

The fact is that it will not be possible to simply save, since the last array is saved, and I need all the arrays. That is, 10 measurements pass and I need to save 10 arrays in order to independently check the data averaging.

0 Kudos
Message 14 of 19
(554 Views)

I think you will understand my VI for a long time.
Local variables cannot be discarded. Or, I just don't know how to do it.
I am enclosing VI version 16.

0 Kudos
Message 15 of 19
(548 Views)

Perhaps I am not explaining exactly. I don't just need to save the file (I have already implemented such a code and it works with a single measurement). I need to run 10, 20, 50, 100 cycles and save each cycle to check if the averaging works correctly.

0 Kudos
Message 16 of 19
(549 Views)

@Fizikaman wrote:

Perhaps I am not explaining exactly. I don't just need to save the file (I have already implemented such a code and it works with a single measurement). I need to run 10, 20, 50, 100 cycles and save each cycle to check if the averaging works correctly.


I assume that you want to save the data only to look at it once, check the algorithm for correctness and then delete the file.

 

The fastest way to do this is like in the image below. It is not a good way to do this. I have alread posted the link to the VI above.

 

LLindenbauer_0-1606216222988.png

 

0 Kudos
Message 17 of 19
(539 Views)

Yes, you understand correctly. I want to look all arrays and compare with the final one.
Thanks. Now I will try to do so.

0 Kudos
Message 18 of 19
(523 Views)

By the way, what about the remain of the VI code? I'm just learning how to work in labview.

0 Kudos
Message 19 of 19
(521 Views)