LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a problem with writing measurement to excel after 15s do-while data acquisition

Solved!
Go to solution

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

0 Kudos
Message 1 of 17
(3,123 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 17
(3,116 Views)

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

0 Kudos
Message 3 of 17
(3,108 Views)

Right click the tunnel going out of the loop and  select concatinating


"Should be" isn't "Is" -Jay
Message 4 of 17
(3,104 Views)

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

0 Kudos
Message 5 of 17
(3,095 Views)

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.

LabVIEW Basics
LabVIEW 101


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 17
(3,086 Views)

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

menu after right clicking the tunnel.png

 

 

0 Kudos
Message 7 of 17
(3,062 Views)

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

broken tunnel.png

0 Kudos
Message 8 of 17
(3,059 Views)

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.

Capture.PNG

 

Regards,

Ian S
Applications Engineer CLA
National Instruments UK&Ireland
0 Kudos
Message 9 of 17
(3,054 Views)

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

 

 

0 Kudos
Message 10 of 17
(3,041 Views)