While parallel loops is not running

Hello, I am a program to run a room, and I run in to trouble. I have 5 all in curls that are supposed to be running in the main VI connected by queues. The first is to check the front panel for events. As readers the following two, who are responsible to issue commands to run the House, or give orders, to check the data collected. The fourth is running the House, and give orders, to write the data. Writing takes place in the last loop. After that all loops fire the first time, it seems that only the first and the last still to run. Could someone take a look and tell me where I was wrong?  I'm still very new to labview, so I don't know that it is a small mistake or another.

Thank you

Simon

I think I found my problem. I had to add another element to the queue that is identical to the loop, if I wanted to keep it in that State. I'm still working through it, but I've corrected a few curls up to now. Thanks for the advice everyone.

Kind regards
Simon

Tags: NI Software

Similar Questions

  • Two while loops in parallel - 2 does not run

    Hello

    In this simple configuration, there are 2 while loops:

    • 1st - for installation
    • 2nd - operation, where variable X increments

    The problem is: after 1st run variable X is not reset to X 0, if VI stops immediately after it starts.

    The reason - 2nd loop is not executed, X 0 if value is not propagated to X.

    Thanks in advance

    Pavel

    You want to first one case installation and after perform the different number of steps, based on the parameters for installation.

    A perfect place for one State (a single necessary loop usually) machine. You need an idle state when waiting for user input. After that the user starts the initialization state, which calculates the number of steps for other States required. At the end the system automatically moves back to the idle state, and waiting for the user to install and launch another race.

    No need to sequence meal structure at all. With a state machine, you can just do much more (like abandonment of sequence to Midway, is not possible with the structures of the sequence)

  • SR400 while the loop does not work

    Hello

    I'm using LabVIEW for control SR400 through a GPIB card.

    I use SR400 to count the number of signal in a second, wait 0.05 s, then again count the signal once, wait 0.05 s once again, and so on.

    However, the while loop didn't iterate. When I started the program, it is only once.

    In execution of highlight mode, when an iteration is finished, he waited a long period starting the next. In normal mode, it doesn't have to iterate.

    Also when I clicked the stop button, it's been clicked. However when I wrote a very simple program, the stop button worked normally.

    In any case the button issue is not very important. I don't care that the program iterates forever or not. I just want to iterate.

    I searched the jury and had not could not any related problem.

    Is it better to attach my VI? The VI is in my computer lab.

    Thank you very much!

    This code just feels bad.

    (No real management mistakes, deep, stacked sequences FOR lines that are wired to iterate through only once, controls on the right and right to left, wiring weird code on average the last 10 items (Hint: means ptbypt with a length of 10 sample he would!).) If you want to use the wire of the error, the sequences would not even necessary)

    If the stop button does not reset, it means that the iteration of the loop does not terminate. It can fill in only if the two structures of the sequence ends.

    Have you tried running in execution, emphasizing fashion while looking at the diagram? Probably one of the communications is at a standstill. For example, the instrument sends really 6 bytes at the end? When you set the overall timeout and what is it?

  • While the loop does not stop until 2 more clicks

    I must say that I'm really not familiar with LV, but Im learning.

    So why is that after I clicked on low stop, I had to click my OK button twice, then my program stopped. Why can't it stop immediately?

    Furthermore, if I want to do some of the dice to table, which wire do I missed?

    Thank you!

    Hi RawtoLV,

    You have a while loop in loop a while. When you run the other while the loop stops when you press the stop button, the inner circle while loop always executes. Since your OK button use latch release, what I noticed is that when you pressed the OK button, it quickly into position from true to false, which never stopped during the operation of loop (maybe because of the wait). Can I ask what are you actually doing with the structure of sequence?

    I would suggest using the event structure in place (http://zone.ni.com/reference/en-XX/help/371361K-01/glang/event_structure/):

    Here are some information about the structure of the event:

    http://www.NI.com/white-paper/3331/en/

    http://www.YouTube.com/watch?v=8eO64fo3Pho

    Warm greetings,

    Lennard.C

  • JavaScript:if loop does not run...

    IM new to javascript.


    < script type = "text/javascript" >
    function getEmployeeInfo (filter)
    {
    var xml = null;
    get var = new htmldb_Get (null, $v ('pFlowId'), 'APPLICATION_PROCESS is GET_EMPLOYEE_INFO', 0);
    Get.Add ('P2_EMPNO', filter.value);
    RET = get.get ('XML'); - here ret value is "null", I used "alert();" to base the value of 'ret '.
    If (ret) - do not run (im confused with if condition which is 'if (ret)' lie here?)
    {
    var enameItems = ret.getElementsByTagName ("ENAME");
    If (enameItems)
    {
    ename var = document.getElementById ("P2_ENAME");
    var enamedisplay = document.getElementById ("P2_ENAME_DISPLAY");
    Ename.Value = enameItems [0] .getAttribute ("VALUE");
    enamedisplay.innerHTML = enameItems [0] .getAttribute ("VALUE");
    }
    var jobItems = ret.getElementsByTagName ("JOB");

    If (jobItems)
    {
    use var = document.getElementById ("P2_JOB");
    var jobdisplay = document.getElementById ("P2_JOB_DISPLAY");
    Job.Value = jobItems [0] .getAttribute ("VALUE");
    jobdisplay.innerHTML = jobItems [0] .getAttribute ("VALUE");
    }
    }
    get = null;
    }
    < /script >

    RET = get.get ('XML'); - here ret value is "null", I used "alert();" to base the value of 'ret '.

    If it always returns NULL, then you have a problem with the ondemand process: GET_EMPLOYEE_INFO, or that you have not set the session state from any page element used in the process.

    If (ret) - do not run (im confused with if condition which is 'if (ret)' lie here?)

    I guess that the intention here is to make the treatment (element assign the result XML ajax) JS only when the HTTP request returns a non-zero

    Its not not run because it is null as you mentioned in your question.

    You can start debugging by ensuring that the ondemand process returns a non-null;
    Try using ht.p (variable) and check if the values are properly available in the ondemand process (remove them after that you should be to return a XML, it would not interfere with its structure), once the data structure and the result is what you want, the rest of the JS that set the debug settings.

  • While the loop does not stop within a structure of business

    Hi all

    I have a business structure that works an engine to a certain PWM when my metal detector does not give an amount greater than the threshold that is ' false '. The motor is controlled by a PI controller so a while loop is used inside the false state. When my metal detector exceeds the threshold I want the "true state" to perform but which does not occur. the entire program is a while loop which aims essentially to maintain the operation of the metal detector. How can I make the State of the switch works.

    Once you get the code is trapped inside the inside while loop, it will never be a Boolean wire change because change is outside. All you need is a loop that contains a structure of housing. Run your program with execution highlighting to get a better understanding of the flow of data.

  • While the loop does not stop when the two values are equal using equal to comparitor

    Hello world

    I have a really, really strange bug. I have a LabVIEW VI that change a chain on a power supply. I have a start and a stop voltage and use a while loop to increment the device. For example if I want to scan from 1, 2V to 2.2 V in 0.2 V incremements, the program will end when "The current tension" = "stop the tension." And it works very well!

    However, when I start - 3 V and want to stop to say-0.8 (new in 0.2 V incremements) the program does not stop when "The current tension" = "stop the tension." I checked with the probe close to what should be the end of the race and - 0.8 V goes both of the entries ' equal to ' comaprison operator, but that his can't trigger a real result.

    It's very strange for me. Espeically as if I'm going - 0.8 V to-2 V but decrement of-0.2 V, the program stops correctly!

    I am very confused!

    See you soon!

    Search on: comparison of floating-point numbers

    The second thread is particularly relevant. This discussion was 2009, but you can find that the same "bug" being reported to enter the end of the 1980s.

    Mike...

  • What happens when you specify multiple iterations of the parallel loop that you have processors?

    I have an app that does the same things together up to 10 times for different material resources. For example, I have a list of 10 COM ports I want to send orders series. I want that they be executed as close to synchronous as possible, but up to 200 ms sync would be acceptable. Currently, I use a loop set up to 10 parallel iterations and assume that LabVIEW will juggle processors according to the needs, the iterations run it as simultaneously as possible. Experimentally, LabVIEW indeed seems to create 10 parallel loops, even when running on a computer with only 4 logical processors, otherwise you go 10-element inside the loop would only be not able to complete, right?

    My question is, I'm doing something verboten with my number of iterations of the loop? According to the help of LabVIEW for loop iteration parallelism dialog box: "If you plan to distribute the VI on multiple computers, set number of instances of parallel loop generated equal to the maximum number of logical processors, you wait for one of these computers contain never.» Clearly I'm violating this opinion and yet it seems to work. My performance will essentially be the same as if I had 10 blocks of code in parallel on the block diagram?

    "Reading'how many Threads don't LabVIEW allocates?" links to this page, it seems that, at worst, LabVIEW is hungry for thread and switching of threads between iterations, but my short demand slowing down enough to accommodate this suboptimal situation. At best, LabVIEW has allocated 4 threads per the enforcement system, so as long as I have at least 3 processors, there are at least more son than the parallelized loop iterations. It's all a bit confusing.

    RnDMonkey wrote:

    I have an app that does the same things together up to 10 times for different material resources. For example, I have a list of 10 COM ports I want to send orders series. I want that they be executed as close to synchronous as possible, but up to 200 ms sync would be acceptable. Currently, I use a loop set up to 10 parallel iterations and assume that LabVIEW will juggle processors according to the needs, the iterations run it as simultaneously as possible. Experimentally, LabVIEW indeed seems to create 10 parallel loops, even when running on a computer with only 4 logical processors, otherwise you go 10-element inside the loop would only be not able to complete, right?

    My question is, I'm doing something verboten with my number of iterations of the loop? According to the help of LabVIEW for loop iteration parallelism dialog box: "If you plan to distribute the VI on multiple computers, set number of instances of parallel loop generated equal to the maximum number of logical processors, you wait for one of these computers contain never.» Clearly I'm violating this opinion and yet it seems to work. My performance will essentially be the same as if I had 10 blocks of code in parallel on the block diagram?

    "Reading'how many Threads don't LabVIEW allocates?" links to this page, it seems that, at worst, LabVIEW is hungry for thread and switching of threads between iterations, but my short demand slowing down enough to accommodate this suboptimal situation. At best, LabVIEW has allocated 4 threads per the enforcement system, so as long as I have at least 3 processors, there are at least more son than the parallelized loop iterations. It's all a bit confusing.

    In this case (where you're interacting with the external hardware and have an appointment) there will be a delay of inheirant at each iteration.  THUS, "Oversubscibing" or by allowing the parallel proceedings as logical processors, actually improves performance by running another period of waiting during the iteration.  In fact, you're not "Violate the advice" of oversubscibing.  You use this technique correctly! Just may not have read about this.  See Esp PP 4

  • With the help of VISA Write in parallel loops (multithreading)

    Hello

    I got the idea to set up four parallel loops on a quad core with four EHR via serial port independently. I use the PXI-8430/8 and I was told that an independent operation of ports is possible.

    What I did was simply to put in place four parallel for loops consisting only of a single entry VISA. With the help of the Tools > profile > find parallelizable loops, they gave me the following warning

    This loop For may or may not be safe to parallelize. Warning (s):
    -A node in the loop For can have side effects.

    This means, that the pilot VISA screws are not suitable for multithreading? With the help of LV2010

    Thanks for your comments!

    See you soon

    Oli

    Here's some good reading on paralleled for loops.

    Regarding the caveat, it's just that - a warning. If you write commands on a device and orders must be received in the order then you cannot parallelize the loop. If the order does not matter then go ahead. But in the case of VISA wrote that a parallelized loop going not buy you anything. They are intended for operations of calculation intnesive.

    Just stick to four loops.

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

  • While in a while loop loop will not stop running

    HY, I have a while loop and hand inside the other 2 If. The attached VI supposed to work like this:

    1. define the input data

    2 - Press START to "animate" the data in the chart

    3 - Press STOP to stop the animation

    and the hand while the loop must travel 1-3 until you type EXIT, and then it stops the program.

    The problem is the EXIT doesen't button stops the program, not always. Sometimes, it sounds like the key EXIT "JAMS" and stops the program, when I hit the STOP button.

    You have a solution to my problem, or a better way to do this?

    Thanks for the help in advance!

  • For parallel loops run on hearts of dedicated processors?

    I don't think that this is the case; My confusion is due to the fact that the literature regarding this structure addresses using the maximum number of cores the computer in which this codemay run in the dialog box for parallelism but also loop iteration using the CPU Information function to determine the number of instances to parallelize. I suspect that parallel loops For will first of all be decomposed into Tufts/tasks of iteration which will be either in versatile collaboration & and/or multithreaded in a system of priority of execution before they ever get to be mapped to hearts dedicated instance. Is this correct? -literature, I want to talk about is Improving Performance with loops parallel http://zone.ni.com/devzone/cda/tut/p/id/9393, under the guidance of Performance or the help of LabVIEW (multiprocessing and Hyperthreading in LabVIEW). I don't see how this information applies to how the loop bodies parallelized and executed. I hope someone can enlighten me and perhaps others to read these documents.

    Thank you!

    jorgeinSD, thanks for the insightful question. Your second option is correct. Each instance of a parallel loop is in a different bouquet and schedules of delivery system of these Tufts between the available threads. LabVIEW does not bind son to cores for the parallel loop, so threads can switch between the nuclei they run.

    Mary Fletcher

    Software engineer

    LabVIEW R & D

  • Why this parallel DML statement is not run as fast as DBMS_PARALLEL_EXECUTE?

    Hello

    I'm on the database Oracle Enterprise Edition, Linux RH 11.2.0.3. I have a pl/sql function that accepts a sdo_geometry (essentially an object with a few varrays), round each number in one of the varrays and retransmits the object.  Here is a version of the function, simplified slightly for brevity:

    create or replace round_coordinates (p_geometry in sdo_geometry, p_round_factor in numbers)

    return sdo_geometry parallel_enable

    is

    sdo_geometry v_geometry: = p_geometry;

    v_ordinates sdo_ordinate_array;

    Start

    v_ordinates: = p_geometry.sdo_ordinates;

    for me in v_ordinates.first... loop of v_ordinates. Last

    v_ordinates (i): = round (v_ordinates (i), p_round_factor);

    end loop;

    Return sdo_geometry (v_geometry.sdo_gtype, v_geometry.sdo_srid, v_geometry.sdo_point, v_geometry.sdo_elem_info, v_ordinates);

    end round_coordinates;

    /

    I need to perform this function as an update DML on hundreds of millions of sdo_geometry objects and according to my estimates it will take weeks.  So, I want to run in parallel.

    The data is in a bunch of tables, some with lines of k ~ 100 more with millions of people.  My preference is to browse the tables and run an update such as:

    Update < table > set geometry = round_coordinates (geometry);

    But I would like to operate in parallel, so I thought that I would allow the DML parallel to the session with

    ALTER session enable parallel dml.

    ALTER table < table > parallel;

    , and then run the update by: Update / * + parallel * / < table > set geometry = round_coordinates (geometry);

    When I do that, I can see a v$ px_session 16 parallel slaves are bent and the plan of the explanation is the following:

    ------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |    TQ | IN-OUT | PQ Distrib.

    ------------------------------------------------------------------------------------------------------------------

    |   0 | UPDATE STATEMENT.             | 10000 |   468K |    43 (0) | 00:00:01 |        |      |            |

    |   1.  UPDATE | SMALL_10000 |       |       |            |          |        |      |            |

    |   2.   COORDINATOR OF PX |             |       |       |            |          |        |      |            |

    |   3.    PX SEND QC (RANDOM). : TQ10000 | 10000 |   468K |    43 (0) | 00:00:01 |  Q1 00 | P > S | QC (RAND) |

    |   4.     ITERATOR BLOCK PX |             | 10000 |   468K |    43 (0) | 00:00:01 |  Q1 00 | ISSUE |            |

    |   5.      TABLE ACCESS FULL | SMALL_10000 | 10000 |   468K |    43 (0) | 00:00:01 |  Q1 00 | SVCP |            |

    ------------------------------------------------------------------------------------------------------------------

    But the update statement on my test data set does not any more quickly - it takes a few seconds more series that suggests General fresh extra expectations for the management of parallel slaves that's happened, but they did not have the query run faster.


    I tried to use the dbms_parallel_execute with the create_chunks_by_rowid option package and parallel_level = 16 With that I get at the end just over 1/16th of the time that it takes to run in series!

    That's fine, so I have the option dbms_parallel_execute, but I would like to understand why the query with the parallel flag does not expedite things.

    Any ideas?

    Thank you

    John

    It may be that the call to the PL/SQL function slows down things. Did you think to do in pure SQL?

    Here is an example:

    update test_sdo tsd
       set tsd.geometry.sdo_ordinates =
           (select cast(collect(round(t2.column_value)) as sdo_ordinate_array)
              from test_sdo t1
                  ,table(t1.geometry.sdo_ordinates) t2
             where t1.id = tsd.id)
    

    Post edited by: PaulHorth

    BTW: You can parallelize the query part of the SQL but not updating, it's documentation:

    "Parallel DML can be done on tables with columns object provided that the columns of the object are not accessible."

  • Parallel loops in a Subvi RT in real-time and not

    Hi all

    I seem to remember learning (obviously not well enough) on a cRIO (vxworks) that if there were a Subvi with two parallel loops and loop fell asleep due to a wait function the other loop also be forced to sleep as they are executed in the same thread.

    I have a 2 questions:

    (1) is this completely wrong?

    (2) is also true on a normal windows OS and if so how can I test it because I tried and couldn't seem to see this behavior?

    Kind regards

    Steve.

    Hello

    (1) is this completely wrong?

    Not completely. If you have to screw (or loops) set up as a time critical (priority) and the other goes to sleep, the entire wire goes to sleep, so also the other VI (or loop) goes to sleep. But notice that it is only when configured as critical moment!

    (2) is also true on a normal windows OS and if so how can I test it because I tried and couldn't seem to see this behavior?

    Lol if a standby under Windows, just the loop loop sleeps.

    Christian

  • Having trouble getting Boolean button While loop is not updated

    Hello world

    I'm trying to understand how continuous image capture works. So, I tried to implement a simple while loop with a button "continuous Capture". It seems that when the "Continuous Capture" button becomes false, the while loop could not update and stop. No idea how to solve this problem? Thanks in advance.

    Kind regards

    Han Yen

    Move Boolean Capture next to the loop of inter 2.

Maybe you are looking for