02-07-2013 09:23 AM
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.
Solved! Go to Solution.
02-07-2013 02:28 PM
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
02-07-2013 03:02 PM - edited 02-07-2013 03:04 PM
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!
02-08-2013 03:30 AM
Thanks Edwin for your quick reply. I got the idea from it.
cheers
02-11-2013 07:55 AM
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).
02-11-2013 08:55 AM
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!
02-11-2013 09:22 AM
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
02-11-2013 09:24 AM
Excellent, glad I could help!
I just discovered that concatenate option recently, myself. There are many hidden wonders in LabVIEW.
Edwin!