08-08-2024 12:38 PM - edited 08-08-2024 12:43 PM
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:
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:
SUB VI:
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
08-08-2024 01:23 PM - edited 08-08-2024 01:24 PM
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.
08-08-2024 03:07 PM
@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:
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.
08-08-2024 03:34 PM
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!!!
08-08-2024 03:45 PM
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.