LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Project update from Labview 6.02 to 7.0 caused cpu usage 100%. Anybody experienced this and how you fixed it? Thanks.

I had an application written in Labview 6.02 without cpu usage problems. I updated it to in Labview 7.0. When I ran either source code or the .exe file, it all caused cpu usage to 100%. I tested the file in a slow PC and fast PC, it got the same results, anybody experinced this and how you fixed it? thanks.
0 Kudos
Message 1 of 12
(3,622 Views)
I have not seen that myself but I can pass along some ideas.

In LV 7 there is now the option to designate on a VI by VI basis, the "release memory as soon as possible". If this is turned on for a VI that uses large amounts of memory and called repeatedly, this could cause issues.

Another more likely candidate was mentioned in the release notes. The "defer front panel updates" will now update the FP once when set true, and again when set false. This could lead to double the number of screen updates!

Otherwise;
The 100% symptom is generally a sysmptom with many possible causes. Try using the profiler to narrow down the possible culprits.

Post code if you want some to look and advise.

Trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 12
(3,622 Views)
Hello Yurong,

Thank you for contacting National Instruments.

There is no known CPU usage problem when updating from LabVIEW 6.02 to 7.0. Try reading the following knowledge base concerning CPU usage.

http://digital.ni.com/public.nsf/websearch/8638139D6236D42086256A340073554A?OpenDocument

If this does not solve your problem, try to isolate the portion of your code which is causing the 100% usage. Run your VI in highlight execution mode and monitor the CPU Usage.

If you cannot isolate the problem, post your code and I will be glad to take a look at it.

I hope this helps,

Sean C.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 12
(3,622 Views)
Hi Sean,

DI you really mean to say
"Run your VI in highlight execution mode and monitor the CPU Usage.
"

?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 12
(3,622 Views)
Ben wrote in message news:<506500000005000000375B0100-1075935269000@exchange.ni.com>...
> Hi Sean,
>
> DI you really mean to say
> "Run your VI in highlight execution mode and monitor the CPU Usage.
> "
>
> ?
>
> Ben


Another cause for 100% CPU usage is pressing your ALT Key once.

Try this. Activate the Windows Task manager so you can see the
processor usage then make your version 7.0 application the active
window.

Press the ALT Key down and release it.

This will cause the processor to go to 100% and stay there. Press the
key again and your processor will return to normal speed.

Holding the Shift key or the CTRL key down will drive up the processor
speed also. Releasing these keys will allow the processor to return to

normal speed.

This also happens if you just have your development version of LabVIEW
7 open with no projects open.

Randall
0 Kudos
Message 5 of 12
(3,622 Views)
Hi Ben,

You are correct... Running the VI in highlight execution mode will
drive up CPU usage and make it more difficult to see how the VI is
performing.

Another way to isolate this issue is to "comment out" portions of your
code. Do this by surrounding sections of your block diagram in case
structures. You can then "comment out" one section at a time by
wiring a false constant to the case structure. For each section you
"comment out," monitor the CPU Usage. When you find the problem
section, "comment out" smaller portions to further isolate the
problem.

I hope this helps,

Sean C.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 12
(3,622 Views)
Thanks for Ben and Sean to help me solve the CPU problems. I tried
different ways. The symptom still exists. It was intermettent.
Occationally it might work fine.

I have the labview HMI as OPC client talking to Think&Do OPC server. I
have a main screen,which has a few buttons to lead to other screens
such as setup screen, control screen, maintenance screen. If I run the
main screen after the first time I load the program in, the setup
screen was able to run without a CPU problem, so was the maintenance
screen. Once I went to the control screen, the CPU went to 100%,
sometimes, it did not do it. Once the CPU was 100%, even I exit the
control screen, the CPU usage was still 100%, even I stopped the main
screen, and restart the main screen
again, the CPU would stay 100%.

I was skeptical about the memory alocation because sometimes it went
fine.

I will try to "comment out" the code to debug the program. Thanks.
Kimberly
0 Kudos
Message 7 of 12
(3,622 Views)
I found out the following behavor when I ran my application.

If I configure the vi with the window title bar, it seemed like
pressing alt key once when I opened the vi to run. Which sometimes
drove cpu to 100%. Also, the dialog box vis sometimes tigger the CPU
to 100%. These vis all have window title bars. Once the cpu is 100%, I
could press alt key once to reduce the cpu to normal usage.

My concern is why the alt key is able to reduce the cpu usage. Does
Anybody know why the title bar might have something to do with the alt
key?

Thanks,

Kimberly
0 Kudos
Message 8 of 12
(3,622 Views)
Kimberley,

This is a known bug in LabVIEW 7.0. When a VI is running and the Alt
key is pressed once, the cpu will go to 100% until the Alt key is
pressed again. This is because the cpu is constantly polling the
menu, waiting for an input. This problem should be fixed in the next
version of LabVIEW.

In the mean time, you can work around this problem. If your VI, when
opened, seems to have the Alt pressed, simulate an Alt keystroke with
a Call Library Function Node to cancel it out. You do this by
dropping a Call Library Function Node and double clicking it to
configure. Select the user32.dll from C:\WINDOWS\System32. Then
choose keybd_event from the function name pull down menu. Wire the
node as shown in
the screen shot.

Make sure the offending window is in front when the Call Library
Function Node is executed.

Let me know if this does not help.

Sean C.
Applications Engineer
National Instruments
0 Kudos
Message 9 of 12
(3,622 Views)
> If I configure the vi with the window title bar, it seemed like
> pressing alt key once when I opened the vi to run. Which sometimes
> drove cpu to 100%. Also, the dialog box vis sometimes tigger the CPU
> to 100%. These vis all have window title bars. Once the cpu is 100%, I
> could press alt key once to reduce the cpu to normal usage.
>
> My concern is why the alt key is able to reduce the cpu usage. Does
> Anybody know why the title bar might have something to do with the alt
> key?
>

I don't remember the details, but the Alt key is tightly tied to
numerous behaviors on Windows. Either LV has started the menu walking
behavior and the events are pouring in, or I seem to remember some other
Alt key modifi
ed actions defined by Windows, sort of like Alt-tab, but
affecting the apps, not the windows. Anyway, the Alt 6 or whatever the
combo was, was fixed several releases ago. The Alt key thing I don't
have details.

Greg McKaskle
0 Kudos
Message 10 of 12
(3,622 Views)