08-03-2016 04:17 PM
The snippet looks like good start. I meant to do everything in the same while loop though. (Sorry) I didn't know how versed you were in LabVIEW. You also need to wire your file(use dialog 2) control into the read statement. so function has a reference of where to get its info from.
You have the shift register set as a blank path, so the first time you change the file path (or if its set to anything but blank when the program starts), it will see a mismatch, go into the "if box" and go to the new file path (the one in the control) and do it again every time you change the file. Seems like it would work. If you post your vi in 2011 I can show you what I mean.
Another thought: when you change files, you'll probably want to clear the graph. Just make a property node of the graph, select chart history. then [[create- constant]] to set the history blank. otherwise you'll keep appending the history every time you change a file.
BE WARNED. you'll be scanning or "polling" the front panel constantly with this method. Not just the control, but the stop button and any button. for funzies, check your system resources and see how much processor power the computer uses when its running versus stopped.
Review event based here if you are curious.
http://www.ni.com/white-paper/3331/en/
we had older programs that used 60% processing power, I remade them and added A BUNCH of doo dads to them and they still only use 5-6% while running!
Hope I stopped confusion instead of adding to it !
08-04-2016 10:41 AM
On further thought ,this looks like a solid answer, use state machine to eliminate the difficulty. Will plan to mark as solved when I get it to work!
JEB
08-04-2016 12:03 PM
State machines do a good job. In my opinion, the event based makes it work more like a windows program, which means the user (in my case several people) can navigate it a bit better.
Good luck!
08-04-2016 02:25 PM
This is a good, direct answer to my question, very helpful. But I'm thinking I should take stronger medicine and look into a state machine approach!
thanx
JEB
08-04-2016 02:32 PM