02-12-2014 09:48 AM - edited 02-12-2014 09:54 AM
I have a batch file (epoc.bat)
I use Labview to call this batch file. The batch file will run a task on windows command prompt and it will print out my hardware sensor value continuously (at the frequency of 128Hz) into a text file on disk. Please note that the batch file creates the empty text file by itself and then writes values onto that text file.
The problem is that the batch file needs a short period of time to initialize the hardware (about a hundred of miliseconds) before it prints the first sensor value. My work is to determine when the first sample is printed, in order to run my events right after the first sensor value is printed.
I put my question in the VI file attached. Also this below picture describes it clearly. I put all the events in the right order in a flat sequence.
How can I determine when the first sample is printed. I think there are 2 steps: first checking whether if the text file is available and then checking the file size?. How can I do this job. Afterwards and more importantly, how can I construct a condition to execute the next frame?
Solved! Go to Solution.
02-12-2014 10:08 AM
You wrote : "as long as the batch file is running, there is no way to open the text file with LV"
It does not work by using "read-only" option for opening your text file ? I suggest you try.
02-12-2014 10:22 AM
Otherwise you can such a solution to check file size (before reading its content for example) :
02-12-2014 10:28 AM
This technique works...I have just tested it...