05-19-2014 11:08 AM
Dear Sir/Madam
Currently, I am trying to write a 15 seconds of measurement into an excel file. The 15 seconds measurement is done by do-while function.
But unfortunately, after the 15 seconds measurement, not all the data can be written to the excel, only one reading was successfully written.
The Write to Measurement to File is outside the frame of do-while loop.
Could you please tell me how to solve this problem?
Many thanks for your help.
kind Regards
Ken
Solved! Go to Solution.
05-19-2014 11:16 AM
I am guessing you are just passing out the last value from your loop. Your two options are to put the file write function inside of your loop or build an array to be passed out of the loop to the file write.
05-19-2014 11:31 AM
HI Crossrulz
Many thanks for your reply.
Yes, I think you are right, only one set of value was recorded when it was placed outside the loop.
I also tried to put it inside the loop, I got about 50 samples recorded, which is equivalent to 0.25 seconds measurment as the sampling rate is 200Hz.
The measurement lasts 15 seconds, which should generate 3000 samples. So there is a big difference.
I haven't tried building an array yet. Could you please give a bit more info about it? Or an existing example online?
Many thanks
Best Regards
Ken
05-19-2014 11:35 AM
Right click the tunnel going out of the loop and select concatinating
05-19-2014 12:05 PM
Hi Jeff
Many thanks for your response
I am quite green in this at the moment. What tunnel do you mean please?
I am not 100% sure what you mean.
Your clarification would be much appreciated
Best Regards
Ken
05-19-2014 12:59 PM
ken84 wrote:What tunnel do you mean please?
The output tunnel that you have wired to your Write To Measurement File that is on your While loop.
Might I recommend some tutorials.
05-20-2014 02:58 AM
Thank you very much for the clarification. Much appreciated.
I right clicked the tunnel, then a menu appeared. But I can't find any option called concatinating. Please see the snapshot below.
Many thanks
Best Regards
Ken
05-20-2014 03:15 AM
Hi I found the tunnel mode you described earlier.
I chose the concatinating mode, but then the line broke. please see the snapshot below:
Could you please tell me how to solve this problem?
Many thanks
Best Regards
Ken
05-20-2014 03:40 AM
Hi,
The quickest solution will be to put the "write to measurement file" inside the while loop.
I set up a quick one as below (ie no changes to settings other than file format) and it logged all the data I acquired in my loop.
Regards,
05-20-2014 04:53 AM
Hi Ian Thank you very much or your response.
I have tried putting the Writing Measurement to File in the while loop, it only logged in 50 samples as I described earlier, not acquiring all the samples (3000), 15 seconds, at sampling rate 200Hz.
I just tried again with the same setting with you did, still the same, not all the samples in the 15 seconds have been acquired, but only the samples recorded in 0.25 second has been recorded.
How many samples have you got please?
Many thanks
Best Regards
Ken