LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Built Application sometimes does not respond when closed.

I built an application that mainly does text based operations. I am using a dynamic event structure of the professional version of LabView 7.0. My timeout is set to 100ms. Most of the time everything works fine when closing the application. However, sometimes the after closing the application by either the x in the top right hand corner or by closing it by a button, the main window closes but the program goes into a nonresponsive state that causes the CPU usage to go to 100% until the application is "killed" manually through the task manager. It should be noted that there are two different labview entities visible in the windows taskbar when my application is running. When the problem occurs, only one of them
is closed.

Tim, Van
0 Kudos
Message 1 of 9
(4,084 Views)
Why are there two instances of labview running? You need to find out why this is happening. Does the same happen in the development environment? Look under the Processes tab of the task manager. What are the labview processes called? Are there two runtime versions running (lvrt)? It seems strange to have two instances running at the same time.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 9
(4,084 Views)
I wouldn't say that two instances of labview are running. It is merely two entities in the taskbar. Both are named the same( name of my program). However only one will minimize the application window when pressed.

I build a simple application (loop with stop button) from a vi which i named 'test'. The .exe file was left as 'application'. When the built application is started i get one 'field' in the taskbar that is named 'application' and one called 'test'. When the vi is run in the developement environment i have the 'labview' and the 'test' field in the taskbar. When the original application is running i don't have any other ni-related processes present than my application and niSvLoc.exe.

Maybe i should also mention that I am using the vi 'Exit
LabView' that is called when the user closes the application.
After further testing I found out that problem usually occurs after the program has been running for a longer time, i.e. several minutes(30 or so).
Any further clue?
0 Kudos
Message 3 of 9
(4,084 Views)
I tried it out again. It also happens in the development environment and it only happens when I leave the application running for a long time. I left it running for ca 1h and then it did not respond when closed. Any idea?
0 Kudos
Message 4 of 9
(4,084 Views)
Sorry, I don't have a clue. Maybe you could eliminate part of your code then try it again, and keep on doing this until you find what is causig the problem.
- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 9
(4,084 Views)
hi tim

you said that it's becoming worse after long execution times. i've seen something very similar (long time till end and 100% CPU usage after closing the app) on an app that caused memory leakage (observe the memory usage in the task manager). in my case i forgot to close a reference which i opened in each cycle of the loop.

do you catch the "panel close?" event when closing via the cross at the right top of your window?

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 6 of 9
(4,084 Views)
thanks for your reply,

i guess i am having the same problem you just described. But, what kind of reference should i look for? - vi- reference, reference to an object? and what should I put into the panel close case?
0 Kudos
Message 7 of 9
(4,084 Views)
hi

first of all: if possible create references only once at start and use the same reference during the whole runtime of your app. always close references in reversed order than they have been created. you should look for all references you obtained by properties of other objects, like "controls[]", "decorations[]" etc. you have to close ALL these references, even those unused by your app (i forgot to close the references obtained by "controls[]" from a clusters reference). Search for this topic in this forum or in the online documentation.

when closing the panel without catching the "Panel close?" event the loop is just interrupted without a chance to execute any code behind the loop (like clearing stuff, closing references and so on...).


good luck
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 8 of 9
(4,084 Views)
I tried it out, i.e. close all vi references( there were a lot of them not being closed) after opening them and it seems to work now! Thank you so much! 😉

Tim, Van
0 Kudos
Message 9 of 9
(4,084 Views)