LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

after quitting cpu runs at 100%

hi!

im using an external dll that runs a thread to get data and pass it to LabView. When i quit my LabView application, it usually - not always - does the following: Everything seems right, but the CPU starts running at 100%, and LabView must be restarted.

Im using Trace messages in my dll, and based on that it's pretty sure that the thread stops correctly.

Any idea?

Thanks! 

0 Kudos
Message 1 of 15
(3,111 Views)

Hi Wasz,

 

If your processor is running at full speed, there should be a process that's taking the CPU time. Can you go to the Task Manager, to define what process(es) is/are taking all your performance? This way you can identify the cause of this CPU load.

 

Best regards,

 

Peter S

0 Kudos
Message 2 of 15
(3,101 Views)
Sorry, i forgot to write that of course it is LabView that eats up CPU after closing my VI.
0 Kudos
Message 3 of 15
(3,096 Views)

Hi Wasz,

 

Is the LabVIEW process taking the CPU Power for an infinite time period, or just for a long time (like a few minutes)?

 

I sometimes have the experience that LabVIEW takes a while to shutdown on my computer (this is when I'm closing LabVIEW completely). Are you just closing the appilcation down, or do you close the LabVIEW program after which you get this CPU load?

 

What kind of processor does your computer have? Is it a multi core or single core processor?

 

Best regards,

 

Peter S.

0 Kudos
Message 4 of 15
(3,090 Views)

I just stop my vi. And if i run it again, it works fine, but after stopping, the LabView process eats cpu again.

I have a dual core (so 100% is 50%), but i dont think thats the problem. 

I guess my dll might be wrong and the problem is with thread handling.

0 Kudos
Message 5 of 15
(3,085 Views)

If LabVIEW is running a VI, it uses several threads to process it. Windows will assign these threads to the available processor cores. This way you can stress the complete multicore processor to 100%.

 

If LabVIEW is in the programming mode (if it is not running VI's), it uses only 1 (one) thread. One thread can only be assigned to a single core.

 

You are saying it takes 50% of the total processor capacity, and 100% of one core. This indicates that not the program you wrote, but the LabVIEW Environment is causing the CPU stress.

 

If you have this single core is stressed at 100%, are you than able to use LabVIEW, or is LabVIEW not reacting at that moment?

 

How long does this CPU stress period take? Seconds, minutes, hours?

 

How "big" is the VI? Does it use large amounts of data?

 

Thanks for the answers!

 

Best regards,

 

Peter S.

0 Kudos
Message 6 of 15
(3,073 Views)

" If you have this single core is stressed at 100%, are you than able to use LabVIEW, or is LabVIEW not reacting at that moment?"

No, it is reacting, and I can restart my vi without any problem, and the vi works fine too. 

 

"How long does this CPU stress period take? Seconds, minutes, hours?"

  I havent tried for hours, but it seems to be a constant stress, minutes for sure.

 

"How "big" is the VI? Does it use large amounts of data?"

  it is a quite big vi with many sub vis, processing data acquired from CAN bus. My dll passes data to it using PostLVUserEvent.

 

Thank YOU! 

0 Kudos
Message 7 of 15
(3,068 Views)

That's quite strange. That should mean that there is a single thread keeping the high processor requirements.

 

 You said you have this problem quite often, but not all the time you run the VI. Does it also happens with other VI's? If not, maybe you can use the diagram disable structure to disable some code in your VI. That way you can test where the CPU Load comes from.

 

You can find the diagram disable structure in your structures palette.

 

I hope you can isolate the problem that way.

 

Best regards,

 

Peter S.

0 Kudos
Message 8 of 15
(3,049 Views)

well, that would be a lot of work, but ill try. Anyway, the application will be compiled to an exe, so the problem will not be a problem.

Thanks anyway. 

0 Kudos
Message 9 of 15
(3,044 Views)

Well, it keeps being a problem if it is your VI (or a thread associated with it) that keeps running at 100% load.

So it is possibly mandatory to dig into the code and find the area which controls the blocking thread. It could be helpful if you post your main VI of the application. 

 

As far as i understand it, the current problem looks like this:

1) Open LabVIEW developement system

2) Open the project

3) Run the project

4) Quit the execution using the QUIT button on your user interface

5) Close the whole project

6) Reopen project

7) Rerun project

😎 Quit and close project

9) Quit LabVIEW developement system 

Step 1)-3) work correctly in proper timing/CPU load. Starting from step 4) you see 100% CPU load till including step 6). Step 😎 again creates 100% load. Step 9) leaves the LabVIEW.exe process still active in task manager, but all windows are closed.

 

Is that correct? If not, please mark the differences.

 

What happens with blank VIs (Open LV, create empty VI, run it, close it, close LV)?

If a blank VI is working as expected, what happens if you just use a dummy VI accessing your DLL?

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 15
(3,025 Views)