LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting LabView 1D Array to be Column-Based instead of Row-Based

Hi all,

 

I am working on a VI to gather temperature outputs from a Lake Shore 336 temperature module. I have a main VI that has been written that collects the temperatures and outputs them as a 1D array which then gets output into a .tdms file that can be opened as an Excel sheet. The current output can be seen below in black as a row-wise array of 8 temperature output elements. The desired input I would like to have is in red which is a column-wise array of 8 temperature elements:

 

araineri45_0-1723136286723.png

 

In one of the sub VI's of my main VI program, I think I have found the driver of what constructs the array which is circled in red (screenshots below and VI's are attached. Item circled in first picture below is the location of the sub VI in the main VI program. Item in second picture is the sub VI, and circled in red is what I think the driver of the array construction is in the .tdms file), but I haven't been able to come up with a valid solution to fix my issue. All I want to do is transpose the array so that it outputs to be in columns instead of rows as seen above. I understand that there is no transposing a 1D array, but I still feel that this issue should be relatively easy to fix.

 

MAIN VI:

Main.png

 

SUB VI:

 

Sub.png

 

So far I tried forcing the 1D array to try and be a 2D array for transposing, I tried concatenating the values, and I tried a mix of reshape array and concatenation together, all to no avail. I also tried placing the array collection process in the for loop but that didn't work either. I know that I can use Excel commands to transpose it after the fact to get the desired output, but I would like to automate this step to avoid a bunch of manual data processing. 

 

I have troubleshot this issue for probably 15+ hours at this point as I'm still very new to LabView. Any help would be very much appreciated.

 

Thanks so much in advance!

araineri45

 

ATTACHED FILES

Main VI: SW18DAQ_Testing.vi

Sub VI: Sensor Data (Read All).vi

Download All
0 Kudos
Message 1 of 5
(267 Views)

1. Remove the change you did to the driver VI.  It outputting out a 1D array is fine.

2. Put a FOR loop around the Build Waveform.

 

The main point here is that you need a different waveform for each channel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(246 Views)

@araineri45 wrote:

So far I tried forcing the 1D array to try and be a 2D array for transposing, I tried concatenating the values, and I tried a mix of reshape array and concatenation together, all to no avail. I also tried placing the array collection process in the for loop but that didn't work either. I know that I can use Excel commands to transpose it after the fact to get the desired output, but I would like to automate this step to avoid a bunch of manual data processing. 

 


So, let's look at your picture:

altenbach_0-1723147443646.png

 

  • Reshaping a 1D array to a 1D array with one elements seems quite silly.
  • building a 1D array (concatenate mode) from a 1D array, gives you an output that equals the input unchanged.

1D arrays have no concept of rows or columns (unlike e.g. in Matlab). All you need is build the 1D array into a 2D array and transpose. then you can format it and insert it into your table at the right place.

 

0 Kudos
Message 3 of 5
(217 Views)

Hi crossrulz,

 

1. Thank you for letting me know, I was convinced that was where my issue was but I appreciate you steering me in the right direction. I'm very happy the issue is not with the driver.

2. I will try your method as soon as I can, I see exactly what you mean now. 

 

I'll let you know if this doesn't work by replying to this post. Right now our temperature controllers are out of the lab, but once we get them back and I can work on the program again I can hopefully try this. I'll accept it as the solution if it works, thanks a lot for your help!!!

0 Kudos
Message 4 of 5
(207 Views)

Hi altenbach,

 

To someone who is probably very experienced with LabView I'm sure some of the methods seemed silly, but I was playing around with different functions to see if it would output differently. I know both of those methods essentially would output the same exact thing, but I was hoping it would be in a different format.

 

Thanks for trying to help, I'm going to try making the 2D array.

0 Kudos
Message 5 of 5
(200 Views)