LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

manipulating values into arrays and integrating this array into another (beginner)

Solved!
Go to solution

I’ve looked a bit but I’ll spend more time with that. Thanks for the example VI, I’ll get into understanding that soon, thank you.

Off for some pie and mash now

0 Kudos
Message 11 of 34
(683 Views)

Thanks for the VI it's proving helpful. I have been told that it would be better to have the final array in the following format:

 

Footballbag_0-1628003734246.png

 

The example pictured being 1 round of measurements for the first selected pump speed.

 

I need to think about how I will append the current round of measurements to the end of the previous one so as to keep all S-parameter measurements in the same column (well row which will then be transposed at the end).

Also I want to attach the pump speed value setting to each row of data points as pictured so the results can be easily processed.

 

I'll continue with developing understanding via the VI from Altenbach and the tutorial sheets on NI and get back to the forum if I need to.

 

0 Kudos
Message 12 of 34
(668 Views)

You can use a table with a single header with the following elements:

"pump speed", "S11 magnitude", "S11 Phase", "S21 magnitude", "S21 Phase", etc.

(note that you cannot merge cells (e.g. your current S11, and S21). Write the headers using a property node unless it it always the same..

 

 

As I already said, you probably know the final array size, so initialize a 2D string array of that final size with empty strings for display in the table and keep it in a shift register. The positions of each value can be calculated form first principles so just replace ech empty string with a real value as it is acquired. 

Message 13 of 34
(645 Views)

Apologies, I didn't mention in that post that I don't need headers that was just to make my table schema clear. I've tried Replace Array Subset to insert a single value for the pump speed into the initialised array. Which works as expected appending one value in column 0 at the first row of the new set round of s-parameter measures. Then using Insert into Array to append the 10 values at the correct column for each run. My issue is here as rather than append the 10 values in the column I index, using first principles, it appends a new column to the end of my 80x5 initialised array. Making it 80x6, 80x7... and so on.

 

Excuse the Rube Goldberg While Loop, I haven't worked out how I would use the terminating condition of  a For Loop to stop the pump.

Download All
0 Kudos
Message 14 of 34
(625 Views)

You are using "insert into array" instead of "replace array subset". Big difference. Big mistake!

 

  • "Insert into array" will grow the array, inserting new rows or columns. This is expensive because all higher elements need to be moved in memory, and it often requires expensive new memory allocations.
  • "Replace array subset" will replace an element, row, or column (depending on how the indices are wired), keeping the array size constant. This is much more efficient because the operation can be done in-place.
Message 15 of 34
(619 Views)

That makes sense, thank you!

0 Kudos
Message 16 of 34
(604 Views)

My issue with Replace Array Subset is that I would like to place my 1d arrays of 10 values after every loop below the set that have just been recorded for each of the 4 columns rather than replace them in the same position. I'm not sure whether this is advisable approach as it doesn't seem obvious yet how I do this. Attached is my results after measurements have finished being taken. Only the final 4x10 values are left in the table. I thought that I could maybe specify both the row and column index for the top value but that specifies an element rather than the first value of a 1d array. As an approach I realise that doesn't make sense. Any clues as to how to make this work would be welcome. Thanks.

 

Footballbag_0-1628504462970.png

 

0 Kudos
Message 17 of 34
(574 Views)

Hi bag,

 


@Footballbag wrote:

As an approach I realise that doesn't make sense. Any clues as to how to make this work would be welcome.


Attach your code so we can debug and discuss it!

An image of some Excel worksheet doesn't make a lot of sense in a LabVIEW programming board!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 34
(564 Views)

Here's my initial attempt at only having 5 columns. 10 Values are sent out from the VNA part of the code as a 1d array. I was hoping to fit them into the 2d array pictured in the Excel worksheet but they only overwrote eachother.

0 Kudos
Message 19 of 34
(558 Views)

So as a different approach that works with by simply replacing each column of my initialised array I made this alternative.

0 Kudos
Message 20 of 34
(557 Views)