LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay when writing csv file to disk

Hello,

I have a Test stand that tests 6 valves at a time. It tests a valve in -40 seconds. When a valve passes, I create a serial number that contains the hour, minute and fixture number that valve was tested on. If it is the first valve tested in that minute I append a 1 to SN, if it was second valve I append a 2. A csv file is created that contains test data for that file, the name of the file includes the serial number. to create the file I create a path with the serial number that ends in 1. I then check if the CSV file exists. If it does I change the SN to end in 2 and create a new file. This works great until I run all 6 fixtures at high speed. My VI consists of 6 identical timed loops. Each runs a clone of the "Save data routine". I end up not creating files ending in 2. With all 6 running running a file is being generated ~ every 6 seconds. My guess is that file is cached until it can be written to disk. I am wondering if I force the cache to clear and write to disk, if that will work, or am I exposing myself to other problems. The system is in China and I will be going out there in a few days to correct. Any help would be great. I am attaching sub vi that makes the file.

 

Thanks in advance.

0 Kudos
Message 1 of 3
(2,856 Views)

two more files you may need.

Download All
0 Kudos
Message 2 of 3
(2,851 Views)

First off, the file i/o stuff is waayyyyyy too complicated. This was code clearly upgraded from a very old version of LV.

 

 

  • The Path Exists.vi operation should be simply a call to the function File/Directory Info. If the call returns an error, the file doesn't exist, if there is no error, the file does exist.

Capture1.PNG

  • Gut the contents of Write to csv file.vi except for the data formatting. Replace the file IO logic with a call to Write Text File.

Capture2.PNG

To tell the truth, I don't know if either of these things will specifically help, but losing all the superflous code couldn't hurt.

 

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 3 of 3
(2,840 Views)