08-06-2013 10:11 AM - last edited on 08-09-2013 10:52 AM by JordanG
Hi all,
I'm having a weird issue with Labview, I guess it is related to my program, but I can't diagnose the problem.
Here is the situation. I have written a VI and a bunch of sub-VIs and they are all attached to this message. When I open the main VI (Super PB7100_Scan_1.2.4.1.vi), the front panel obviously opens up. If I close the VI without executing the program, Labview crashes (the Labview icon is still in the task bar, but no window opens up and I have to use the task manger to quit Labview). The same thing happens if I run the main VI. However, if I do the same thing with any of the sub-VIs or any other VI, that does not happen. I guess it is related to the main VI, but I'm not good enough at Labview to know what's wrong since the bug happens even if the VI is not run... Would that be an option of the VI that I have selected?
Also, I don't know if it is related, but when I run the program the first time after opening it, it is not fully working. Indeed, the acquired data are not saved into a file. If I run it a second time with the exact same settings, the data are saved.
I'm completely lost here because that does not really make sense to me. Any help is welcome.
Thanks
Solved! Go to Solution.
08-06-2013 10:45 AM
I do not see any crashes but I do not have the Report Generation Toolkit so the VI opens broken.
1. Your block diagram is way too big. The style guides recommend that panels and diagrams be no larger than one screen. You diagram is > 4 screens wide and 2 high on my 27" monitor. There have been reports of strange problems with very large diagrams and panels although I think yours may not quite reach the level where those things happen.
2. The use of sequence structures is discouraged. With a few minor exceptions they are almost never needed and they disrupt LabVIEW's dataflow paradigm. Learn about state machines and the Producer/Consumer architecture.
3. Avoid the use of local and global variables. With a few minor exceptions they are almost never needed and they disrupt LabVIEW's dataflow paradigm. They are prone to race conditions, make extra copies of data, and force execution in the UI thread (limiting performance). In LabVIEW the wire is the variable. Controls and indicators are the front panel user access points to the data. Local variables are links to controls, not to the data.
4. Avoid having wires run behind or overlap other objects. It makes it much more difficult to tell what the program is doing. Also flow should be left to right as much as possible.
This program is too large and much too difficult to follow the operation. I will not make any attempt to figure out why it works or does not work.
Lynn
08-06-2013 11:37 AM
I notice that, although LabVIEW's "Getting Started" window doesn't reappear when I close your main VI, LabVIEW hasn't really "crashed". If I reopen the VI from Windows Explorer, it pops right back up. This is, perhaps, a clue. Everything works as expected if you hit "Close All". I wonder what else is loading that doesn't unload with this VI.
08-06-2013 12:17 PM
It turns out that you have a few sub VIs set to run when opened, and they're loading with the main VI.
I switched off this option on both and things behave as I'd expect, except that I don't know why I can't get them to stop loading with the main VI.
08-06-2013 12:34 PM
Now I get it. You have the VI properties set to show the front panels when these sub VIs are loaded. Remove that from both of them and Bob is your uncle.
08-06-2013 12:58 PM
Thanks so much, I knew that was something stupid.
Thanks for your time and help!