LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cannot run a VI twice in a row

Hi,

 

There's a VI that has nested timed loops inside it. If I use the "continous run" button of LabView, it runs fine. However if I try to run this VI through other methods (calling it inside some for/while loo) it only runs once and will choke on subsequent calls. Could this have something to do with an instnace of "VI server reference" that exists inside the code or times loops?

 

Thanks for your help

0 Kudos
Message 1 of 6
(2,810 Views)

You'll have to post some code so we can see what you are trying to do.

 

The run continuous button is never meant for normal operation of a VI, only for debugging purposes like a subVI, so if that is the only way your VI "works", then something must be wrong.

0 Kudos
Message 2 of 6
(2,806 Views)

I have narrowed down the issue to an error that prevents a named timed loop from executing second time the VI is called:

 

error -816: Timed structure aborted or attempted to execute another iteration of the following aborted time loop.

 

The VI has an instance of "Stop timed structure VI" that requires a "name" for the timed loop.

 

Now, I am wondering whether the fact that that name is no longer valid second time the VI is executed could be the issue, so tried to replace that string name of the timed loop with a variable.

 

Did not solve the issue. Any more ideas?

 

0 Kudos
Message 3 of 6
(2,785 Views)

Still need to see what your code looks like...

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 6
(2,776 Views)

A possible solution may be to trap and clear the error -816. Clearing the error should not change the functionality of your code and allow you to call the VI twice in a row.

http://www.ni.com/gettingstarted/labviewbasics/handlingerrors.htm

 

Also you might want to read though this forum, the last two post talk about same issue

http://forums.ni.com/t5/LabVIEW/Restarting-counter-in-Timed-Loop/m-p/1419264?requireLogin=False

 

 

Tim O     

Application Engineer     

National Instruments     

ni.com/support  

Applications Engineer
National Instruments
Message 5 of 6
(2,739 Views)
Thanks for your response, it turns out the error emanted from a not closed "VI server reference". Once added a close handle, the timed loop does not exhibit error -816 any more. Strange.
0 Kudos
Message 6 of 6
(2,722 Views)