From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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 am integrating two pieces of equipment: a vector network analyser, and a microfluidic pump. I change the speed of the pump and then use the vector network analsyer to take S-parameter measurements of the liquid flowing through the pump at the chosen speed. I take 10 S-parameter measurement points at a constant frequency over time. I then loop to a different value of pump speed and repeat the measuring process.

 

I have the array of s-parameters in rows with each row being a different S-parameter with 10 data points. I want to attach 10 repeated values of the selected pump speed as a row that is above that round of S-parameter measurements. My query is how to attach repeated pump speed values to the other array as a row before each round of measurements?

Download All
0 Kudos
Message 1 of 34
(1,677 Views)

The solution would look like below, but without the row titles:

 

pump speed  0.1    0.1    0.1    0.1  ...

S11 mag        0.5    0.6    0.5    0.7  ...

S11 phase     122    126   127    123 ...

S21 mag        0.1     0.6     1.2     1.3

S21 phase    125    127    123    122

next pump speed 0.2   0.2    0.2    0.2

S11 mag ...

.

.

.

0 Kudos
Message 2 of 34
(1,662 Views)

Use an Insert Into Array, or Transpose:

 

Insert 2D Array.png

Message 3 of 34
(1,653 Views)

You did not quite fully understand my advice in your earlier thread (that seems to deal with the same problem).

 

At this point you simply need to get more familiar with array operations and shift registers and there are plenty of good tutorials. You probably want to anchor the shift register on the toplevel while loop. As I already said, appending rows is significantly more easy and efficient. You can always transpose for display.

 

Lot's of your code is still quite silly. Autoindexing on a while loop and stopping it based on the array size is just a Rube Goldberg simulation of a FOR loop.

Message 4 of 34
(1,645 Views)

Yes I think I didn't understand completely as you say. I understand that part, I was planning to append the values as a row. I'll follow those tutorials further, do you recommend ones available through LabVIEW directly? I tried the top level shift register but I'll explore that further then.

0 Kudos
Message 5 of 34
(1,634 Views)

Yes I realised that was a silly roundabout way of making a for loop.

I imagine most of the tutorials on youtube will be fine?

0 Kudos
Message 6 of 34
(1,626 Views)

See if this can give you some ideas. Just substitute your hardware IO in the right places.

 

altenbach_0-1627917848368.png

 

Message 7 of 34
(1,616 Views)

Since you know the exact dimension of the final output, a more efficient way would be to initialize the final array before the loop starts (e.g. with NaN) then replace with measurements as they are acquired. Now you can even update after each S measurement if this is desirable, depending on the speed of the instrument response.

0 Kudos
Message 8 of 34
(1,610 Views)

@Footballbag wrote:

I imagine most of the tutorials on youtube will be fine?


There's a lot of garbage on YouTube. Have you checked the learning resources listed at the top of the forum?

Message 9 of 34
(1,598 Views)
Solution
Accepted by Footballbag

@altenbach wrote:

Since you know the exact dimension of the final output,...


Here's how that could look like. Make sure you fully understand each details! Depending in the measurement speeds, you could also place the array indicator one or two loops out.

 

altenbach_0-1627920110936.png

 

After the loop you could save it to a text file.

Message 10 of 34
(1,595 Views)