the sum of the time of loop iteration.

Hello

I need to estimate a time every time through the loop. The time is different (depending on the counter triggers). I need to estimate the time of each simple iteration and add the last time with the current iteration. For example the first iteration - 400ms, second time 350 ms (400 + 350) (, third 380 (400 + 350 + 380) Ms. I tried with check meter and register shift, but I got a sum of (absolute) the tick counter.) I will be grateful for any suggestion. I need at this point to draw the graph with measured values.

Lukasz

Hi Lukas.

your question looks like a perfect example to learn how to use the shift registers. Is - this work at home?

(With the help of a random wait for testing...)

Tags: NI Software

Similar Questions

  • changing the values of loop iteration

    Happy new year everyone!

    I have a question about changing the loop iteration number set to a loop for. I made a simple example of what I had imagined in my mind, but I knew that it wouldn't work, however, it shows what I want to accomplish. I would use a switch or something to control the loop, so you can start running to essentially infinity, which is the constant from 1000000 and then go on a number of controlled if the loop ends in fact and the code can move. Each iteration is a second.

    Thanks for any ideas you may have

    A While loop is a loop For which has no fixed number of iterations (if you allow me, he 's going to try to go to infinity).  It has a Stop indicator that stops the loop if True is wired for it.  Note that if True is wired to the stop indicator when the loop begins, the loop will always be executed (once).  In this sense, it is slightly different from a loop For 0 cable to the input of N (which does nothing).

    So some time, use a loop to do this.

    Bob Schor

    PS - you should know...

    PPS: I just looked at your VI.  I'm sure you realize that the way to data flow rules you need to set the Boolean and order digital before start the programme - once it starts and gets into the while loop, changes you make outside the loop will have no influence on the code inside the loop.

    Have you taken the LabVIEW tutorials?  If so, and if not, go look again, attention to the program flow, loops, etc..

  • Combining the timer and loop

    Somehow, I thought this might work:

    for (var a: number = 0; has < total; ++);

    {

    code

    code

    code

    code

    var autoTimer:Timer = new Timer (4000, 1);

    autoTimer.addEventListener (TimerEvent.TIMER, autoSlide);

    function autoSlide(e:TimerEvent):void

    {

    trace (URL);

    }

    }

    The idea is to load a URL (code charger not included in this) in an XML list every four seconds. The loop must not repeat the cycle until the function is complete. But he shakes down all 99 URL in a fraction of a second. I'm so bad (think)?

    Any help much appreciated.

    Thank you.

    Why don't you try just a simple timer?

    Well, if you really need a variable number as when you use a loop for example, you can use something like this:

    var waitingTime = 1000;
    var xmlListLenght = 15+1; //+1 just to remember that your xmlList starts with 0
    var timesToLoop = xmlListLenght;
    var xmlListItem = 0;
    
    var myTimer:Timer = new Timer(waitingTime, timesToLoop);
    myTimer.addEventListener("timer", timerFunction); //TimerEvent.TIMER
    myTimer.start();
    
    function timerFunction (e:TimerEvent) {
         trace(String(xmlListItem) + " working");
         xmlListItem++;
    }
    

    I hope it works for you!

  • The VI call on the n-th loop iteration

    Hi all

    I have a VI (let's call this VI1) looking for something like the one below.  How do I get it to call/run another VI (let's call VI2) when I = 2.  I can't put VI2 in the loop because VI2 must be made independently, and VI1 loop should not wait to VI2.  Thank you.

    With the help of the whole for the case selector is a little lighter.

  • Control the simulation time to align the time system

    Good so maybe it's blindingly obvious or just simply a ridiculous question but here goes:

    I run a dll that I produced from a .mdl file. My goal (among others!) is to get the dynamic response of the exact model of 'real world' calendar (date system). The tuning for the appearance of the control of this model is based on the duration of simulation with produced in simulink and so it is desirable for me to define the duration of the simulation to run when the system.

    The problem I have, if you open the workspace and produce a template control, the simulation shown time is much faster than the time system.

    For example, one iteration of the model takes a fraction of a second. What I imagine happens, it is immediately restart (and progress of a time step). I guess I want the model to wait until it is in harmony with the system time before iterate again.

    Is there a way to solve this problem, and do anyone know if this problem will be resolved in Simulink or Veristand 2009.

    Any information would be appeciated, my trawl of the help files OR have not really answered the questions yet good

    Thank you
    James

    The models are running in sync with the rest of the system. Unless you specify a decimation factor for your different model of 1 for each tick of the primary control loop your model put once, too. The difference between the model and system duration that you see is due to the fact that the model time is based on its time not Delta T compiled, not any of the wall clock time. Every time that the model is Ticktock, it adds its own Delta T to its operation time string.

    The time channel system is based on the Delta T of the primary control loop. Thus, it corresponds with the rate you specified the system to run at. If these Delta Ts are the same, are aligned at the same time. If you want the time to model to match an actual wall clock time, you can adjust the flow of the loop of the primary control loop to match the Delta T, or adjust the factor of the decimation of the model so that it gets only checked once for every N the primary control loop iterations.

  • How to count the time exactly?

    I tried to count the time using a VI like the one attached.

    It's that's not couting correctly. There is a possible reason, I have observed.

    The computer isn't able to handle the VI as soon as necessary.

    I thought about this because, when in edit mode the time count was very bad, and, when I created an application and installed, it ran okay, how 'light '. But today, when I tried to use this application with an old computer it did not work. The clock is slow.

    Is it possible to count the time correctly?

    I use a DAQ6009 to make my works, my VI is big enough and I need one iteration to each 1 ms (milliseconds) as I am with digital inputs from 5 events of coders (I know that's not the right way to count the encoders, but it's the only way I can do it, and it works).

    Thank you in advace! I hope you can help me!

    Hugs!

    Ok.  I will try to help you understand certain things.

    The number of cycles and wait (and wait until the next ms Multiple) functions all use a 1 kHz derived from the clock of the processor clock. The accuracy of these clocks is not large, although they are probably similar to the precision of the stopwatch.  Any time generated by these functions will show some differences in the time of the clock as it is derived from a different oscillator.

    Updates from the front panel are time by LabVIEW and the operating system. Most of the screens are updated with 60 to 80 times per second, maximum. What made the operating system, an update of the screen might be delayed by 10s of milliseconds or more.  It is certain that not all of the values at the end of the Add function will be displayed.

    Wait for him until the next ms many will wait more than 1 ms if the other code in the loop takes longer than 1 ms.  I don't know, but I think that the indicator is buffered so that any delay by the operating system to update the display should not slow down the loop. I tried to remove the flag, and it doesn't seem to make a big difference.

    I modified your VI to provide several indications of the performance. First of all, I added to the sequence of three-frame structure to allow synchronization of the loop. Second, I changed to a loop which runs a specified number of iterations. Thirdly, I hooked up the output of the timer until the next ms Multiple to a tunnel of autoindexing allowing a record of the time of each iteration appears in the table of ticks. I calculated the differences between successive instants and poster on a chart, so that you can see the performance.

    I didn't want to sound criticism of your use of English.  You write in English, much better than I could in your language!  What I was trying to make is that such general descriptions that ' Besides correctly ' without quantitative results or evidence in support of the application do not have enough information to help us help you.

    Lynn

  • How to increase the resolution of the timer loop?

    Hi all

    I use myRIO 1900 for my project of Active noise cancellation. I need to process the audio signal @44. rate of 1 kHz sampling and 50 samples per image. So, I use myRIO personality of broadband.

    Now my problem is simple, I want to measure the time each iteration (loop). I went for the number of cycles normal (msec). Used as a standard [https://decibel.ni.com/content/docs/DOC-11078].

    But my value of the indicator oscillates between 1 and 2. It is supposed to be 1.13msec, but how to find the exact value of timer?

    I think, I can't increase the resolution of tick count (msec) as it is by default is 1 ms resolution and I can't use the clock source external I use myRIO.

    Help me calculate the precise time of loop.

    Thank you.

    RT has express VIs for timers.  You can use this: http://zone.ni.com/reference/en-XX/help/371361J-01/lvexpress/tick_count/

  • calculations between two values of the sequential loop iterations

    Hi all

    I have a code that came out our power (DSP) of a FFT spectral density. An input frequency and then intervened at a value of input from the user. I would like to know the difference of the PSD between each stage of the frequency. Attached, that's what I would get. To avoid confusion, I don't want to produce a file that looks like this. I want just the column 'delta' as an indicator on the front panel, so I can control my change in PSD. I don't need the entire table, just the delta between the current iteration and the previous iteration. I tried to use a loop with shift registers, but I'm not sure where to go to from there. I thought that, since the shift registers sends the data of loop to loop, that I could output the value before it went into the next iteration, but I don't have a chance. Any help is appreciated. Unfortunately, I am unable to put the code due to the policy of the company. I know it makes things much more difficult.

    Thank you.

    Suggestions do not seem quite right, but I found a way to do it. Attached, is the way that I did.

  • output to the loop iteration

    Hi people!

    I am trying to use a very simple "loop For" with "16" iterations and Shift Registers starting at '0' and adding '4' on each iteration.

    But I am not successful to display each value in the iteration. Only the final value of '64 "!

    Is it possible to generate the value of each iteration in each loop?

    If this is the case, then could you give an example?

    See you soon!


  • Text added in loop file adds the value of delimiter unwanted at the end of each iteration.

    I use 'Export to Spreadsheet.vi' in a loop that records a text file and adds data to a waveform table 1 d for each iteration. My problem is that, at the end of each iteration of what an extra delimiter value is added to the file. When I then try to graph my data, I get the holes, as shown below (circled in black).

    When I start to analyze the data, I'm sure it will be a nuisance. I can't find a solution to this problem. Any advice would be greatly appreciated.

    Thank you.

    Any wire TRUE here

  • "1 MHz" for the name of the source on the time loop does not work on LabVIEW Real-time 9.0

    A Loopis Timed running as expected if a time source is manually chosen in the dialog box of configuration for "1 kHz" (first digit) and "1 MHz" (second digit). If the time Source name is set through the input of the channel "1 kHz", the loop is executed, too third figure). But if the input string is "1 MHz", the loop is not executed (last figure). The channel two are created by "create constant" on the entry of the loop to exclude typos. Is it possible to set the Source of a loop time timed through the input string to the real-time clock hard Mhz?

    OK, I was a bit confused by the difference between the behavior of error...

    Now, the question is quite clear. Aid for the timed loop provides the following regarding the Source of the calendar entry:

    Specifies the name of the synchronization source to use to control the structure. The source of synchronization must be created using the create synchronization Source VI on the block diagram or selected in the dialog box Configure the timed loop .

    So, I think that you have somewhere in your code a time Source.VI create if you pass "1 kHz" as the name. But you did not do this for your clock "MHz 1"...

    hope this helps,

    Norbert

  • A structure of the event within a certain time out loop.

    I'm relatively new to LabView and in particular the structure of the event. I was looking at the previous posts regarding the structure of the event and the difficulty to stop people. In my VI, I have two cases of event besides the time-out. I use this VI for control of stepper motor. I have 2 buttons (for each case), a movement to the left, the other to the right. It works as it is supposed to, but when I try to turn it off I have to press the two buttons before it stops. As if the loop should run everything inside before stopping.

    In my VI, how can I do the execution stops when I press the stop button? I tried many configurations of the stop button and boolean logic (which I believe was correct), but I am now stuck.

    Thank you very much

    Alek


  • synchronize the loop with the time on the computer

    I'd like to run a while loop exactly all the 1 minute, with the minute that occur according to the time on the computer at 0 seconds.

    a timed loop runs a minute after the loop is started and is not synchronized with the 0 seconds of time on the computer.

    How do I get there? I realize the first loop will be less than 1 minute, due to the synchronisation.

    Thanks, that helped me.

    I thought at the start of the second 1 loop would consume resources additional, but realized it's negligible.

    I ended up using quotient/remainder on time on the computer in seconds and checking when the remainder is 0, as this allowed for the second interval.

  • The ABS function and the sum at a time

    <? If: sum (ARCH_AMT)! = '0' ? >

    We used above condition in the model to restrict the data to date, but we were faced with a new problem when ARCH_AMT is to have several lines with the same amount but + ve and ve - that is to say 500, -500, is the sum and do not return data given that the sum would be zero.

    We do ABS (ARCH_AMT) before making the sum that the SUM will be thousand and data will be collected.

    Please suggest how can we have ABS and the sum at a time

    I tried

    <? If: sum (ABS (ARCH_AMT))! = '0' ? > and also choose the conditions and it does not work.

    Thanks in advance.

    Kind regards
    Mahi

    Published by: mahi4luck on March 28, 2012 02:33

    store ABS (ARCH_AMT) in a variable and use this variable in a total cumulative

    example:
    Suppose I have a structure xml like this:



    -500


    500





    Total:

  • Action script question on a loop to a part of the line of the time

    Hi all!

    You have another question about an action script editing in Adobe Flash. Earlier this year, I asked for help to set up a script of action where the video itself would start when the user hovers over the scene and loops from the beginning to the end.

    Now, I need to adapt it so that instead of a loop all the way back to the beginning, it goes rather to the points later in the animation (for example, say 10 seconds in) rather than backwards to the beginning.

    The Script that was created for me it was:

    FLV.source = "Flash.F4V";
    flv.autoPlay = false;

    flv.autoRewind = true;
    flv_btn.addEventListener (MouseEvent.ROLL_OVER, rolloverF);
    flv_btn.addEventListener (MouseEvent.ROLL_OUT, rolloutF);

    function rolloverF(e:Event):void {}
    FLV. Play();
    }
    function rolloutF(e:Event):void {}
    FLV. Stop();
    }

    flv.addEventListener (Event.COMPLETE, completeF);

    function completeF(e:Event):void {}
    FLV. Play();
    }

    Now, I think that what needs to be changed is the autoRewind = true section, but being a complete novice, I don't know where to start. I've seen articles online on a goto command, but my attempts to change the code did not work properly. Any ideas?

    use:

    FLV.source = "Flash.F4V";
    flv.autoPlay = false;

    flv_btn.addEventListener (MouseEvent.ROLL_OVER, rolloverF);
    flv_btn.addEventListener (MouseEvent.ROLL_OUT, rolloutF);

    function rolloverF(e:Event):void {}
    FLV. Play();
    }
    function rolloutF(e:Event):void {}
    FLV. Stop();
    }

    flv.addEventListener (Event.COMPLETE, completeF);

    function completeF(e:Event):void {}
    FLV. Seek (20);  use the right time

    FLV. Play();

    }

Maybe you are looking for