LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW application stucks in between while running

Dear All,

           When I am running the LabVIEW application, it always stucks up in between for 2-3 second and then again starts, and it is doing so continuously in the loop, I have four loops in my vi, two are continuously run while loop and two are timed loops running at 50 ms and 60 ms, with having different priorities, can anybody tell me what is the problem in this? and can anybody provide me solution?

Thanks in Advance,
Nishant
0 Kudos
Message 1 of 10
(3,645 Views)

Offhand, I'd say that "something" is requiring execution time that you didn't anticipate.  Without posted code, I don't think anyone else can identify what that "something" might be.  Can you post it?

You might be able to find it yourself by simply watching the diagram with execution highlighting on.  If there's one specific call to a vi that requries seconds to execute, you'll probably be able to notice that.  Some of the standard candidates include:

1. Calls to DAQ functions requesting to Read samples which aren't yet available.  The call will wait to accumulate them or else time out.

2. Calls to VISA communication functions requesting to read bytes that aren't yet available.  The call will wait to accumulate them or else time out.

3. Operations on very large arrays that require memory management.  This seems less likely to cause a consistent timing delay though.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 10
(3,617 Views)
Additional question is:  do you have nested loops? 
0 Kudos
Message 3 of 10
(3,594 Views)


@Nishant wrote:
... two are continuously run while loop and two are timed loops running at 50 ms and 60 ms, with having different priorities,
  • Does "two are continuously run" mean they don't have any wait statement at all?  If so, why???
  • Are you sure the loops actually stall or could it be that just the front panel updates are slow?
  • What is the priority of the VI? (If you set it to higher priority it is possible that front panel updates are being delayed. Leave it at normal priority.)
0 Kudos
Message 4 of 10
(3,579 Views)

Hiii, Ray

         No, there is no nested loops in the VI.

Thanks,

Nishant

0 Kudos
Message 5 of 10
(3,561 Views)
Dear Altenbach,
 
        One of two continuously running loops have wait time of 250 ms for the purpose of Muxing I am doing, and it has comparitively low load, but the other one doesnt have any kind of wait and it has comparitively high load rather than everybody, so could it become problem? Is there any requirement of wait in the while loop? if yes then why?
 
        In the timed loops, priority of both the loops are low, but one thing i have measured is they both are same on 99, could it become problem? is it require a different priorities for both?
 
        And I am also sure that loops are stall and there is no delay in the front panel update.
 
        Waiting for your views.
 
Thanks,
Nishant
0 Kudos
Message 6 of 10
(3,560 Views)

I have hade the same type of problem with one off my own program. It was halted for some seconds at irregular times.

The computer I used for this application is with dual cores. If a disable one of those for LabVIEW I newer has the problem that the program is halting for some time.

What I found was that one off the processors gets a very high load and the anther has zero loads under the time the process is halted. Then the process get on it get to normal levels on both processors.

Bosse
0 Kudos
Message 7 of 10
(3,539 Views)


@Nishant wrote:
 
the other one doesnt have any kind of wait and it has comparitively high load rather than everybody, so could it become problem? Is there any requirement of wait in the while loop? if yes then why?
 

Yes, place a short wait within this loop as well.  The value can be as low as 5 ms (also try 10 ms). This one can be choking the other loop by hogging the processor.  Also make sure that there is a valid trigger to stop the loop.  While debugging, you can insert a timeout case

Ray

0 Kudos
Message 8 of 10
(3,508 Views)

Dear Ray,

            But doin so, will it delay my execytion? bcos of sm big amount code and fetching the data from data acquisition card we are already in a bit delay, if this will add the delay, we ll be in trouble, that is why i am cautious about this thing.

Thanks,

Nishant

0 Kudos
Message 9 of 10
(3,480 Views)

Hi Nishant,

I've read a post by Dennis where he mentionned that the delay could actually be as little as 0 ms.  I haven't tried such a small amount myself 😉

T\Basically, the delay will allow the processor to share some resource for your other loop, so that it can execute as well as your OS (which is probably Windows).  If you do not put any delay, you will get the impression that your entire PC has frozen up.  If you are running Windoze, that is because it is not a Real-Time OS, thus it services routines on a priority / resource basis.

If your environment requires strict timing during execution, you may have to consider some alternatives.  There may be some info in the Knowledge Base somewhere on this forum..  I'll have to go over the posts in this thread to see what you are trying to achieve.  Otherwise, you may have to post the constraints that you have to work with so that we can propose something reasonable.

Hope this helps,

RayR

 

0 Kudos
Message 10 of 10
(3,461 Views)