10-26-2017 08:12 AM
I have data that's being logged into 2 loops in separate xlsx files. I want to combined the data of these 2 files into one file with the colums next to each other. One file has the data from an GPS receiver with (longitude, latitude and altitude) and the other has the average power of an power sensor ? is there anyway to do this?
Solved! Go to Solution.
10-26-2017 08:10 AM
I have data that's being logged into 2 loops in separate xlsx files. I want to combined the data of these 2 files into one file with the colums next to each other. One file has the data from an GPS receiver with (longitude, latitude and altitude) and the other has the average power of an power sensor ? is there anyway to do this?
10-26-2017 09:14 AM
Hi,
Firstly, Your Diagram is very overloaded. You should learn more about dataflow paradigm in LabVIEW.
However to solve your problem you should use elements of Array palette (built array for example) and low level VIs of palette File I/O to resolve your problem.
let me know if you have others questions.
Kudos are welcome!
10-26-2017 11:23 AM
Why so many loops? Can you combine into a single loop and then you only have to write to the file in 1 place?
10-26-2017 02:30 PM
Hello the data is coming from 2 separate sensors, that why i need two separate loops
10-26-2017 02:37 PM
Hi shivik,
Hello the data is coming from 2 separate sensors, that why i need two separate loops
And what's the reason for this statement?
There might be reason, but surely not "there are 2 separate sensors"…
Hint: Ever heard of producer-consumer scheme?
10-27-2017 03:41 AM
Hi Shivik,
It would be best to use a produce consumer pattern to save all the data within 1 while loop.
http://www.ni.com/white-paper/3023/en/
Here you can format your data in 1 go.
NI also does not recommend the usage of the write to measurement file express vi in a loop as this will affect performance.
What you can do is look at TDMS files as they will give you a more scaleble approach. Use these with a normal file I/O chain to greatly reduce computer resource usage.
http://www.ni.com/white-paper/3727/en/
Kind regards,
Natan Biesmans
10-27-2017 11:38 AM
Hello thanks for your suggestions. But i think the producer/consumer scheme will not work. I have 2 sensors with prodcue data at differernt rates. one is a power sensors with (8Msamples/second) the other is a gps sensor with 1 sample per second.
I want to write the data of both sensors simultaneously to one file. with 3 coulms the GPS sensor data(longitude, latitude and altitude) and 1 column with the power sensor data(average power).
Since I won't use this data during ""storage process" , the producer/consumer look will be useful in this case
10-28-2017 05:29 AM
Hi shivik,
But i think the producer/consumer scheme will not work.
Why not?
I have 2 sensors with prodcue data at differernt rates. one is a power sensors with (8Msamples/second) the other is a gps sensor with 1 sample per second.
So you could read both sensor data in one loop, one with 8MS/s and the other with just 1S/s. What's the problem?
(I might still use two loops for those two sensors, writing the "fast" data in a queue and the "slow" one into a notifier…)
I want to write the data of both sensors simultaneously to one file. with 3 coulms the GPS sensor data(longitude, latitude and altitude) and 1 column with the power sensor data(average power).
So you want to average this power data down to 1S/s? Or do you want to resample the power data to something in the order of 10kS/s?
Anyway: keep the GPS data in a notifier to always read the latest sample. Combine it with your power data…
10-30-2017 04:37 AM
Hi Shivik,
I created a quick example that shows you how to use the producer consumer loops.
This is not the most optimal solution but will be enough to get you started.
Kind regards,
Natan Biesmans