LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does write datalog sometimes take up to 20 seconds to complete?

I have been using this vi for a number of years with no problem. I recently upgraded to LV 2013 and added some functions to the code but haven't changed the write datalog function.

 

Basically when I make a change to a front panel object I want to save the settings so I write it to a datalog file as in the ChangeCrop.png file. I have been doing this since LV 2010 with no issues. After upgrading to LV 2013 and adding some functions unrelated to the write datalog, occasionally now during the write process things come to a grinding halt for up to 20 seconds.

 

Using probes I narrowed it down to the Open/Create/Replace Datalog.vi in the datalogDiagram.png file. Watching the time stamp on the probes I found the 20 seconds between the path creation and the completion of the Open....Datalog.vi

 

Any ideas?

 

Alan

Download All
0 Kudos
Message 1 of 13
(2,527 Views)

I can't see what would cause your specific problem, but you should probibly change all the places you use the "metronome" wait function to the other one. They both will wait the same amount of time, but the metronome version creates a defacto synchronization between different parts of the application that shouldn't be synchronized.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 13
(2,504 Views)

Your code is faulty.

 

(I assume that the datalog writing code is the VI in the upper right corner of the code shown.)

 

You are writing the same array (Channel settings) N times with a 100ms wait, it is suffcient to write the array once, so get rid of that while loop.

 

Where does "Number of acquisitions" get it's value? What is its default value?

0 Kudos
Message 3 of 13
(2,480 Views)

altenbach

 

Your assumption is corrct but the code is not faulty. The default value is 1 so the loop runs once in this instance. This write datalog file vi has been around for years and has beed adapted for this application. I believe the original developer of this vi had put the loop in to write large amounts of data into the file and had to segment the ata into smaller blocks.

 

Getting rid of the while loop doesn't slove the problem. I tried.

 

Alan

0 Kudos
Message 4 of 13
(2,460 Views)

How big is the actual data? Could it be that the array grows without bounds in the main VI, for example? Place a "flatten to string" in the main code, wire to the array of clusters and display the resulting string lenght over time. Anything interesting?

 

(your explanation makes not much sense for the current code, because there is nothing  to segment the data)

0 Kudos
Message 5 of 13
(2,456 Views)

The data I'm storing is a 2d array of a cluster of mixed types of front panel data. When a front panel control changes state or value the old value gets deleated from the data string and the new inserted. (replace array subset).

 

I don't think data size is the problem in this case. As I mentioned in the begining I used a probe in the write datalog vi and it hung at the Open/Create/Replace Datalog.vi. I marked it on this attachment.

 

I'm not the best at explaining with words. That's why I like Labview. Smiley LOL

0 Kudos
Message 6 of 13
(2,447 Views)

Just out of shear curiosity.  What impact if any do you see if you change the Open Create replace operation from "Create or replace" to Open or create and insert a "Set Number of records" with a 0.  (Esentially doing the same thing but, splitting hairs at what might be the cause of the delay)


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 13
(2,426 Views)

Jeff

 

I'm not sure what you mean by "insert a Set Number of records"

 

0 Kudos
Message 8 of 13
(2,411 Views)

Jeff

 

I figured out what you were saying and gave it a try but it didn't solve the problem.

 

The frustrating part of this is its totally random. Sometimes it happens the first time I change somethig and others tims it take a lot of changing of parameters on the front panel before it hangs. This is the last bug on this version of the code before I release it.

0 Kudos
Message 9 of 13
(2,401 Views)

Also check your power management settings. is it possible that the HD goes to sleep and needs to spin up?

Is the HD very full and/or highly fragmented?

0 Kudos
Message 10 of 13
(2,388 Views)