LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can multiple Write to Spreadsheet VIs cause one change to be overwritten?

Solved!
Go to solution

In my program right now I'm running two parallel loops, both of which have a Write to Spreadsheet VI writing to the same file path.  I don't really care which order the lines are added to the spreadsheet, as the data from the two different loops can be differentiated, but what I am wondering is whether it is possible for the two VIs to run simultaneously and have one change overwrite the other so there would be a missing line in the final result.  I've seen that this is a risk for writing to local variables in parallel loops, but haven't seen anything either way specifically for writing to an exterior file.

 

Thanks for your help.

0 Kudos
Message 1 of 2
(2,323 Views)
Solution
Accepted by topic author RNLK

The Write to Spreadsheet File is non-reentrant, so only one instance of it can run at a time.  As long as you are always concatinating, I wouldn't expect any loss of data.

 

However, a better solution would be to have another loop to handle your File IO.  Then you can open the file and keep it open.  You send data to be written using a queue.  And remember to close the file on exit.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(2,317 Views)