LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write measurement to file slows data presentation

thank you guys for your help!...It has all been really informative...definitely saving me a lot of search time.

So, i ran Mattew's edited version, but for some reason, it still runs at the same slow speed when I begin storage to the file.
Could it be due to the the invoke node that is still within the loop?

I've attached a newer, more reduced version of what I'm trying to do.



0 Kudos
Message 11 of 29
(2,430 Views)
Unfortunately, I cannot actually run your program since I do not have your hardware.  You never defined what you consider fast vs. slow.  The write to file unfortunately needs to wait for the sensor value to be there before it can write the file, so it will slow the loop down some, but we should be talking a couple of ms. max.  What is your CPU usage at with and without file saving turned on?

Another alternative is to run two parallel loops.  The collection loop saves the data, and the file logger grabs whatever data hasn't been saved yet and saves it.  This way, the file saving can take as long as it needs.  It catches up by saving multiple points at a time.  But, you shouldn't need that.  I expect that you are pegging out your CPU.
0 Kudos
Message 12 of 29
(2,427 Views)
i checked out my CPU usage, and i'm at about 85 w/o writing to file, and about 70 with writing to file (it's actually slower!), so it doesn't seem like I'm maxing out my system.

without writing to file, it seems to be running at ful speed (1000 Hz), and with file writing, it's around 100Hz.

Wish you had pidgets hardware! 

I'm gonna look around for tutorials on those parallel while-loops you mentioned.


0 Kudos
Message 13 of 29
(2,425 Views)
thank you for your help guys!...your information was definitely helpful.  I ended up sending the sampling out of the loop (with indexing) to an array, which I passed to a matrix for displaying, and to a file, via low level VIs.

thanks!
dave

0 Kudos
Message 14 of 29
(2,401 Views)
Hi Veritas

Can you share your vi's?
I'd like to check out your way of doing it

Thank you in advance
Van L
NI Applications Engineer
0 Kudos
Message 15 of 29
(2,391 Views)

Hello veritas,

 

Could you also post the VIs in an older version of LabVIEW (8.0 or earlier)? 

 

I'm having the same problem and I would also like to see how you went about it.

 

Thanks,

Joel 

 

 

Edit:  Whoops, sorry.  Didn't realize this is a very old thread.

Message Edited by j2park on 07-21-2009 05:34 PM
0 Kudos
Message 16 of 29
(2,212 Views)

Hi Joel,

 

What problems exactly are you having?  Slow responses when writing to a file?  If no one replies with a VI, I'd be happy to help if you give me some more details about your specific application. 

 

Cheers, 

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 17 of 29
(2,199 Views)

Hello, i don't have the code currently, and it will be a few weeks before i can access it again.  er....hopefully someone replies before then.

 

 

veritas 

0 Kudos
Message 18 of 29
(2,189 Views)

Hi Marti and veritas,

 

Thanks for the replies.  I am currently using LabVIEW 8.0 and Traditional DAQ to try and control a piezo actuator and read data from a load cell and the internal sensor of the piezo actuator (see attached VI).  I need to be able to write the data from the load cell and internal sensor to a file but when I use the Write to Measurement File Express VI (see attached picture), not only does the program run very slowly, but the actuator output gets completely screwed up.

 

From what I've read in the previous posts, it seems like using lower level VIs would fix the problem but I don't know how to go about using those.  Can you give me an example of how I would use low level VIs to write a 2D array to a file?

 

Thank you,

Joel   

0 Kudos
Message 19 of 29
(2,176 Views)

Hi Joel,

 

The fastest way to stream data to a file would be using a TDMS file with the lower level VI's.  There is an example of this in the Example Finder under Fundamentals>File I/O>Write TDM File.  The basic structure is the same as with the Data Acquisition (as is with many LabVIEW functions)--first open a reference, configure the task, perform the task, and then close the reference.  The only thing you would really do to modify this example is to place the Write Data within your while loop.  

 

Secondly, what do you mean by the output data gets screwed up?  Do you intend to write different data to file than you view on your graphs?

 

Go ahead and check out that example and post back with more questions. 

 

Cheers, 

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 20 of 29
(2,166 Views)