LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timeout loop sub.vi esecution

Dear all, thanks in advance for your useful support.

I have a program where I have to read the data from an instrument via a sub-vi which I cannot modify.

This sub-vi is inside a loop, and it retrives the data once the external trigger signal arrives.

Unfortunately, the program enters into the sub-vi and waits for the trigger to arrive. If it does not arrive (like at the end of the experiment) the main programs freezes in the loop inside the sub-vi. 

My idea was to use timed sequences, so to make a timeout or a deadline which makes the program stopping the loop (going out from the sub-vi) and finish the main vi program. I know how much time it should take to get the data, so I can use this data.

I found myself lost in the understanding of timed sequences working, even by looking at its instructions and examples around the web (https://learn-cf.ni.com/teach/riodevguide/code/rt_measure-loop-time.html or https://www.physik.uzh.ch/local/teaching/SPI301/LV-2015-Help/lvconcepts.chm/CON_Config_Adv_Timed_Seq...).

Is there a way to force the program going out from the sub-vi (without modifying its code), but without stopping the main code?

Thanks

 

0 Kudos
Message 1 of 3
(572 Views)

Well, it is all in the dataflow and the problem seems to be the subVI which you apparently cannot modify. Why not? It seems faulty!

 

All you can do is place that subVI in a parallel loo so it does not gum up your UI loop, then, when the time comes to shut down, you can make sure everything else ends does it's proper shutdown procedure, then you can kill the stuck code at the very end. (This may or may not work, depending on the subVI, for example if it is stuck inside a dll.)

 

Maybe you can fix the subVI anyway. Do you know who wrote it?

Where does the trigger come from? Can you simulate one if it does not happen?

 

We can typically offer much more specific help if you would attach your VIs instead of a pointless picture. Where is the terminal of the local variable? What else is there? Why are you autoindexing on the output tunnel?

0 Kudos
Message 2 of 3
(567 Views)

unfortunately I cannot paste the full program, but the sub-vi yes (it is in http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=7833BD4A31DA1274E04400144FB7D2...). The sub-vi is from Ocean optics, which reads the data from Flame spectrometer after being externally triggered. As this trigger does not arrive, the reading stays in constant waiting and I cannot go outside the Read Spectrum.vi. I would like to exit this sub-vi after a user-set timeout

Thanks

 

0 Kudos
Message 3 of 3
(540 Views)