LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Profiling function removes problem it was supposed to identify!

I have a quite large project, which handles a camera and some other IO traffic as well as presenting data etc for the user. Its way to much to post here.

I have a problem with the program - it hangs for a few seconds (i.e. 5) every now and then - quite often like every fifth to fifteenth second, but the intervals vary.

To find out which part of the code that made the program hang I started the profiling tool. But this seemed to remove the problem - as long as the profiling runs - it does not hang!

Does anybody have a clue about whats going on?
0 Kudos
Message 1 of 4
(2,867 Views)
When a debugging aide seems to correct the problem, it usually indicates a timing problem or race condition. Are you using local or global variables? Are you allocating memory for an aray in a loop?

Can you reproduce the problem with a simplified section of your program which you could post?

Tell us about the structure of your program. That may give some clues.

Lynn
0 Kudos
Message 2 of 4
(2,857 Views)
In the past when a problem of this type disappeared when tracing was turned on, or profiling enabled it almost always was a timing condition. Occasionally it will be a "race condition" where a local or global is being written to from multiple locations, sometimes it will be a hardware type of problem where the components aren't making use of the data flow to determine execution order and something is executing before a required condition is met. It is hard to be more specific without more knowledge of how the program is written.

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 4
(2,851 Views)
I have not worked with this problem the last weeks, but know I am on it again. Thank you for your suggestions.

I have pinned the problem down to a IMAQ Copy vi. In the code I have posted you see a sequence diagram - in which there are a blue VI with img stat# on it. Inside this VI the code is the one you can see in the 2nd attachment.

Here the image in (TempImage) is the last frame captured. This frame is copied into the second image in (TempImage2) to avoid changing this image before displaying it (see seq diagram where its written to ImageDisplay). However if I remove the IMAQ Copy from this VI - the main VI does not stall. Now does this mean that the problem lies within IMAQ Copy? Probably not? When I remove IMAQ Copy, the TempImage2 and ImageDisplay remains empty (no data) - maybe this causes my error not to occur? I am not sure what to do from here..
Download All
0 Kudos
Message 4 of 4
(2,814 Views)