LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 file writes in parallel

Solved!
Go to solution

LV 8.5. A workflow question (what else?)

 

I have in a few vi's 2 file writes in a single event case. I typically do the folloing:

1) use file dialog to name the file and location

2) use 'write spreadsheet' to save data

3) simultaneously, I strip the .csv from the path and add .txt

4) use this new path to save my test notes file with the same base name.

 

Since these 2 file writes essentially exist in the same event case, is there a danger of them trying to execute simultaneously? Should I use a flat sequence to prevent any conflicts or will this always (through Windows or something) write one file at a time? I have never had trouble with this but I like to cover my bases and not cause what I like to call a 'weird condition' that could be unpredictable.

Labview 8.5
Meas Studio 2008
0 Kudos
Message 1 of 4
(1,453 Views)
Solution
Accepted by topic author walter-donovan

It should be just fine.  Since you are opening up two different files at the same time (one with a .csv extension, the other with a .txt) LabVIEW can handle writing to them at the same time.

0 Kudos
Message 2 of 4
(1,451 Views)

First, if you do not make the file writes "sequential", but leave them to operate "in parallel", they will probably run faster, and are almost certain to not have any problems.  Indeed, if you have a lot of file writing to do, arranging them to occur "simultaneously" (by not sequencing them) can greatly enhance throughput.

 

Second, if you really want to have writes take place sequentially, do not put them in a sequence structure.  Instead, connect them via the error line, putting the second write after the first.

0 Kudos
Message 3 of 4
(1,450 Views)

Thanks guys. Actually the error nodes were my contingency plan but oddly the 'write to spreadsheet file' function does not use them. There is some output node dealing with path. I didn't study it but perhaps it would have something that could drive the 'write text file' function input.

Labview 8.5
Meas Studio 2008
0 Kudos
Message 4 of 4
(1,433 Views)