No simultaneous while loops

Right, I have a two part program. The first generates a sine wave and exporting to an external device. The second part takes a camera input and performs calculations on the data and exports it in a spreadsheet.

The problem I have is that the data is not saved with the frame rate of the camera (17fps), but at the level of the loop the first loop (10 per second). When I run the program separately camera part, I get the full 17 per second.

I wish that both parties in a VI.

So my question is, how can I get loops to run at the same time no?

I would include my VI there a lot of complicated functions that do support any sense, but I think my question is fairly general. I'll be happy to give more details.

Thanks to anyone who can give me some advice on this.

James


Tags: NI Software

Similar Questions

  • Stopping at two simultaneously while loops in a sequence

    I'm under two loops while at the same time. A while loop is used to produce a square using the acquisition of data USB of NOR-6343 wave. The another while loop contains my main code. I make sure that my square wave while loop stops after the hand while the loop is over. I used the function "To highlight the Excution" to see if my code is excuting in order and the way I expected to and it seems to do, but when I hit the button stop the square wave while loop stops so that the main while loop always ends excuation. The main while loop takes a series of measures using the data acquisition Toolbox, so I need to make sure that the square wave is being emitted during the execution of the loop of mian.

    Currently to work around this problem, I wired a constant numberic (101) inside the large loop for a numberic out indicator. And I used a cheque codition "Equal" in the square wave while loop and set it so that this loop stops when he sees the value. This seems to work and made sure my square wave still series, while the main loop is excuting finishing. Even if it works, I want to know if there is a better way. Attached are a couple of screenshot of the loops.

    I vote for using a notification utility.  You must order the loop at the end.  Do a front panel indicator to stop a loop is not a good practice.

  • Data dependence isn't the only thing to stop while loops to run simultaneously?

    I write code to turn two stepper motors with various functions. This is my first program, so I don't know it's terrible, but I'm very interested in getting this work. I checked for the data depenecy and followed some suggestions to use local variables to solve the problem. It did not work, so now I'm trying to understand this.

    I know that all features were able to simultaneously run, but after a few changes (including put everything in a while loop to keep the program running until someone clicks the exit button), no function can currently work simultaneously.

    I'll post my code in case someone has the time to watch it (I'd really appreciate it if someone did), but I am also looking for any other problem that might be the source of the problem.

    Really, any help is greatly appreciated.

    Thanks in advance


  • What is READ the array returned by the DAQmx meter? How can I know the two functions DAQmx READ data stream in the same WHILE loop?

    I have a question about the order of execution.  In the WHILE loop, I have two things to measure, period and tension using the DAQmx READ functions for voltage and the meter.  In the end, I want to collect these data as points almost simultaneously as possible, as a pair and then send them together to another piece of code (not shown here) which them will result in some sort of command for an engine.  It would be run, and then I want to perceive the tension and the period at a time later and do the same thing.

    (1.) I'm a little confused on what the meter of the READ function is back because it's a table.  What is a picture of?  I thought that it was up to the value of the individual periods between rising edges.  The output of the counter 1 DBL d's a table. How many elements in this table, and what determines the size of this table?  Are the elements of the array the individual delays between the edges?  How many values are stored in the array by executing?   We take the AVERAGE of the last 15 items, but do not know if we are throwing some of the data or what.  How to understand the composition of this painting?  How can I change the composition of this painting?  Is it possible to measure only one period at a time, for example the time between TWO edges?

    2.) Will this WHILE loop execute as it gathers tension and a "period table ' (remains to be understood by me) by TIME running in a loop?  In particular, we want that the value of the tension associated with the value of the AVERAGE of the period "array", so we can use two data items to create orders of next control every time that the two values are reported.  The structure for the delivery of vi will be attached data in pairs like this?  I understand that one of the READING functions run not before the other function of READING in the WHILE loop.  I want that the period "means" and "strain (Volt) collected at the same pace. This vi will he?

    Thank you

    Dave

    Hi David,

    I suggest including the DAQmx Start Task function. If it does not start before the loop, it starts the loop and work very well, but it is not as fast and efficient. In the model of task status, task wiill go to run the checked each iteration of the loop and then back the time checked running when it restarts.

    The status of the task model: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/

    Kind regards

    Jason D

    Technical sales engineer

    National Instruments

  • Error with parallel while loops

    Hello

    I need to connect 6 different instruments gpib. I am using parallel loops, but the problem is when I try to open 2 or 3 Subvi simultaneously (the intstrument drivers), I just open one because of everything in a loop to run the Subvi. The program should be able to open all the Sub - VI independently.

    Can give you some ideas?

    Thank you

    A. Castillo

    Look at the detailed help for functions to notify.  Then follow the links to the examples included with LV

    Another problem that you have, whether you use your curls greedy or reporting or another technique, is to know how to stop your hand while loop.  All the subVIs must be called before the loop stops.  This is the fundamental paradigm of LV

    You will probably need to rethink your primary architecture to something that will actually do what you want.  Plan and design before your departure from the coding.  Note requirements for the program and determine which parts are dependent on othrer parts, then select a program architecture that can meet the requirements.

    Lynn

  • 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

  • How I WRITE VISA to 2 devices of a while loop?

    Hello

    I have developed a fairly complex vi that reads data from two sensors and controls SERIES written to two engine controllers.  The idea is to send the engine controls more or less "simultaneously", and they are generally not the same commands.  The two motor controls are determined by the sensor input with each iteration of the WHILE loop and subsequently sent to the VISA WRITE motor controller.  I was getting an errors and failures with the vi, then, we decided to break up and test the components individually.  In the original vi, I had two sets of VISA OPEN, WRITE, NEAR wired inside the WHILE loop and he sent two orders for both engines successfully.

    The test code I have attached here, "simple VISA speed controller rev1.vi" has the VISA sequence configured around the loop according to the advice of OR.  He suggested that the VISA OPEN and CLOSE while loop and wiring outside the VISA two WRITE such as shown.  However, in this configuration, only the command of the CHANNEL 3 runs.  The CHAIN 1 command does not run.  The string ' / 1V...» "engine controls 1, and" / 3V... " "engine controls 3.  So, by changing the 1 and 3, I order two this vi engines, but only, the chain is the first VISA WRITE running effectively, regardless of the engine is selected in the order of the string.  There is no malfunction of the motor or wiring, and I order the two motors separately using the software provided with the manufacturer of the motor controller, therefore, the hardware has been confirmed to work properly.  I use NI USB-RS232 to send the string on the motors controllers.  Motor controllers are connected in Garland, and each has a switch address so 1 engine knows how to respond to ' / 1V...» «and the engine with the value '3' address switch responds to ' / 3V...» "etc.

    The other code attached here, "simple VISA speed controller 2 motors.vi" sends the two commands at the same time.

    So, why the second VISA WRITE does not work the '... rev1.vi '?

    Thank you

    Dave

    Hello Dave,

    In accordance with our telephone conversation, that give a try.

    Joel C

    National Instruments

    Engineering applications

  • Why a while loop does not start in a flat sequence if I have another loop running in a different sequence of flat?

    Hi all

    Basically, I'm in the order of many device and regulation for that pourpose, I created a sequence of plate to do. Also, at times I have start the potentiostat measures I use too, which follows a sequence and I created a second flat sequence to do this. In a part of my experience, I want to follow the voltage and current of high voltage power supply that is located in the flat main sequence and also read the results I'm getting with the potentiostat simultaneously.

    In the main sequence, there is a constant bollean which triggers the beginning of the secondary sequence. In the framework after it contant Boolean, I have a while loop in which I read 2 analog inputs of the power supply high voltage with my USB-6218 for awhile every 100 m, my problem is that the Boolean constant actually starts the subsequence flat but when it reaches a while loop in which I continue to read the results of the potentiostat , for a reason that the operation does not start until the while loop in the main loop is not finished.

    I communicate with the software of the potentiostat through a driver made by the manufacturer.

    Is it possible to read analog inputs with USB DAQ and simultaneously read the results of the potentiostat?

    Thank you very much

    Without being able to see the code, can only speculate. My guess is that you have probably some data flow to the second loop that depends on the first loop finish.

  • calculating time in while loop

    Hello

    In one of my application that I have to wait long to get an output and simultaneously maintain a downtime. How to calculate the time above and come from the while loop. I have Labview 8.5 can anyone send me a small ex.

    Thank you

    A simple tick would work, right?... see photo.

  • 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

  • How to increase code efficiency in a while loop (using PXI5105 for sampling outside signal digitalizer)

    Theoretically, we want the PXI-5105 (digitizer) have 302 record with each record has a 1260 sample (the save operation is inside a while loop) in approximately 30ms, however we have found that for each period (30ms), the PXI5105 only perform about 10 records. It is so wired. I wonder if the operations inside the while loop consume more time (for example 3MS), so that he cannot have 302 records even the PXI-5105 have 60 M/s speed of sampling. Is it true, you can find my labview code and if possible can you give me some suggestion in the most short time of operation of the loop.

    Please find attached labview code.

    Hi g_l_g_s,

    The digitizer PXI-5105 acquires data at the speed that you specify and stores the data in its memory embedded (up to 512 MB). The data is then sent to your computer when the Multi Fetch Cluster.vi is called. In VI that you posted, you are only fetch record during each while the loop iteration. If you want to retrieve 302 records you will need to specify 302 files in the horizontal Timing.vi to configure. For more information about scanners, you might find the DevZone, hereuseful.

    To determine the amount of time it takes for each while the loop iteration, you can consider using the structure of code in the example comparison community calendar, which is located here.

  • structure of the event + while loop

    Hello, I am trying to understand how to unite two while loops in attached VI for half a day

    The first loop creates a state machine solid which reacts on each key and runs one of the structure cases. (that part works very well)

    The second loop, always generates the random number, but it stops the generation during the time where one of the structure cases events are executed. (this is the part ticky)

    Any suggestions?

    If you want your random number to stop so that the user triggered events are running, you should be able to simplify your design a lot.

    It can be done with a loop using the case of timeout.

  • Retaining the last value without a while loop

    Hello

    I'm using LabVIEW 2013. My VI is attached. I'll send in a 'Curr. Random random numbers TestPlan Row"time. I'm eager to keep his last number, whenever this VI is not called and then reset the value to its new value whenever the VI is called again and a new number has been sent. Also attached is a screenshot at the VI.

    Please note that I can't use a WHILE loop, so it must keep its value in a different way...

    Thanks in advance for any help!

    SM

    Maybe a feedback node?

  • convert loop timed to normal while loop

    How convert a while loop time normal while loop with exact same properties and performance?

    I have donot need to worry about the exact date. But it takes the timed loop time will be run similar to loop.

    And also, is there any issue encountered when we use Timed loop? problems such as that crashing exe?

    Hello

    1 kHz is the used base clock. Then, you decide to use 10 as period (dt) which is 10 ms.

    The clock is selectable in real-time systems, you can use the 1 MHz clock, giving resolution µs

    But for your needs, using 1 kHz clock with dt = 10 and using a ms of waiting with 10 connected to it is exactly the same.

  • Functions don't run when a loop running in a while loop

    Hi all

    I have a loop within a while loop. All main functions are running in this while loop. However, once the for loop executes other functions in the while loop don't work anymore until the loop for stop execution. Could someone help me with this problem? Thank you.

    Kind regards

    Nicky

    Hi Nicky,

    Ah, well I don't have much suggestions but maybe you can try with a conditional for the loop. I've attached an example. You can go through it. I don't know if it's a good idea to use this way, but again, if this can help, so I'm glad that.

    To create a condtional for loop, place a normal for loop on the block diagram, right-click and select terminal condtional.

    Kind regards

    Amine31

    (Give congratulations to good answers and Mark as a Solution If your problem is resolved)

Maybe you are looking for

  • How to close applications (e.g. camera), not only to return to the home screen?

    I would close an application, as soon as I'm done with it and not have to do so by accessing the home screen, then press during 2 seconds on the button home etc.

  • HP Officejet Pro 8600

    We bought a HP Officejet Pro 8600 a year ago and set up two laptops and a desktop computer to print to it. For the past 6 months my laptop was unable to print to it. We have tried re adding to my laptop but it says that the printer is not found. Help

  • Skype 3.0 is landscape only

    I just got the upgrade to 3.0, and now I can only use Skype in landscape mode. I'm talking not only about the video, I mean that the entire application only works in the landscape. I use my tablet in portrait mode a large part of the time, so this is

  • How can I retrieve or recover my file "Download"? I have a Windows Vista 64 - bit operating system. Thank you?

    I have Microsoft Windows Vista 64-bit operating system. I have lost my file "Download".  How retrieve/recover my file "Download"? Thank you Elliott e-mail: * address email is removed from the privacy *

  • Duplicates of blackBerry Smartphones

    Is there a way to stop my blackberry to reproduce all of my sent messages? I'm going crazy with the volume. If I'm at work during the day and send emails, a copy is sent to my blackberry and I am constantly having to clear them.