LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Splitting 2D arrays and remending them

Solved!
Go to solution

Hi everyone,

 

I'm using my DAQ system to collect data from multiple different instruments.  I'm having trouble sorting the data and having it collect correctly.  I have two pressure transducers and a flow meter which gives the flow in LPM and the temperature in deg C.  All the information is collected into a 2D array of time and values.  I was able to split the 2D array into a 1D array and I then indexed the 1D array so I could do the proper arithmetic for each instrument.  I am having trouble recombing the data with each and in relation to time so I can plot the data and save it to a spreadsheet.  Is there a more simple method I don't know about or am I missing something trival?  I've attached my current program.

0 Kudos
Message 1 of 12
(3,674 Views)

Maybe you just want to righ-click the build array function and select "concatenate inputs".

 

(Instead of all that splitting and combining, you could just scale with an array of constants instead)

0 Kudos
Message 2 of 12
(3,666 Views)

If I scale with an array of constants how would I go about doing the subtraction to get the correct temperature for my flow meter?  Also is the array on constants just a 1D array of the values I need to multiply by?

0 Kudos
Message 3 of 12
(3,650 Views)
Solution
Accepted by topic author jhwimmer

Here's one possibility:

 

 

0 Kudos
Message 4 of 12
(3,621 Views)

That gets really close.  When I take a sample of data for lets say 30 seconds I should get a final result that is 4 columns and 30 rows but with this set up I only get one column and 4 rows since P4 and P5 are not used currently.  Is there an easy fix for that?

0 Kudos
Message 5 of 12
(3,611 Views)
You need to explain exactly how 30s of data looks like coming from the device and how you want it arranged in the file. If you write one row at a time, you should not transpose and only write the header once.
0 Kudos
Message 6 of 12
(3,599 Views)

altenbach thanks for the help.  After a little modification I was able to get it working for my program.  Wouldn't have been able to do it without you.

0 Kudos
Message 7 of 12
(3,584 Views)

Some things still seem highly convoluted. Can you attach the actual VI?

0 Kudos
Message 8 of 12
(3,563 Views)
0 Kudos
Message 9 of 12
(3,559 Views)

Having these long array constants makes the code hard to maintain. For example if you would change the number of points later, you would need to make dozens of changes everywhere. I would use a FOR loop with two simple 1D arrays for the scaling (you could even use linear evaluation.

 

I think "index array" is easier to get the varioius rows.

 

Also note that your string array constant has two empty string elements at the end, giving you extra commas in the first line of the file. Make sure to remiove those. Resizing an array container does NOT change the array size!

 

 

0 Kudos
Message 10 of 12
(3,530 Views)