LabVIEW freezes randomly while loop

Hello world

I'm relatively new to LabView, I like to think that I learned a lot through trial and error and read this forum, but I am confused by something here. I hope someone out there has an idea.

I have a program that controls a pump. I am communicating via a USB-serial cable. In general, how my program works is that it sends a command to the pump, and then he immediately starts querying the pump for its status. I have the query in a loop that repeats every second. While the pump is moving it returns the busy status, and when it finishes it returns to the ready state. When the program receives the ready status, it exits the application and send the following command.

I have a Subvi, which questions the pump, and I use it in many places in my program. The problem is that all this works 95% of the time, 5% of the time the loop freezes for some reason any. The timing of this gel, location in the main program and the number of iterations of the loop that occur before the Frost are all random.

I've attached pictures of the front panel and block diagram of the Subvi. The loop on the left is querying the pump and the Subvi in the Subvi labelled 2 is communication with the pump on the VISA. When I realized that the program has been stuck in the loop, I added the second loop (right) as a kind of "time out". If the program is blocked at this point for a specified number of seconds, it must end the left loop. But it happens, right loop stops but never left, we read the true statement and sticking. LabView itself is not frozen because I can go and the sons of the probe.

Again, it is really difficult to solve because it occurs only 5% of the time or less. If anyone has any ideas as to why this is happening, I would be very grateful. I didn't post the real VI here would be useful, but please let me know if you want to take a peek.

Thank you.

PS Ce happened when executing the EXE in LabView environment

Opening and closing of the VISA session several times are generally not a good idea.  It is preferable to configure the port outside the loop, do th ereads and written inside the loop, and then close the session after the end of the loop.  I would not be surprised if your serial port gets frozen due to the frequent opens and closes.

In the end, you should learn about state machines.  This architecture would be appropriate for this type of program.

Lynn

Tags: NI Software

Similar Questions

  • CPU utilization while loop

    Manual LabVIEW declare a while loop must always contain a "wait for ms" vi to unlock the task for this period.

    However, I thought that it the same fate if I use the same timeout ms for the timeout of a structure event inside the while loop

    and omit the "wait for ms" vi.

    Unfortunately the time-out of the structure of the event does not seem to unlock the task so that the façade reacts very inert in this case, even if it reacts
    prompt in either case.

    Does anyone have an explanation more in depth of this behavior?


  • 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

  • LabVIEW FPGA while loop (first call? (VI) question

    Hi gentlemen!

    I am creating a LabVIEW FPGA VI appearing in a WHILE loop. He has a first call? VI in which, in the first occurrence of the loop, a variable must be initialized to some value. However, when I incorporate the VI in the FPGA, it would seem that the first call? VI has not been called. I also tried this implementation through registers at offset where the registry is initialized outside of the WHILE loop. However, the result is always the same. May I ask how the LabVIEW FPGA functions when it comes to everything IN a loop? Thank you very much!

    For some reason that I don't me remember not I avoided the use of FPGA FirstCall and instead, I use a change sign boolean, son of genuine in the terminal, on the left and a fake in the while loop to the right Terminal. As a result, you get a true for the first iteration only, in exactly in the same way that the function of FirstCall. It could even use fewer resources on the FPGA?

  • Is it possible to execute a loop For independently within a while loop in LabVIEW 2013?

    In my program, I want to run a loop For inside a while loop and run independently, at their own rate of execution.  A test, I wrote a simple VI with a while loop with 1 second calendar and in this I inserted a loop For with 3 of a second.  I created indicators for the two terminals of the iteration.  When executing the VI, I found the while loop waiting for loop For run N times before the while loop is executed again.  I also found that sometimes the first iteration of the loop For ends at 1 second instead of 3 seconds and the STOP button to complete execution of the While loop does not always work.

    This is the expected behavior. LabVIEW is the language of s DATA stream. If you want the curls to be independent, it can be data forcing addictive so use separate loops.

  • How to acquire a position of the data series in a while loop that generate a position once a time in labview?

    My program is complete in a while loop. Once it runs, it will use kinect to keep my data of position of the head, so it will generate a position once. I want to reach 5 positions and can calculate 3 speed and acceleration 2. How can I get 5 times while it generates 1 time?

    If your data are made at the edge of the while loop and you right-click where the wire exits the while loop, you can select "Enable Indexing" that will produce a table of the data received as large as the number of times in the loop. You can also check the "examples: help find ' ' Producer/consumer', which will allow your receiver (producer) loop to get the data and send it to a processing loop (consumer).

  • Use of LabView delay in a while loop instead of use the inherent instrument of time loop.

    I have a lmg500 sez I use. It has the possibility of continuous measurement of data, with a cycle of user control loop (always using a while loop but the delay comes from the instrument). The problem is that the time of the loop is not constant. Can I use a very short time (100ms) as the cycle of the instrument of the time, but use a longer period in time loop collect data?

    I know that many instrument offers the same capabilities, so the issue is relevant to each of them.

    Thanks for any help

    You're not going to be accurate with Windows. The time between samples should be that you have programmed the instrument (i.e. the time between each value in the table 1 d) but the rate of the iteration of a while loop always will be the subject of a jig on a bone not real-time.

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

  • read from measure Makefile slow while loop

    Hello

    I'm using Labview for controlling a lower Member brace. What I did is to save in a spreadsheet, the values of two angles in a random walk. The control template is done well because I tested it by giving two sine waves with different frequencies and the system responds by following paths. The problems begin when instead of sine waves, I put the experimental values of the read angles and "the file of the measurement reading. I can't change the speed of the system by varying the time while loop. The speed is always the same.

    In the vi attached is possible to find this piece in the upper left corner of the while loop.

    I use windows 7, 2013 and cDaq-9178 labview.

    Thank you in advance for the answer.

    Best,

    Flavio


  • How to pause and resume a while loop with a button

    Hi all!

    I'm back in LabVIEW, after only a few years and I cannot understand, what at first sight seems to be a simple problem!

    All I want to do is have a while loop in which, for the purposes of illustration, I have the 'random number from 0-1' function on the inside, and I want to be able to pause and resume this help from a button. There are a few other posts on the forum that are very similar and do use "event structures. The problem I encounter is that I can get the genarator random number to start the generation but the break will not stop this!

    I have the feeling that I made a stupid mistake - but I can't understand or google my way out the problem! I enclose my solution so far!

    See you soon!

    I did an example (you can drag and drop the image into a labview diagram > = 2014)

    hope this helps (I just did 2 excerpts, it's the same program)

  • dispplaying data on the graph of waveform inside/outside while loop

    I create a vi using the random number generator, entering the number in the function(express>>arithmateic>>maths>>trig>>sine) fishing and connect the output of the function sine waveforms. Table of waveform show no problem. If I replace the with graphic waveform table, I get an error that the source type is differenct type of sink. I then put waveform chart outside loop everything hoping that tunnel would act as a table, but still I get the same error. I then put build table palette between all border and loop waveform graph which is placed outside the while loop. I get no error, but no data is displayed on the graph of a waveform. Theoretically, if I press stop I would see a distorted sine wave on the waveform graph, but this doesn't seem to be the case. I am wondering how to view data on the graph of a waveform in such cases!

    Thank you in advance for reading and help!

    See you soon

    First of all, you can take a part of the basis of LabVIEW tutorials.

    Since you need to work with a chart and it is the preferred method to display data point by point, I don't know why you try to use a chart. In any case, you cannot use all simply a table of generation because that would be just the result of the last iteration and your graph indicates it is a single point. If you activate autoindexing, then you get all the values, but not before the end of the loop. If you were to use a shift register and the build dashboard, you might place the graphic inside the loop, but then you would face performance issues that the table would grow uncontrollably.

  • Table of while loop

    Hello

    How can I get the table while loop in the attachment?

    Any help will be appreciated.

    [Running LabView 8.5].

    Thank you

    hiNi.

    What do you mean by "get a picture?"  You get a table that will have a random number in the 1st item and the number 10 as the second element.

    You try to build a table of values that contain information on all iterations?  Then right-click on the tunnel and turn on automatic indexing.

  • XPS 15 9550 freezes randomly (on any OS)

    Hello, I would really appreciate any help that anyone can give me.

    My situation is this: I got a new Dell XPS 15 9550 two weeks ago. It was working fine until last night when suddenly the screen went black. I was just using Facebook. The computer was still but does not. He would not press the power button. So I held the power button for 5 seconds, rebooted and he always used and it would never happen again. Finally, after trying different solutions, I went for the reinstallation of Windows 10.

    While Windows 10 has been reinstalled it happened again. All of a sudden the screen went black and stayed like that forever. I had to shut off again. Now, I have no OS and computer stuck in a boot loop. Fortunately, I had a USB bootable Ubuntu Linux laying around. So I plugged in and tried to install Ubuntu

    But the computer also freezes randomly when trying to install Ubuntu. Sometimes, it's not even lasted 10 seconds before freezing, sometimes it takes a minute. The only difference is that with Ubuntu screen freezes on the last image, whereas with Windows, the screen freezes black.

    So I ran MemTest86, no memory problem. I ran the Diagnostics Dell Diagnostics (extensive testing) score. Fell asleep. Returned 4 hours later and Diagnostics says no past everything, no errors. The strange thing is that after 4 hours there still react, just waiting for me to click OK. Do not freeze. So I restarted the laptop, tried to install Ubuntu and even once, freezes after a few seconds.

    So I really don't know what could be the problem. If it freezes on different OS, it must be a hardware problem? But diagnostics memtest86 and dell said material is OK. Not only that, but when running the diagnostics, it did not freeze for hours.

    I'd appreciate any help that anyone can give me. Thank you very much.

    Kevin - also had other problems with it, or is it the same freeze issue?

  • MacBook Air freezes randomly

    Hi all

    I had a problem with my Macbook Air early 2015 since nearly a month. I freeze random OS experience (I'm under OS X El Capitan 10.11.4): the cursor moves and the keyboard is unresponsive, so I can't do anything at all. The only thing I can do to "unlock", it requires the laptop to restart (by turning manually him off and then back on). This problem occurs more or less one or two times a week and I didn't notice a particular task or request that I am running that may cause the gel. Usually, it happens while I'm surfing the web with Safari, but not all the time.

    Any ideas or suggestions on how to solve the problem?

    Thank you very much in advance for your help.

    Download and view a report of Etrecheck:

    http://www.etresoft.com/etrecheck

    Ciao.

  • Satellite A660-18 freezes randomly

    My Satellite A660-18 freezes randomly especially when I play games or watch video.
    Also sometimes when I'm just passing the mouse. He is 1-2 times a week/2 weeks. When it happens the screen freezes but the audio on for a while and does not react to any keypress so I have to manually turn it works.

    I don't think it's a graphics card overheating issue, as happens sometimes in just a few minutes after I turn on my laptop and I use a cooler pad as well.

    Hello

    This sometimes happens, it means that you can't reproduce it, which means that it s really hard to tell what could cause this.
    Theoretically, it could be just a software problem. Perhaps only the registry is damaged.
    In this case, the new OS installation must be carried out.

    Of course it could be also related to memory: to test the RAM by using some tools such as mem86 + or similar.
    Also, make sure the HARD drive; for this, you can use the tool called Drive Fitness Test.

    Welcome them

Maybe you are looking for

  • icloud photostream not working is not windows 7

    It is a persistent problem that I've had for a few years, but it seems to be getting worse. I have iCloud Photostream set up and it works very well with my iPhone mini iPad and 6, are both on the latest IOS. I also iCloud put in place on the PC that

  • A few questions about Tempo alerts

    Hello I just bought my laptop and I have NO idea how things works this maintenance and support.Starting with alerts of Tempo. Will I pay attention to them and download the updates and other things whether they recommend?Is - this free service to a To

  • Satellite P750 keeps closing

    Hi guys, I am a newcomer. My friend, but I have a Toshiba Satellite P750 (PSAY3A - 05S 001) and had trouble with her then she asked me if I could fix it and I accepted his favor. According to her, the laptop cannot boot on the windows that display an

  • Annoying pop ups registration

    I get the popup registration acer... I am registered and do not want it are constantly emerging. There is none program to start it.  I tried Google, but responses were told to go to the start. I guess I'll get warreg_popup.exe if I can find it and di

  • Could not ping router RV042G public Internet address when it is after spending a SG200-08

    I use the optical fiber Singtel broadband server. I installed a SG200-08 for UNTAG VLAN to port 2 and connect the port to port RV042G WAN 1. It works very well with a public IP address. Access to Internet is very well to router LAN ports. However, I