HAVE multiple AO-synchronization-2 multiple while loops

Hi all

I want to characterize my RF circuit by using an additional narcotics control and map PXI-6229. I wrote a simple VI in Labview, which is almost similar to the example, multiple-HAVE-AO-synchronization, seen in LABVIEW. According to my VI, 4 analog outputs with different offsets dc, amplitudes and phase values must be generated to my RF circuit and 2 analog inputs must be acquired by this circuit simultaneously and continuously. But the problem with my VI is that I try to observe two diagrams at the same time to see the changes in signals generated and acquired. However, I don't see the two signals simultaneously. The second while loop, which belongs to the acquisition of analog signals, does not start while the first loop generates analog signals continuously. How can I synchronize these two while loops in order to observe the two parties in the diagrams?

I have attached my VI.

Thanks in advance.

T. Eray

Hi Eray,

I will be brief and I'll keep it simple. If I understand correctly, you have trouble with the data stream in LabVIEW. When you work in LabVIEW, you must understand the order in which the blocks (functions/nodes/structers) are run in LabVIEW - stream. Each block can be executed just at the moment where there values on each entry. This means that if the 2 blocks are connected with a wire, the 2nd block waits until the first ends its execution.

In your case, that means, this 2nd loop does not execute before the first loop (with the DAQ Assistant) ends its execution, because the son comes from the inside of the first loop, then they go to some DAQmx features and then DAQmx features they go to the 2nd loop.

In principle, what you could do is to put the content of the first loop, where you prepare the signal generated in the 2nd loop. Good course without the DAQ Assistant. Instead, you can use DAQmx writing in the 2nd loop.

Kind regards

Martin

Tags: NI Hardware

Similar Questions

  • Stop the multiple while loops in the acquisition of Vision

    Hi, I want to close multiple while loops with a STOP. I use the software for the Acquisition of the Vision for the recording of multiple cameras and I would like to finish this record from all cameras simultaneously. I don't know how to do this since I am knew to LABView. I would add my VI here and maybe someone can help me.  Thank you!

    A local variable should be sufficient for your application. Read the following article:

    Parallel stop, while loops in LabVIEW with a stop switch

  • Synchronization of multiple While loops

    Hi all

    I work with 4 all in curls that are independent from each other that is, there is no data flow in one loop at the other.

    I noticed that every while loop takes different time to iterate.

    However, I want to while loops to begin and end at the same time after each iteration.

    How can I synchronize their?

    Thank you for your response.

    Concerning

    Aveo

    Hi Aveo,

    You can use a few 'occurrences', 'Notifier', or "Rendesvouz" to synchronize your loops.

    Or use timed while loops - they can work in harmony...

  • start stop multiple while loops

    I have a fairly large VI that works while several loops with the strutures case inside.

    I would like to be able to close and on all looped programmatically according to events. (complete cycle or cycle started)

    I need to store my data in a table, but whenever I turned off the while loop data I gathered is lost.

    It goes like this-measure analog voltage - put it in a digital indicator... now I want to put it in a table only once by my machine cycle.

    If the opeator push the reset button, the table is available for acquisition of report generation.

    Any help would be appreciated.

    Thank you

    It's here.

  • Sharing data between multiple while loops, competitor rates

    Hello

    I am trying to Exchange data between competitor while loops running at different speeds.  What is the recommended way to do this?    In practice, I have 12 indicators and 3 cards I would update (on screen) in the slower loop, although the data acquired and stored on disk in the fastest loop.  The image below is a simplified version of what really works my candidacy.

    I currently use local variables and shared to achieve this.  I heard however that local variables are evil because of their use of memory (data are copied instead of who passed by reference).

    Thanks for your suggestions,

    Adam

    Hi Adam,.

    Yes, here you go.

    Mike

  • Judgment of multiple while loop running at different rates to stop using the single Boolean stop button

    Hello

    I'm on the block diagram of 4 loops, do different tasks. They are independent of each other, but need to see the unique front panel - some of the wonders of labview!

    Now, I want to have a unique stop button which will in fact be a back button to return to the main screen by stopping all four loops on the block diagram. I used the stop button (switch released) with local variable to stop the three other loops. He stops the vi but it is not a good stop vi to stop properly and the grid on the performance of the front panel. Now all loops run also at different rates, so it is not necessary that all loops are stopped immediately when one of the loop is stopped. Can't really think of a better way. All the ideas!

    Kind regards

    Austin

    Variables local is ok in this case, but you will need to keep the control in switching mode (no lock).

    A better solution would be to have all the loops as a structure of event all listening value stop change. Or have the Stop value change event generate a user defined output event or similar.

    /Y

  • Code Golf: stop two while loops with guaranteed ratio iteration

    Proposal

    In the vein of the tradition of Perl, I would like to see if there is any interest to solve a few puzzles programming in LabVIEW. Can someone post a problem and define the rules to solve.

    Here's a question for beginning/intermediate to sharpen your "palette".

    Description

    With a user action, how you would stop two while loops such as the relationship between iterations is the still the same? Concrete to view this situation is to take action: both instruments use the same source of synchronization to take measures, but second divides the clock down so that it is a little slower than the first whole factor. For example, if the slower instrument is four times slower, then at the end of the VI, the slower instrument takes 100 measures the fastest instrument took 400.

    Rules

    • You can use vi.lib
    • You cannot include any other subVIs
    • Your solution should pass for loop1 interval as low as 25 ms

    Model (joint in LabVIEW 2009)

     

    If people are interested in this, then we will find a way to improve future problems. Please post your suggestions and criticisms, but only if you also post a presentation ;-)

    MacNorth wrote:

    [..]

    If we choose the first suggestions, the VI has yet to recover the data at different speeds. You can dedicate a loop for each instrument to disassociate a jitter and latency introduced by their connectivity or the inner workings. This adds a margin of safety when there is a conflict of thread and the pilot. You can also implement a simple counting as altenbach loop and renounce the multiloop complexity.
    [..]

    It is a very good point. But I wanted to make sure, you should / need to discuss the benefits, but also the disadvantages of the design. Implementation of an application is most often a process of 'special cases '. If a framework/design for a single application model does not necessarily correspond to another application.

    Designs are always strongly according to the requirements and constraints. What gives here designs will result in educational services, of course, but not necessarily as reference models for specific applications.

    Advantage of simple loop:

    • No synchronization between several loops required
    • Can easily implement any whole factor between services (quotent & function remains for a case structure

    Disadvantage of simple loop:

    • Take advantage of the multi core systems (at least not much)
    • Can easily run out of the time constraints (material not "not responding" enough, fast manipulation of data takes too long,...)
    • Code will accumulate within the structures of the case, where the readability could suff

    The advantage of multiple loops:

    • See essentially the disadvantages of single loop (several loops solve those)

    Disadvantage of multiple loops:

    • More complex, especially for the sync switch (not beginner friendly, requires a more/better design)
    • May contain easily questions source such as race conditions and locks

    A little side note:

    Even if the equipment works different acquisition rate, this does not necessarily that the software must use different rates for data extraction. You can use the same model of an hour, but get X times more values for the task faster than the slower running. The 'only' thing to care of are the sizes of buffers and bottlenecks in the data transfer.

    MacNorth wrote:

    [..] The best advice published OR shutter multiple while loops (https://www.google.com/search?q=labview+stop+multiple+while+loops) are laughable (and the 'solution' in my model). [..]

    No, it's not laughable. For many applications, this approach to shutter at the same time several loops running is OK. The constraint: only for simple parallel running loops.

    More complex loops (producer/consumer and similar) with the more complex data relationship ships require more valiant approaches such as queues, declaring events or user.

    My 5 cents only,

    Norbert

  • While loops inside while loops, how to stop?

    Hey, I'm confused with a simpler question to multiple while loops. My goal: stop or pylone2, just jump out of the small loop and stay in the big one. and if I click on stop 3. the entire program would cease... How can I do this? The following script does not at all... Thanks in advance!

     

    Yes you are completely right Mike... now, I solved the problem with another structure of the event and the Boolean variable local... Thank you very much!

  • while loop

    Hi all

    I have a case structure in a while loop and the loop while is another case structure 'TRUE' case. the internal structure of the housing end if all cases the while loop was arrested and now I 'FALSE' case of CASE of the EXTERNAL STRUCTURE. Now, I was able to reset the indicators/controls in the while loop to their default values. Please suggest me your ideas. Thanks in advance.

    In false outer case, you can use reset to default property node, for example

    /Y

  • stop a while loop in slot - VI

    Hello

    I have a Subvi, which has a while loop and it is in my main vi in a sequence structure, I want to stop the loop inside the Subvi using a Boolean value in primary vi.

    I tried global variable, but it has not worked since the stop in my main vi botton is not updated when the program is running...

    could you please help me?

    I appreciate any ideas

    Thank you

    Darya

    As a general rule, avoid using Structures of the sequence.  The reason being that they are violating data streams.  If you can control the flow of data with threads, it is the most effective way to make your program work.  The idea to get rid of your sequence structures is therefore to make an another Subvi to your expectation that also has an error and output error.  Then, you can use the cluster of error to force execution.

    And while loops inside the subVIs is a common beginner problem.  If you do not order when the loop ends based on a front panel of the mainVI control, then the loop must be in the main VI.

    I hope it's a good summary of what was said.

  • How can I update the values out of while loop

    The LabView waveform chart updates every 0.1 sec.

    When a user clicks on a button, I want to LabVIEW to wait 5 sec and beep for 5 sec.

    Meanwhile, it should be to update permanently the wavefrorm graph.

    When I have the structure case inside the while loop, it interferes with the updates of the waveform graph.

    When I structure case outside the while loop, the structure of the case is never executed.

    What can I do?

    I thought about it using the example of design of producer/consumer model.

    http://decibel.NI.com/content/docs/doc-5404

    It allows a variable that is updated in a while loop to update outside the while loop while the loop is running.

  • URGENT::opening multiple files - i have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    bbmChatDB of public database;

    public static FileConnection fconnRead = null;
    public static String fileReadData = "";
    public static InputStream is = null;
    data Byte [] = null;
    DataInputStream is = null;

    Here is my code...

    I have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    try {}

    FileConnection fc = Connector.open("file:///store/home/user/documents/BSM/") (FileConnection); "

    If (fc.exists ()) {}

    Enumeration e = fc.list ();

    While (e.hasMoreElements ()) {}

    System.out.println ("files are:" + (String) e.nextElement ());

    play this file
    StringBuffer stringBuff = new StringBuffer();
    try {}
    System.out.println ("opening file")-;
    System.out.println ("file name is:" + (String) e.nextElement ());
    fconnRead = Connector.open("file:///store/home/user/documents/BSM/(String)e.nextElement(),Connector.READ_WRITE) (FileConnection);
    System.out.println ("data length")-;
    If (fconnRead.exists ()) {}
    is = fconnRead.openDataInputStream ();
    data = IOUtilities.streamToBytes (is);
    Ddd = new String string (data);
    fileReadData = ddd.toString ();
    System.out.println ("length of data:" + fileReadData.length ());
    System.out.println ("read data :" + fileReadData);

    }

    } catch (IOException ee) {}
    ee.printStackTrace ();
    System.out.println ("Exception in the read data :")
    + ee.getMessage ());
    }

    }
    }

    } catch (IOException e) {}

    e.printStackTrace ();
    }

    {Finally

    try {}
    If (is! = null) {}
    is. Close();
    }
    System.out.println ("is closed...");
    } catch (IOException e1) {}

    E1. PrintStackTrace();
    }

    If (fconnRead! = null) {}
    try {}
    fconnRead.close ();
    } catch (Exception e) {}
    System.out.println (try ());
    }

    }

    }

    You can recode this treatment so that it uses only:

    e.nextElement ())

    Once a loop iteration.

    Directly at the start saying something like:

    String fileName = e.nextElement ());

    and use fileName everywhere in your loop.

    Also be aware that printStackTrace() will do nothing in your situation, it only works if you catch Throwable.  So make sure you something output all your catches exception and also have a catch (Throwable t) to catch the things you miss, as follows:

    {} catch (Throwable t)

    t.printStackTrace ();

    System.out.println ("Eception exception:" + t.toString ());

    }

    I think your code is thrown an exception and you don't see it.

  • What is the best way to run multiple instances of the class containing infinite while loop?

    Hello

    I have a several instances of the class (say a, b, c,...) that have the same parent and I want to run the same methods overridden to all instances in parallel.

    For example:

    a.init ()-> a.run ()-> a.stop ()-> a.run ()-> a.stop ()->

    b.init ()-> b.run ()-> b.stop ()->->->

    c.init() ->           ->             -> c.run() ->               -> c.stop()

    ...

    See the attachment for more details.

    The problems are now:

    1. the 'run' - method does not return until it receives the external trigger

    2. everything to run methods return in a different time

    1 chip means I can't use autoindexed for loop because in this case b.run () will have to wait before the end of a.run (), right? Is it possible to run to the loop in parallel?

    2 chip means that an object must be able to run and stop independently from others.

    What is the most elegant solution? The solution copy - paste in the attachment works for 3 instances, but there are currently 10 and more is coming.

    Juha

    In fact, what I wanted to know was "how to add the 'P' loop '... Easy, after you ask the right question.

    In the attachment, there is a test.vi that has two numerical indicators in a certain time-infinite loops. If I leave the parallelism, the two digital are incremented infinitely. If I don't allow parallelism, only the first is incremented (he never leaves the infinite while loop).

    To solve my original problem, I can make an init-start-stop branch within a loop-parallel-indexing for and make sure that there are the same number of instances of loop as there are objects in my array of objects (object array is an autoindexed in the loop for).

    Also good point about the vis environment. I should also add that.

  • 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...

  • I have been using the functionality of Firefox in which I could have multiple sets of tabs open, but only see the game I was working with. I have updated and now the functionality is Gone

    I have been using the functionality of Firefox in which I could have multiple sets of tabs open, but only see the game I was working with. I have updated and now the feature disappeared. I had a small icon on the top right of my toolbar. I used it all the time to keep windows separated for financial, plans to travel items, news, etc.. Has it been removed from Firefox?

    Hello

    The feature of tab groups is always present. You can try with the button right of the + after the last tab and Customize. If the icon is hidden behind the other, or if it is available inside the mini window customize, you can put it back. If the problem persists, you can also try of reset toolbars and controls: and start to make changes and restart in Safe Mode screen.

Maybe you are looking for