LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wait until next

Hello,

i have little trouble with wait until next ms

the first loop is very large around expected cycle value so it generate desynchronisation on devices...
ex:  my cycle is 10 second and first loop can reach 6 second in worst case !!!
is there tips to have correct timed loops and avoid 1st loop trouble ?

i tried 2 solutions to bypass this probleme but i loose a full cycle ( 10 sec)

1) with 1st call function and a condition structure but it looks heavy "timer01.vi"

2) with a pretempo before real working loop, it seems to be correct on few trys but i would like to have confirmation about repetability "timer02.vi"

here two files attached with a simplified exemple for theorie , the light have to light on only 2 sec out of 4

cordialy

Tinnitus
 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
Download All
0 Kudos
Message 1 of 5
(2,854 Views)
Maybe you should use a plain "wait(ms), instead of a "wait next ms multiple".
 
Better yet, use a timed loop. See attached.
 


Message Edited by altenbach on 04-03-2008 05:20 PM
Download All
Message 2 of 5
(2,824 Views)
thank you altenbach,

i finally change to this structure, i tought  it was designed for  more  complex  applications,

now i  don't see when a wait until next can be usefull, or only if code takes 2 times less than loop cycle

Best regards

Tinnitus


CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 3 of 5
(2,801 Views)


tinnitus a écrit:
now i  don't see when a wait until next can be usefull, or only if code takes 2 times less than loop cycle

See here... there is nothing wrong about this function. You only need to know how it works ! Sometimes it is the way to go, sometimes other solutions may be better.
0 Kudos
Message 4 of 5
(2,795 Views)

For some other discussion about "wait next ms multiple", also have a look at the following thread:

http://forums.ni.com/ni/board/message?board.id=170&message.id=291455&query.id=41686#M291455

0 Kudos
Message 5 of 5
(2,761 Views)