10-02-2014 07:13 PM
Hello,
I have attached a simplified VI that saves data after taking measurements from my measurment instrument. Each iteration in the while loop represents a measurement. The data is currently saved in just two columns. Can you assist me in saving the data after each while loop iteration in different columns.
For the attached VI, I would like to get the data spread over 8 columns:
x0data y0data x1data y1data x2data y2data x3data y3data
Thanks,
hiNi
Solved! Go to Solution.
10-02-2014 08:03 PM
You won't be able to save your data in your inner loop. Instead, you need to build the array using autoindexing tunnels. Do the same for the While loop and then save the data after the while loop.
10-03-2014 01:48 AM
Easiest is gathering the data and writing it all at once, as mentioned. I made a change to your VI doing that. You might need a Transpose array or 2 to get the look you want. 🙂
/Y
10-03-2014 09:53 AM
OK, I have managed to manulipate the data and get it in a text format using the sugestion of indexing the interations out of the while loop. How do I go about now getting each iteration in seperate columns?
Thanks,
hiNi
10-03-2014 01:48 PM - edited 10-03-2014 02:08 PM
How many times do yuo want to format the data into a spreadsheet string?
The trick to remember is arrays are Row, Col
10-03-2014 02:16 PM
Hello,
It will be variable as the number of iterations in the while loop dictates the number of measurements taken. The example VI provided just give a sample where 4 sets of data is taken. There may be instances where I will only read two sets of data for example (i.e the while loop only runs twice).
Another way to look at this, if we do a search for "x", can we then split the data up and create another group of x-y data in the adjacent columns to the first x-y data now as I have modified the format of the data set?
Thanks for your time and help.
hiNi.
10-03-2014 02:20 PM
@hiNI wrote:
Hello,
It will be variable as the number of iterations in the while loop dictates the number of measurements taken. The example VI provided just give a sample where 4 sets of data is taken. There may be instances where I will only read two sets of data for example (i.e the while loop only runs twice).
Another way to look at this, if we do a search for "x", can we then split the data up and create another group of x-y data in the adjacent columns to the first x-y data now as I have modified the format of the data set?
Thanks for your time and help.
hiNi.
it scales for that I had anticipated that 3 constant would become a control
10-03-2014 03:16 PM
Hello,
THANK YOU Jeff for your help and time. I am not quite there yet though. The image below represents exactly how I wanted to data to be saved. I am still getting stuck on saving the data like that below.
Any help will be greatly appreciated.
Thanks,
hiNi.
10-03-2014 03:33 PM
just put a transpose 2 d array between the while loop and array to spreadsheet string