LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Missed iterations of TTL triggered timed loop

Solved!
Go to solution

Hello everyone,

 

I have a camera control VI that waits for TTL information from the camera shutter and uses it as a timing source for a timed loop. In this timed loop the camera is readout and analyzed. The program should react as soon a possible to a new image and therefore I set the timed loop to 'Discard missed items'  so that it doesnt try to catch up (the events im trying to detect are quite rare and last several frames). 

 

The problem is this: When I set the camera for a certain numebr of frames (for example 10.000 frames) sometimes due to the discarded frames the loop iteration number never reaches the expected last frame number and doesnt exit (it stays at 9.998 for instance). I noticed I can prevent this by deselecting 'maintain original phase' . However it is unclear to me what exactly happens with these settings in a TTL triggered situation like this. 

 

Is it the case that the loop skips the new data but starts the next loop at the correct iteration number (+1)? Or is something else happening?

 

Im thankfull for any help!

0 Kudos
Message 1 of 3
(2,550 Views)
Solution
Accepted by topic author j.win

Dear j.win,

 

If you deselect "Maintain Original Phase", actually you will never discard any iteration, whatever the value of "Discard missed items". Instead, the loop will try to catch up with the late iterations.

 

Using an external timing source (your TTL for example) instead of an internal timing source does not change anything. You can use the "Period" (dt) input of the Timed Loop to specify when the loop is supposed to iterate (the unit is the "ticks" in the case of an external timing source). A value of "1" means that the Loop try to iterate at every ticks of the external timing source. If for some reason one iteration lasts longer than that, you will have a "late iteration". Also with a value of "1", it is not possible to modify the "phase", then the "Maintain Original Phase" parameter will just defined wether or not you skip the iteration. If "Maintain Original Phase" is false, the loop will execute immediatly after a late iteration to still execute it, but a bit latter. If the "Maintain Original Phase" is true, the loop will execute immediatly after a late iteraion if the "Discard missed item" is false otherwise the loop will skip the iteration.

 

Is it clearer now?

 

Regards,

Cédric | NI Belgium
Message 2 of 3
(2,510 Views)

Thank you cedhoc! That really made it allot more clear for me ! I mostly got confused by the term 'phase' seeing that I use a irregular TTL trigger for the timed loop. I actually solved the problem by turning on 'maintain original phase' again with 'discard missed items' but instead using the 'actual start [i]' variable in the loop as the counter instead of the normal 'i'. Hereby I can discard late itterations but still have the correct frame number.

 

Thanks again!

0 Kudos
Message 3 of 3
(2,485 Views)