07-05-2013 01:30 PM
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.
Solved! Go to Solution.
07-05-2013 01:37 PM
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.