LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic LabVIEW question - getting new data into a while loop

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 !

Message 11 of 15
(1,376 Views)

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

0 Kudos
Message 12 of 15
(1,356 Views)

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!

0 Kudos
Message 13 of 15
(1,343 Views)

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

0 Kudos
Message 14 of 15
(1,330 Views)
If you checked my previous post using design pattern template of producer consumer it uses event structure.
Thanks
uday
0 Kudos
Message 15 of 15
(1,328 Views)