LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

for loop to create a timer

Hi all,

I need to add a timer (as IMAQ Overlay) to some images previously grabbed by a 1394 camera and I'd like to create a for loop which adds the timer to one image each cycle. My problem is that i've to create a string but I cannot start from time 00.00.00 (hh.mm.ss) but from 02.00.00 as I used a timestamp.

I attached my solution (not working)

Can you suggest me a better solution?

(I use Labview 70)
0 Kudos
Message 1 of 4
(2,283 Views)
Is there any specific reason you're adding 40 in each iteration?
You can use a numeric display instead of a string display and format it to display relative time (right click it, Format & Precision, Relative Time). Then, either use a shift register and increment by 40 (that's 40 seconds) or, if you want the real time, place one ms counter outside the loop and another one inside, subtract to know how many ms passed since you started and divide by 1000 to get seconds.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,276 Views)
40 (secs) is just an example (it will be a control).

Usually I'll have at least 2000 images, or even more, grabbed each 30 secs so I don't want to wait 30 secs * 2000 images before stopping the cycle.
My idea is to add the timer (for example 00.00.30) as soon as possible according to the time the for loop needs (without waiting 30 secs).
As regards the string I'm obliged to use it as the Imaq text overlay requires it .. I don't know if another way exists

thank you again
0 Kudos
Message 3 of 4
(2,272 Views)
Sorry, I guess I missed some parts of the question.
You can use 2 Quotient & Remainder functions to get the numbers. Divide by 3600 to get the number of hours and divide the resulting remainder by 60 to get minutes and seconds. Build all three into an array in the proper order and use array to spreadsheet string. Use : or , as the delimiter and %02d as the format.

___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,240 Views)