Jump to content

Raymond

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Raymond

  1. So I found a couple of interesting things. First, I downloaded your VI and opened it up with LV2010 and could not reproduce the problem. Then I noticed your signature says LV8.5 - I don't have 8.5 loaded, so I opened it up in 8.6 and then the problem was just as you described. So, one fix would be to update to LV2010 :) But the crux of the problem seems to be the fact that the Write To Spreadsheet File VI opens and closes the target file on every write. When the File Dialog is open, the Open/Create/Replace file function seems to be blocking and can't open the data file on the read loop until the dialog closes. Take a look at the attached VI where I open the file outside the data loop and then append to it on every iteration and close the file when the loop exits. This is better practice. Best practice would be to separate the data read loop and the data write loop (see the producer/consumer template that ships w/LV). This creates a buffer so that the data taken gets stacked in a queue until the loop that writes to file can service it.

    Mark

    Thanks Mark, it works. I'll definitely try to apply this to my project.

    Another slight complication is that I need to create a new file for data logging at midnight every day. I suppose if I do not open the file dialog at midnight, I'll be fine?

  2. Of course there is! Use a recent LabVIEW version and of course don't use functions that are synchronized through the UI thread. That includes all VIs itself set to run in the UI thread but also just about every LabVIEW VI server function including Property Nodes and Methods.And everything else that will put up a UI screen such as a dialog or similar.

    Thanks for your reply, but I'm not sure if I understand what you suggest... Are you saying that I should change some settings in 'VI properties' for all sub-VIs?

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.