12-17-2011 02:00 PM
I was wondering if there is a way to automatically run a VI after you click on "OK" to load a file from the file path control as opposed to selecting file and then manually clicking run each time on the front panel toolbar. I attached the simplified VI and txt file to be plotted for clarity.
12-17-2011 08:50 PM
Well, you cannot do exactly what you asked, but you can make it work the same way for the end user.
Set the VI to run when opened. Put everything inside an event case which is set to monitor the value changed event for the Path control.
If you want to be able to read more than one file each time you run the program, you need to put the event case inside a while loop. Create a Stop button on the front panel and add an event case for the Stop Value changed event to stop the loop.
Lynn
12-18-2011 12:51 AM
So I tried what you suggested and I believe it's working like you said it would. For situations where you would select multiple files, I put the event structure inside the while loop. One thing I noticed is if you select a file and the VI runs and then select the same file again...a error pops up in the "Read from Measurement File" object. Is there a way to ignore this error? It works fine if you select a different file otherwise.
12-18-2011 02:23 AM
12-18-2011 02:24 PM
It generates error 4, EOF encountered. The Express Read from Measurement File VI apparently remembers the last file read and attempts to read more data from that file. A True connected to the Reset input will make it read the file from the beginning.
Read the help.
Add an event case for Stop as both altenbach and I recommended.
Lynn