10-19-2005 02:42 AM - edited 10-19-2005 02:42 AM
Message Edited by ThomasD on 10-19-2005 02:43 AM
10-19-2005 03:18 AM
Hi Thomas
Your first described way works, but I think it's a bit "dangerous" to compare the remainder to 1 (in addition you compare floating-point numbers).
I made a vi, which measures the time elapsed end sets an indicator. The duration of the time the indicator is set true, depends on the loop timing. So I places a "Wait until next ms multiple" with 5ms. Because of this very short time, you won't see the indicator flash (you could see it if you increase the time from 5ms to 100ms).
In the false case I just wire the boolean value through to the output tunnel and I do the same with the time from the shift-register.
Just have a look a the picture.
Hope this helps.
Thomas
10-19-2005 03:31 AM
10-19-2005 10:25 AM
@ThomasD wrote:
The background is, that I like to write values in a file every second and the cycle should not have a great effect of the runtime from the VI.Can somebody help? I work with LV6.i.
Just place your file operation inside a while loop and also place a "wait next ms multiple" with an input of 1000ms. That's all you need! 🙂
Unlike the plain wait (ms) node, the wait next ms multiple will ensure that the loop occurs at regular intervals, independent of the execution time of the nodes inside the loop.
10-20-2005 03:41 AM
Hello you 3,
@ Thomas, I built the VI how you said, but in the logfile, where I save the datas, the time for each measurement/save cycle is a few seconds and the cycletime isn´t constant too.
@ Gerd, the programm in the first message of the thread should only show the ideas I had. When the code you told is integrated in my VI, I get two different results. First, when the "x < Y?" is connected, the cycletime is not constant. Same problem seen by the solution of Thomas or the first VI I have posted. I think, this are runtime-problems, where the exact match isn´t always found. Second, when the "x != 0? 2" is connected, the cycletime is <200ms.
@ Altenbach, I also tested it with the "wait next ms multiple", but these doesn´t also work over time. I read datas from the serial port with 9600 baud and than, the "Number of Bytes at serial port" does increase by using the "wait next ms multiple" function and after a few seconds there is a buffer overflow.
Legend to the pictures:
becktho_01.jpg: VI with Thomas´solution
gerdw_01.jpg: VI with Gerds solution
logfile_01.jpg: logfile with "x != 0? 2"
Regrads ThomasD
10-20-2005 05:50 AM
Hi
As it can be seen in your attachments, you have more logik in the vi than just generating a pulse - this may slow down your loop. If you want to keep the pulse generation time constant, just pass the impuls to an other loop or vi, where you log the data. If you have to log data with each pulse, try to use a buffer.
Thomas