LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PC keeps locking up

I have been working on a Labview program for quite some time now and worryingly the software has developed an error. When saving the PC just locks, fails to save the program at all, and does not allow me to perform ANY functions within the labview environment (even closing the program). I have to hit CTRL ALT DEL to get control and the PC reports 100% CPU Usage. This as I am sure you appriciate is a BIG problem. There is nothing I have done in the last day (when it started) that I havn't been doing for the past few months. The main V.I. is very big at approx. 10MB and contains loads of locaL nodes, is there any reasons this could be occuring ?
0 Kudos
Message 1 of 4
(2,931 Views)
> I have been working on a Labview program for quite some time now and
> worryingly the software has developed an error. When saving the PC
> just locks, fails to save the program at all, and does not allow me to
> perform ANY functions within the labview environment (even closing the
> program). I have to hit CTRL ALT DEL to get control and the PC reports
> 100% CPU Usage. This as I am sure you appriciate is a BIG problem.
> There is nothing I have done in the last day (when it started) that I
> havn't been doing for the past few months. The main V.I. is very big
> at approx. 10MB and contains loads of locaL nodes, is there any
> reasons this could be occuring ?

Wow. A ten megabyte VI in one day. Please don't take this the wrong
way, but I suspect that your diagram is full of copied code -- Copied
code with lots of local variables that reads somewhat like C code, then
placed into a bunch of sequences that act like lines in a function.

Assuming that this description fits, you should really spend about an
hour opening and looking at a few example programs. Then open your
diagram, or start from scratch, and make sure that you build subVIs and
use wires. LV is a dataflow language, and if you use local variables
for anything other than to write to a control or to stop parallel loops,
then you are going to wind up wishing you were using another tool.

It sounds like you can still open your VI. If the code in it is useful,
go to one of the sequences that contains code that you need to reuse.
Select the code with a combination of selection rectangles and shift
clicks, then under the edit menu is an item for making a subVI from
selection. This isn't the best way to make a subVI, and you shouldn't
be putting locals into the selection. The goal is to make a building
block that you can reuse, like the Add node. You will then drop that
building block and wire data in and out whenever you want to reuse it.

As I said, the examples should help a bit. I'd recommend the Analysis,
measure, dyamic signal analyser for something nontrivial. On its
diagram, use the help window to see what the blocks do. Double click
ont he nodes to open them and see their panel and diagram that is
available for reuse.

As for the large VI that you have already built. It shouldn't be
crashing, and in fact, you might just want to give it some time. 10MB
is alot of diagram, and it might just take a few minutes to save. You
also don't mention which version of LV you are using. You might want to
try to update it if there are any bug fix patches available.

If you have questions about how to do things without using gobs of
locals after looking at the examples, please post questions.

Greg McKaskle
0 Kudos
Message 2 of 4
(2,931 Views)
Morning Greg, thanks for the answer but I'm sorry to say even I am not capable of writing a 10 MB VI in ONE day. It is a culmination of about six months work. There are over seventy sub VI's and the front pannel VI contains well over 350K's worth of front pannel objects. The Vi was originaly quite small but as a programmer yourself I am sure you appreciate the phrase "moving of goalposts". Anyway, I have managed to loose some local variables in the background of the VI and this has freed enough space to enable the program to save as required. Unfortunatly the front end VI has a lot of safety constraints attatched to it as I am pumping variouse gases round a test rig. There is also a lot of Arrays to Spreadsheet strings etc etc. Anyway it's working no
w.
I spoke to the guys at NI about this saving problem and they told me that Labview sets aside a certain amount of memory for saving data, it then does some sort of check prior to saving to see how big the file to save actually is. A file over this "allowed" size can tip the scale and fail to save correctly. I was just getting a large White arrow and no control of LV at all.
The problem I have had is that LV is only used by one person in my company (me) and as people see what it can do, they want more and more and more. Therefore VI's grow and grow and grow and crash !
I would certainly go along with your sudgestion regarding the use of Local Variables, it is certainly best to keep them to an absolute minimum. Another good idea is to use the Property Node and set it to write to update value, I am reliably told this uses less memory space than a local node.
Anyway, we got there in the end. Thanks again for your time.
0 Kudos
Message 3 of 4
(2,931 Views)
> The problem I have had is that LV is only used by one person in my
> company (me) and as people see what it can do, they want more and more
> and more. Therefore VI's grow and grow and grow and crash !
> I would certainly go along with your sudgestion regarding the use of
> Local Variables, it is certainly best to keep them to an absolute
> minimum. Another good idea is to use the Property Node and set it to
> write to update value, I am reliably told this uses less memory space
> than a local node.

I'm glad that you were able to get it working again. Just a few
clarifications though. Using value property on a property node and the
local variable are really very similar. In fact, the value property
often has more runtime overhead as i
t doesn't have as many optimizations
in it yet. Both of these, if static, will have a copy of the data at
the terminal where the data is written/read. This data copy may be
shared with other parts of the diagram, but anyway, just swapping locals
for value properties isn't really a good idea either. If you do have
lots of values to update that are the same type, then using control
references and a single property node in a loop will cut down on diagram
size and space and memory usage at runtime. You can also push those
loops or property nodes into subVIs.

Greg McKaskle
0 Kudos
Message 4 of 4
(2,931 Views)