10-31-2006 03:22 PM
10-31-2006 03:50 PM
10-31-2006 06:47 PM
I would really appreciate some clarification on this one because I feel like I'm not understanding exactly what you're saying. The way that I have designed the program is so that the two subVIs interact with the two instruments, respectively, that need to be "set up" for the experiment. In order to do that, they both need to be able to be open at the same time (this is why there are 2 parallel 'while loops' in mainVI. I could also put subVI1 in another while loop like subVI2, but I actually don't really like using references very much, b/c it breaks the dataflow model.... so instead, I just put one of the two in a separate loop. Among other things (in the event structure) the subVI2 then generates a "sweep array" which is used in the final data collection in conjunction with the information that is returned from subVI1 (which is a cluster of scope controls).
I think some simple changes in architecture will help. Typically the event structure is in the main VI rather than in a subVI where it might cause exactly the problem you are experiencing. When an event occurs pass a message to the subVI via a queue. "Stop" would be one of the messages, of course. Depending upon when subVI 1 needs to run, it might be better off in another independent loop with a queue for control messages or perhaps it could run in the timeout case of the event structure.
good point. style is important because this code may need to be modified by someone else in my lab in the future, so I'll fix that.
Very minor point, but may make a difference when your program gets big and complicated. Try to use left to right wiring for the dataflow. It makes programs much easier to read (and therefore, to debug).