07-13-2015 09:43 AM - edited 07-13-2015 09:49 AM
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.
Solved! Go to Solution.
07-13-2015 09:58 AM - edited 07-13-2015 09:58 AM
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)
07-13-2015 10:07 AM
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?
07-13-2015 10:39 AM - edited 07-13-2015 10:39 AM
07-13-2015 10:59 AM
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?
07-13-2015 11:04 AM
07-13-2015 11:28 AM
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.
07-13-2015 11:38 AM
Some things still seem highly convoluted. Can you attach the actual VI?
07-13-2015 11:49 AM
Here is the VI.
07-13-2015 12:18 PM - edited 07-13-2015 12:20 PM
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!