Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

store generating numbers as 2D arrays

Solved!
Go to solution

Hi,

 

I am getting voltage and position of a PZT as numbers which are changing continuously. Now my question is that how can I store these numbers (marked in the image by red circle) as 2D arrays?

 

thank you in advance.

 

 

0 Kudos
Message 1 of 8
(6,382 Views)
Solution
Accepted by topic author OpticHero

 

Hello OpticHero,

 

There are many ways to day any given thing, but in the attached image I present two possibilities.

 

The top one assembles the array from parts.

 

The bottom one uses an indexing tunnel.  One interesting thing about the indexing tunnels is they have a conditional tunnel mode too, which lets you choose which cycles add to the array.

 

If you are concerned with jitter, memory access times, and other deeper details, there are other methods of building arrays as well.

 

Good luck!

 

Edwin

Message 2 of 8
(6,372 Views)

 

I was going to add the VI here, but it's not in a usable version of LabVIEW, and while the forum lets me EDIT a post, I don't see an option to delete one.

 

Edwin!

0 Kudos
Message 3 of 8
(6,370 Views)

Thanks Edwin for your quick reply. I got the idea from it.

 

cheers

0 Kudos
Message 4 of 8
(6,355 Views)

Hello,

Sorry!! once more... I can't store the 2 data generated as arrays (depicted in the picture with 1 and 2) in rows of an array one after another. actually the code that I have written overwrites these 2 arrays in one row. Of course by using the arrows (array index) I can see the previous data, but as said I need for each while-loop run new 1X2 array get created and data get stored in it. This work perfect with non-array number as the input (the code that you gave me with random numbers as input).

0 Kudos
Message 5 of 8
(6,340 Views)

 

Hello again Optic,

 

Now at this point I have to admit that I don't know exactly what you are aiming for in your final array layout, but I do notice a couple of things in your diagram that are interesting.

 

One is you are building a 3-dimensional array in the outer loop, inserting each consecutive 2D array into the master array along one dimension.  Also, you seem to be doing this upside down from what I'm used to seeing; usually the parent array is the first parameter of the build array VI, and the insertion is below it.

 

I would think you would want the new data to be appended onto the existing data, not inserted along a new dimension?  There is a on option on the build array VI called "concatenate inputs" that you can find by right-clicking on it.  I have this option set true on the build array VI in the top-right of this new VI picture.

 

I cleverly made my test VI in a released version of LabVIEW so code is attached as well as the image.

 

Edwin!

Download All
Message 6 of 8
(6,331 Views)

Thanks Edwin,

 

Perfect!! The whole problem was this "concatenate inputs" which I didn't know about as a Labview newbei, specially working with German version labview without knowing German. Just by setting it True the -2 days long problem- solved.

 

Thanks again.

 

OpticHero

0 Kudos
Message 7 of 8
(6,326 Views)

 

Excellent, glad I could help!

 

I just discovered that concatenate option recently, myself.  There are many hidden wonders in LabVIEW.

 

Edwin!

0 Kudos
Message 8 of 8
(6,324 Views)