LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application pauses for up to 4 seconds at random places in processing loop.

What exactly are you doing when LV uses all of the CPU?


Ben






LabVIEW is doing absolutely nothing (that I told it to do) during the pauses. The loop apparently stalls for 3 or 4 seconds at its current execution point and then picks up where it left off. It happens at any point in the application. None of my code is being executed during the stall.
0 Kudos
Message 11 of 55
(2,049 Views)

Image processing is outside my personal comfort area.

Doesn't "Image Display" have something to do with Image process or acquisition?

What happens with the CPU with those shutdown?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 12 of 55
(2,047 Views)
I have a similar problem. My application doesn't use image processing, but at random times, CPU usage goes to 100% and the program hangs for a few seconds. Sometimes it's long enough for my data acquisition to overflow and error out. My memory usage stay constant during the entire run of my program, so there's no memory leak. Here is a screen capture of the task manager during one of these events: http://picasaweb.google.com/chris.osiecki/LabVIEWStuff/photo#5202939593772614050

I have also set all of my processes to normal priority and it hasn't changed the behavior.
0 Kudos
Message 13 of 55
(1,957 Views)
Did you verify that LabVIEW is using the CPU during these events? Maybe it's something else.
 
How much RAM do you have?
0 Kudos
Message 14 of 55
(1,947 Views)
In the task magager LabVIEW is showing 100% CPU use. The system has 2GB of RAM. I'm acquiring data from 16 channels at 100kS/s, so there's a fair amount of data being moved around. I have made sure all of my arrays are preallocated and I use indexing to access them, so I'm not doing any dynamic allocation. I also put all of my references and queue initializations outside of my loops. I have tried to make LabVIEW use 100% of my CPU by having lots of seperate while loops with no waits in them, but I can't. Is it possible this 100% use is some bad interraction between LabVIEW and Windows? I use a lot of events, queues, and notifiers in my program and these all use windows system calls more than other types of LabVIEW methods.


Message Edited by COsiecki on 05-22-2008 08:24 AM
0 Kudos
Message 15 of 55
(1,922 Views)

Hi COSiecki,

Can you give me a bit more system information?  What version of Windows are you running?  What version of LabVIEW and what version of the DAQmx driver are you using?  You can use the Measurement and Automation explorer program to see all of your software by opening it and expanding the software configuration tree.  Does your code use DAQmx functions?  If so, depending on your version of DAQmx the problem could be with the way your coding those functions.  Also what DAQ card are you using?  Actually, if you could post your code or a screen shot of your block diagram I could try running it on my side to see if I get the same CPU spike.  These CPU issues can very according to the operating system and the versions of software that is being run.  Thanks.

 

Stephen S.
National Instruments
1 Test is worth 1000 expert opinions
0 Kudos
Message 16 of 55
(1,905 Views)
I'm using LabVIEW 8.5 on XP Pro with SP2. I'll check on which DAQmx I'm using, but I just installed an update a few weeks ago, so I'm pretty sure it's the newest one. Yes, my data acquisition loop uses DAQmx functions, but it sends its data directly to a data handler loop via a queue. No other loops use DAQmx functions. I'm using 2 PXI-6123's over a fiber link via MXI. I will see about getting the block diagram posted, but I don't think I'll be able to do it without some work due to proprietary reasons. I do use a lot of sub loops and I use references to my UI controls to have the sub loops update the UI directly. I did that to keep from using lots of globals, but I read in a LabVIEW book recently that isn't the preferred method. I'll work on getting a block diagram posted though. I asked about this earlier on another thread and it has a thorough description of my program. http://forums.ni.com/ni/board/message?board.id=170&thread.id=319986
0 Kudos
Message 17 of 55
(1,898 Views)
COsiecki,
 
It might be usefull to use the diagram disable structure and disable some parts of your code to see if you can figure out if there is a specific part of your code that is causing the CPU spike.  If you can narrow it down to a certain part of code then you could just post the part causing the problem. 
Stephen S.
National Instruments
1 Test is worth 1000 expert opinions
0 Kudos
Message 18 of 55
(1,878 Views)
I have actually just recently made up a dependency matrix for my sub-loops as well as changing my code so I could start and stop them independently without having to shut the whole program down. I'm trying various configurations based on the dependencies to see if I can track the problem down that way. I was doing something similar before, but without paying attention to dependencies. In certain configurations, it wouldn't have this problem. If I can narrow it down to a sub-loop or a group of them, I should be able to post those for troubleshooting.
0 Kudos
Message 19 of 55
(1,860 Views)
I may have found the problem. After using my dependency matrix, I found that it was stable without one function and its dependents, but would lock up within a few minutes with this one function turned on, even without its dependents. I took a close look at the function and I had a process that was supposed to wait on a notifier, but instead was just in the diagram section as the notifier. I wired the error from the notifier to the function to make ensure execution order and it has been running for a couple of hours now. I'm leaving it up over the weekend to test the change, but it looks good so far.
0 Kudos
Message 20 of 55
(1,847 Views)