09-09-2014 09:58 AM
Hi, I'm currently writing some code in Matlab and Labview and I'm stuck at a certain point. I'm using labview to aquire data from a test and create tdms files with the results inand at the same time I have Matlab scanning for the created files to read them into a matrix and doing some other processing. The problem is that if matlab tries to read the files when labview is writing them (as they are fairly large) then it will cause errors, I cant think of a way around this without somehow sending a variable between the two programs. I dont think I can use the mathscript node as the matlab is doing many other processes at the same time.
Currently to get around this error, when the matlab code detects a new file it waits for a while, I wish to know if there is a way to communicate between the two programs rather than waiting?
09-09-2014 10:07 AM
Another idea would be to create the TDMS files in a temporary location. I would recommend a defrag after the file is created. Then move the file to the location that Matlab is looking in. As long as the move is to and from the same disk, it is just an index change, so the move can be really fast. I would still suggest having Matlab wait a little bit to make sure that move is complete.