LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting arrays into arrays

Solved!
Go to solution

Okay, this is an array issue.  I have an experiment that changes parameter 1 (temp), then changes parameter 2 (volts) a number of times, with data output.  the process is then repeated.  I would like to get an array that looks like

T1 V1 Data array

T1 V2 Data array

T1 V3 Data array

T2 V1 Data array

T2 V2 Data array

T2 V3 Data array

T3 V1 Data array

etc.

 

"case 2" is my first attempt at implementing the array into the data stream to write the file.  Clearly this doesn't work and only reports the data from the most recent temperature.

 

"case 4" is my most recent attempt.  I get all the data into an array, but it looks like it's a 3-d array when the block diagram specifies only 2-d array.

 

The problem area is to the end of the block diagram.  Any advice on cleaning up other parts of the program is also accepted (Note: the whole interface has to avoid visa - for reasons I won't go into).  I'm sure it's a quick fix and I thank you for taking the time to help me.

 

A few Ideas I had but failed to implement are creating sub-arrays and inserting them into a main array (case 4).  Creating 2-d arrays (outside of volt cycle) and adding them together.  Brute force inserting single elements into arrays (I know how to do this, but there has to be an easier way, this is Labview).

Download All
0 Kudos
Message 1 of 4
(3,665 Views)

At the beginning of the loop you are initializing the array. (Here you could change the data representation of the constant from I32 to DBL. Just right click on the constant and choose Representation > DBL. You don't have to convert the constant.) Then I would expect that you are using Replace Array Subset VI instead of Insert Into Array.

 

Personally I would use the Build Array VI if there are only a few elements to be combined. (Build Array copies the data array every loop which could be critical in large arrays.)

Message 2 of 4
(3,646 Views)
Solution
Accepted by topic author dark7flame
Perhaps you are frustrated seeing the array reinitializing each iteration, showing only the current measurement. Shift registers are your solutions:


build meas array.PNG

Of course, as Jorn wrote, if you have a large number of measurements you should initialyze the array with appropriate number and use "Replace" instead of "Build Array", but it seems this is not your case.

 

LVM/TDM files are not Excel files, but can be imported using TDM-Excel Add-In. Also, you can write directly to Excel using automation or VIs from Report Generation Toolkit, if you have it (search excel in example finder).

Message 3 of 4
(3,630 Views)
I knew I forgot something! Shift registers!  Of course.  Thank you both for your prompt responses.
0 Kudos
Message 4 of 4
(3,602 Views)