control of time of two loops

Hi all

Here, I'm a little stuck. I'm trying to control the execution of the two loops to display a picture, I need run the upper loop for example for 30 seconds, after that he needs to stop and the lower loop starts to run for 15 seconds and stop. and then the upper loop run again for 30 seconds and then the process continue in this way.

So please, if you can share me your trick, which will be appreciated.

Thank you

Hello

something like this should work.

Best regards

K

Tags: NI Hardware

Similar Questions

  • How to create a control of time for the while loop?

    Hi all

    I want to control my time running of the loop. In other words, I want to stop everything in the execution of the loop after a time (in ms) that is defined by the user. For example user defines Control Panel for 5 seconds before a while loop runs and stops after 5 seconds.

    I don't know is it possible with the while loop. I managed with the timed loop, but this must be wrong with my application. Y at - it of the other loops for timed control if it is not possible with while loop? There is also a simple loop with .vi random number (0-1) as an attachment.

    Best regards

    Jick

    Hi again,

    I managed to solve my problem right after I posted my first message. I did it with the passage of time and the register shift (for the elapsed time of reset).

    Thanks for your replies anyway!

    Best R

    Jick

  • Why these two loops while cannot work at the same time?

    I place two same while loop in the block diagram, and then use highligt and one-step run function to observe their parallel operation.

    But I discovered that this two loop operate alternately and cannot operate simultaneously.

    Can someone help me understand this?

    My software environment:

    OS: Windows XP SP3

    LabVIEW: student editions 2011

    CPU: intel P8400

    Hi, GerdW

    Thanks for the reply

    I post a video to illustrate my question.

    While I press a strong of the run, I find that these two loops does not begin at the same time.

    While the execution of a loop, the border on the other became dark.

    It seems that during an iteration in loop 1 run, the loop2 keep waiting. and then the loop2 iterate while loop1 keep waiting.

    I do not know why this happens

    Sincerely

  • Control the time times of high and low of trains of pulses in C++

    Dear team of support of National Instruments,

    Here's what I have so far:

    I was able to generate the number of pulses (a pulse = a rising edge and front descending one) that the user has indicated via the GUI I created in Visual C++ 2008.

    I use DAQmx 8.6.

    I use the DigitalSingleChanWriter (hopefully, that's what it's called).

    I use for the synchronization of the sample, on request.  I tried to use all other types of calendar but I always get a DAQException run the error that says I can use only OnDemand calendar.

    OK, so here's the problem:

    I have a USB-6008-6009 card connected to an oscilloscope.  I know that the connection is correct, otherwise nothing would appear.  However, if I send say... 6 impulses, the delay between the first rising edge and the first falling edge is dramatically different and then the second and the third.  If I return my samples, I get an assortment of new and totally random times.  So finally, my question is "Is there a way to control the time of a great time and a bit of time?"

    I use a Compaq 2003 lap top, what is worthy of the rubbish heap.  I'm not to blame on this right away as problems that will not solve the problem at hand.  Although I understand if it's actually the problem for random times, but I would still have no way to control the time themselves.

    I hope that I don't have drug it too long, but I decided that distribute information on would be better then just a few tid bits.

    Thank you for support, that you can offer,

    Daniel

    OK, so I just returned from the lab, and this is what I got:

    I was able to control the time at the time of the high and low by using the "WriteSingleSamplePort" of the DigitalSingleChanWriter method.

    I put it in a loop that repeated many times that the user wanted impulses.

    At the beginning of the loop, I used a delay function that I wrote and delayed for a time given and then a pulse with a value of 255 and then delayed again and a pulse with a value of 0. And then restarted the loop.

    In the end, it works.

    Of course, I have another question.  I kept reducing the amount of time between two pulses (1 s, .5s, .2us and so on).  However, once I have diminished the time of secondes.01 or a millisecond, the pulses on the arrested oscilliscope becomes smaller.  It seems that past 1 millisecond Board USB-6008/6009 is unable to deal with the exigencies of the moment.  Or else the computer trash part on that I cannot deal with the exigencies of the moment.  But I believe that the Council is not at fault because it was designed for this exact sort of thing, could you tell me if there is no limitation to the Commission which prevent production of pulses in or within a period of 1 millisecond.  Thank you very much.

    Thanks for all the help,

    Daniel

    P.S. I'll stop you buggin with big messages that I promise you.

    P.P.S.  If someone wants to see my source code for their own project, I'd be more than willing to share.  Please email me or leave a message here.

  • Control and Simulation in a loop / while loop with TCP/IP reading / writing of synchronization

    Hello, I have a problem with reading TCP/IP and written in two loops. The problem is NOT to get the two loops to read and write to and from the other. This has been accomplished. My problem is when I run control and the loop simulation on my laptop and the while on a RTOS remote on the controller on-Board of LabVIEW in a remote PXI chassis, the while loop the remote system running on four 4 times faster than the loop control and simulation on my laptop. In other words, for each iteration of the loop control and simulation on my laptop, there are 4 four iterations of the while loop on the remote system. I need to know how to get a degree of kinship (1:1) with these iterations of the loop. When I run a longer simulation in real time, say 10 seconds, the control and Simulation loop begins to slow, i.e. the simulation time slows down until it is no longer in real time and the "Late Finish"? Parameter is set to true and the LED lights and continues to stay lit. At this point, the system destabilizes due to what I believe is being well sampling rate too discreet and I have to end the simulation. How can I get a ratio of one to one between the loops and also to avoid slowing the loops causing destabilization?

    To give an overview of my application, I implement a control system in a network, seen in "image2.png". This is achieved using my laptop as a subsystem 1. Reference signals are generated from the laptop and the error signal is produced. Control measures taken and the control signals are sent via TCP/IP to the remote system. Position feedback is returned, and the process repeats. My system has Core I7 Procs w / 3 GB of RAM, up to 1 GB/s speed via ethernet and LabVIEW 2011 installed with all necessary modules and networking tools. The attached VI Custom_Wireless_Controller works on my laptop. The remote system I'm working on that has the 7830 NI R Series with FPGA card. OTN runs on the PXI chassis with an enbedded controller that has networking capabilities of up to 100 MB/s via ethernet. I use the FPGA for the acquisition of data and apply control signals to my plant. The plant is the PCE twist connected to the FPGA through the cable of the ECP - RIO of NOR. Subsystem 2 is this side of the CNE. The FPGA collects position, he sends to the controller via the network, receives signals from the network drive and writes signals to the plant power amplifier that operates the plant. This process is repeated and the VI and is titled Custom_Wireless_Plant.

    I appreciate the help really and look forward for her and for any question!

    Well, the first step is to understand what you have set up right now. Your control and Simulation loop on the side of the controller is configured as 'Runga Kutta 4' and you have a loop timed on the other side. In addition, you have the primitives of TCP/IP on the control and the Simulation diagram and means he will perform (a message) on the size of each minor step, which in your case is 4.

    So, you have two options:

    1. replace the Solver side controller Runga Kutta 1 (this must synchronize loops)

    2. hold RK 4, but create a Subvi around two primitives of TCP/IP and configure from the VI to run than the major (continuous) step-size. If you do it right, you should see a 'C' on the upper right part of the VI you have created.

    Please let me know if what I said is not clear...

  • Output graphics of two loops for

    I would like to see a graph of the output generated in both loops for.

    X: steps (i x I have two loops)

    Y: Y1 should graph the polar output

    Y2 should chart the Azimuthal output

    Probably very simple to resolve/upgrade in place.  (The output file works fine).

    Thank you

    Kevin

    Good work Kevin.

    I have some suggestions for you (I don't know what it will be eventually, because then maybe they're based):

    • If the data do not change over time, you can use a graphic instead of a graph; Whatever it is, reduce the necessary processing power by updating the two parcels only once for a full run of the outside loop (see below)
    • You have a lot of indicators that are not obviously necessary (they simply out what puts out control - off 4;) Stop 5; Polar; Azimuthal, etc.).  When you submit here, the code is more it is easy to understand and faster you get an answer (minimal document also helps understand us what all is for).
    • Use the decrement vi but don't take it off 1 (reduced the increase in code).
    • Avoid strain - explicitly cast I32 to double so that no appeal should be made to the Manager of memory running (will reduce your footprint of memory of codes).
    • Written file are intensive and bays of building CU generally allocate dynamically memory - try to avoid these as much as possible.  In your VI, you can write to the file once when all iterations are complete.  This will reduce the runtime of the VI.

    Anyway, there are a whole bunch of thoughts that you probably care to hear, but I hope they have been helpful.

    Cheers, Matt

  • control the time lopp

    Hello

    I want to control my time loop but I am unable to control

    I want to integrate two entrances to stop the loop while

    When I press the stop button and when entry to data acquisition falls below 3 volts

    Please help me


  • Added a counter which keeps the total number of times where a loop has run, even if LabVIEW has been restarted.

    Hi all

    I am writing a VI to measure the data and insert into a database. The measures are controlled by a loop that runs once per minute. I want to give a unique to each measure identification number and store it too much in the database.

    To do this, I want to add a counter to this loop so that I can count the number of times that the loop is executed in total. It is, even if the VI, LabVIEW or even e PC is restarted, I want the counter to track the number of executions. If say the Edeka runs twice and then the VI is stopped and restarted, I want the number following on the counter to be three.

    Does anyone have an idea on how to do it? I'm gratefule for any help!

    Clara

    A suggestion. Can you write the last counter value in a txt file and read it all by running again the vi?

  • Can the Format date/timestring service that can control the execution of the loop to a VI?

    Can the Format date/timestring service that can control the execution of the loop to a VI?

    Example,

    a VI is running at August 25, 2010 and print a txtdata(3)) '100825.

    Then follow when time system running at 2359hrs, August 25, 2010 at 0000hrs, August 26, 2010.

    and print a txtdata(3)) '100826.

    How?

    When the system changes a new date, problems occur.


  • Measure the time between two digital pulse

    Hello

    For a non-critical calendar application, I need to measure the time interval between consecutive TTL pulses, ranging from the order of 0.5 s for a few seconds, with a low accuracy of +/-10-50ms. The interval being measured varies between the rising edge of the first pulse and the front of the next and so on.

    I have several input lines I need to deal with. Because it's a critical machination low cost, I don't want to use digital counters for each line, so I work with an acquisition of data USB6008 and have connected the input rows TTL on the digital inputs of the device. Avoiding will be sufficient.

    I found a good example of VI on discussion forums that does almost the same thing, only it uses instead of the DAQ Assistant user input. The VI works including the time the program going on in a while loop. I replaced with the DAQ Assistant output (a channel) user input in the hope that it is still work.

    When I run the program in "run once" mode, it seems to work perfectly. However, in "continuous run" it measures only a very small interval, probably just the time between two samples.  I think it has something to do with the help of a while loop in combination with the DAQ Assistant. Anyone who has any suggestions how to solve this problem?

    Thank you!

    OK... first of all, you should never use the button "run continuously.  I wish that NEITHER would be to eliminate it, but told me that it is sometimes useful for debugging.  If you want your program to run over and over again, use a while loop with a stop"" button.

    If I'm reading your code correctly, you make your initial moment, and then collect data from data acquisition.  When one of the channels is "T", you stop your loop and the end time of capture.  (By the way, why you convert your table to a cluster?  Why not just index the appropriate channel in the table directly?)

    Since you want to capture the time between two consecutive pulses, you need to know when a transition has occurred... i. e when your digital line went from F (no pulse) to T (pulse start).  This will give you your forehead.  Right now, all you're doing is looking for a value T - so you have no way of knowing if you are looking for to the previous impulse again, or a new impetus.  You also burn 100% of your processor with the way you have your programme in place.

    You need a small loop delay so that your VI is not 100% of your hogs CPU time.  Given that you can live with an accuracy of 50msec, what I suggest that you use.

    See attached picture for you give an idea of how to implement.  He will probably need some refining operations, but it should point you in the right direction.

    I hope this helps.

  • synchronization of two loops for...

    HII...

    I am using two loops for and I want each iteration for both loops start at the same time...

    in fact I want to sync between these two loops...

    so when the each iteration of the two loops will start at the same time then these will be synchronized...

    also if a loop takes more time in an iteration the other loop should suspend until the end of the iteration of the other...

    please me... thanks hlp...

    Hi samir,.

    two options:

    1: when both FOR loops should have same time iteration why not just put all the code in a loop FOR?

    2nd: when 1 is not possible/wanted, you can use a notification utility. Set the notifier early iteration of the first for a loop and wait for the signal in the second loop...

    3rd: use call loops and synchronize them...

  • LabVIEW measures two loops (cycle of Charge and discharge) of writing to a file

    Hey,.

    I was wondering if it is possible to write measures Labview two loops (stacked sequence Structure) in a single file. Currently, he prepares the loading of data in a single file and discharge data in a single file. I have to every time the data for the chart of the charge and discharge cycles combine and sometimes there are about 50 cycles and by copying and pasting is time consuming.

    I'll try to upload my vi a little

    Hi basketball.

    I thought you loops run in parallel. In your case, you can simply use the same path for your files. Change the option to 'apend to the file. After these changes, the two loops must write to the same file.

    Mike

  • Why can't set event timer in a loop

    I tried to move 4 clips in a loop and with an interval of 3 seconds. So first, I tried a loop and a timer function inside. I assumed by the loop of the timer must start and end on time. But itdidnt works. So I used another code that is long and complicated. If it worked. But why my first idea didn't work. do-while also with the first logic-why doesn't work?

    Here are the codes - s m there's clips


    THIS CODE DOES NOT WORK - I CAN'T USE TIMER SEVERAL TIMES IN A LOOP

    var arr:Array = new Array(m1,m2,m3,m4);
    trace (arr);

    var timer1:Timer = new Timer (1000.4);
    Timer1.addEventListener (TimerEvent.TIMER_COMPLETE, complete);


    var n: int = 0;
    for (var i: int = 0; i < arr.length; i ++) {}
    Timer1.start ();
    function completer(event:TimerEvent):void
    {arr [i] .x = arr [i] .x - 50 ;}
    }

    END OF WORKS DO NOT CODE.

    THIS CODE WORKS - BUT IT OF TOO LONG WAY - ISN'T THERE A SHORTCUT AS ABOVE?

    var arr:Array = new Array(m1,m2,m3,m4);
    trace (arr);


    var: timer = new Timer (1000,13);

    timer.addEventListener (TimerEvent.TIMER_COMPLETE, complete);


    var n: int =-1;
    timer.addEventListener (TimerEvent.TIMER, handler);
    timer.addEventListener (TimerEvent.TIMER_COMPLETE, complete);
    Timer.Start ();
    function handler(event:TimerEvent):void
    {n++;
    trace (n);
    If (n/3 is int){arr[n/3].x=arr[n/3].x-50 ;}
    }
    function completer(event:TimerEvent):void
    {
    trace ("OK");

    }

    tnxs

    When you use one to run in loop (or make) you do not have the ability to slow down and he will deal with everything it needs to process instantly.  Put a timer control inside it does not wait, if that was your intention.  Also put a function in a loop will no longer work.  The value of i is not known.  Do not build functions in a loop like this.

    The code that you say is too long are you not longer that the first code you tried with the loop if you compare apples to apples and remove the extra feature added to it...

    var arr:Array = new Array(m1,m2,m3,m4);
    var: timer = new Timer (1000,13);
    var n: int =-1;

    timer.addEventListener (TimerEvent.TIMER, handler);
    Timer.Start ();

    function handler(event:TimerEvent):void
    {
    n ++ ;
    If (n/3 is int){arr[n/3].x=arr[n/3].x-50 ;}
    }

    What is this solution is to create a functional loop where one item ends to deal with before the next is triggered to occur.

  • RTF model. body with two loops and custimized footer

    Hello.
    I have a rtf model with a body and a custom footer. The body has two loops. The first loop x cheques and the second for loop for x elements of each control.
    The footer must be individually for each control. Is there a possibility of variable access from the first loop of the body in the foot?

    the structure of my rtf file:_
    header: vacuum
    body:
    <? for-each: Scheck? >
    An asfdfadsfasdf: <? One? >



    Article price
    <?-foreach: point? > <? name? > <? price? >
    <? end foreach? >

    Summe: <? sum (price)? >

    <? model: footer? >
    <? One? > does not work*.
    <? end model? >


    <? split-of-page-break:? > <? end foreach? >



    footer:
    empty space
    empty space
    empty space
    empty space
    empty space
    empty space
    empty space
    empty space
    empty space
    <? Call: Footer? >






    an excerpt from my xml file:_
    < root >
    < Scheck >
    < item > < name > Kunststoffe < / name > < price > 22000 < / price > < / item >
    < item > < name > Metalle < / name > < price > 100000 < / price > < / item >
    < item > < name > Holz < / name > < price > 6000 < / price > < / item >
    < item > < name > paper < / name > < price > 100 < / price > < / item >
    < item > < name > Kunststoffe < / name > < price > 22000 < / price > < / item >
    < item > < name > Metalle < / name > < price > 100000 < / price > < / item >
    < item > < name > Holz < / name > < price > 6000 < / price > < / item >
    < item > < name > paper < / name > < price > 100 < / price > < / item >
    < item > < name > Kunststoffe < / name > < price > 22000 < / price > < / item >
    < item > < name > Metalle < / name > < price > 100000 < / price > < / item >
    < item > < name > Holz < / name > < price > 6000 < / price > < / item >
    < item > < name > paper < / name > < price > 100 < / price > < / item >
    < item > < name > Kunststoffe < / name > < price > 22000 < / price > < / item >
    < item > < name > Metalle < / name > < price > 100000 < / price > < / item >
    < item > < name > Holz < / name > < price > 6000 < / price > < / item >
    < item > < name > paper < / name > < price > 100 < / price > < / item >
    < item > < name > Kunststoffe < / name > < price > 22000 < / price > < / item >
    < item > < name > Metalle < / name > < price > 100000 < / price > < / item >
    < item > < name > Holz < / name > < price > 6000 < / price > < / item >
    < item > < name > paper < / name > < price > 100 < / price > < / item >
    < item > < name > Kunststoffe < / name > < price > 22000 < / price > < / item >
    < item > < name > Metalle < / name > < price > 100000 < / price > < / item >
    < item > < name > Holz < / name > < price > 6000 < / price > < / item >
    < item > < name > paper < / name > < price > 100 < / price > < / item >
    < item > < name > Kunststoffe < / name > < price > 22000 < / price > < / item >
    < item > < name > Metalle < / name > < price > 100000 < / price > < / item >
    < item > < name > Holz < / name > < price > 6000 < / price > < / item >
    < item > < name > paper < / name > < price > 100 < / price > < / item >
    < Payment > HUNDERTACHTUNDZWANZIGTAUSENDEINHUNDERT < / payment >
    < a > Firma1 < year >
    < / Scheck >
    < Scheck >
    < element > < name > end < / name > < price > 2000 < / price > < / item >
    < item > < name > Metalle < / name > < price > 10000 < / price > < / item >
    < item > < name > Holz < / name > < price > 600 < / price > < / item >
    < item > < name > paper < / name > < price > 10 < / price > < / item >
    < element > < name > end < / name > < price > 2000 < / price > < / item >


    Thank you for helping me!

    Edited by: user12052573 the 19.05.2010 02:00

    Hello

    change your main loop shape

    This will create a new page with a section break for each change in 'Scheck. You can remove your split sentence of page break.

    -Karine

  • For the second time in two months, all my messages in the Inbox are not there. Only the SUBJECT and the FROM is left. Tried to 'fix this folder' and lost ALL

    For the second time in two months, all my messages in the Inbox are not there. Only the SUBJECT and the FROM is left.

    Tried to 'fix this folder' and ALL - lost ALL the Inbox.

    The file is still there and works well...

    How can I stop it and what are the causes?

    Thank you all, Gabe

    If you have the file somewhere on your hard drive, export and import tools it will be important back to Thunderbird.

    https://addons.Mozilla.org/en-us/Thunderbird/addon/ImportExportTools/

    Instructions http://chrisramsden.vfast.co.uk/3_How_to_install_Add-ons_in_Thunderbird.html

Maybe you are looking for