LabVIEW crashes in timed loops

Hi,
I'm running LabVIEW 8 on a
Pentium D, 2 GB RAM, Windows XP sp2 with an ETS target Pentium 4, 256
MB RAM. I have two timed loops in a sequence, so they do not execute at
the same time. A similar sequence is on the target allowing me to make
a state machine between both computers.
The loops on the host
simply update the GUI for the user have a large period of 45-ms. This
makes the CPU usage virtually zero. Also, task manager tells me that
LabVIEW on the host only uses 200 MB of memory, so I know that the
computer is not running out of memory.
When I run the multiple
VIs, the host will randomly crash. It works about 9 times out of 10
with no crashes. Windows will tell me that it (is sorry and) has to
close LabVIEW on the host. The target side continues to run like
nothing happened. When I click on the link requesting details, I get
this information from Dr. Watson:
AppName: labview.exe
AppVer: 8.0.0.4005
ModName: lvalarms.dll
ModVer:8.0.0.6
Offset: 00001df4
I
have narrowed it down and I know that it will only crash in the two GUI
loops. Does anyone have any ideas about how to approach this problem?
-J

Recently, I have had similar problems with timed loops (LV8.0.1/W XP). According to NI's answer, this is linked to hyperthreading. Unfortunately, until now, my question if this incompatibility is a bug or not remains unanswered. Because my application is critical, I have replaced all the timed loops with while loops even if the crash didn't appear during a short test with disabled hyperthreading.
Hope this solves your problem.
Here is an extract of the exchange with JR Andrews from NI :
04/04/06
The preliminary investigation of the issue indicated that it may be due to hyperthreading (or having dual processors) and that disabling hyperthreading resolved the issue as a potential workaround. If you have the time and ability, I would be interested to know if you were seeing the issue on a hyperthreaded machine and if disabling hyperthreading does in fact resolve the issue for you. I can then pass that information on to the developer to assist them in fixing the issue.
Regards,
JR
JR Andrews | LabVIEW Real-Time & PDA Product Support Engineer | 512-683-2820 
05/04/06
Even though your computers only have 1 processor, that processor may be using "Hyperthreading" to make it appear to the OS that there are 2 processors. You can check this by looking that Performance tab in the Windows Task manager or at the number of processors shown in the Device Manager. I've attached a screen shot of my system which is a single P4 processor which is hyperthreaded. Disabling the LV option for "Run with Multiple Thread" would probably not have any effect because to Timed Loops are always their own thread and that setting only applies to non-timed loop LabVIEW code. So I wanted to clarify that double check that your machine indeed does not have hyperthreading. To disable hyperthreading, you can go into the BIOS and you should be able to disable it. You can always go back and enable it again too.

Similar Messages

  • [RT] Meaning of Timed Loop "reset at structure start"?

    Using LabView RT the Timed Loop and also the Simulation Loop have a hardware clock feature called 1 MHz. Each iteration is done in sync with the hardware clock ticks.
    But what's the difference between 1 MHz and 1 MHz <reset at structure start>? My guess:
    The first option starts the loop with the next hardware clock tick (waiting)
    The second option starts the loop immediately (so the loop is running with a "tick offset")
    The hardware clock "reset" does not affect other Timed or Simulation Loops running at the same time
    Is this correct?

    Hi,
    in the following link you can find further information about this topic.
    http://zone.ni.com/reference/en-XX/help/371361H-01/lvdialog/loop_configuration_db/
    I have a VI attached which shows you the difference between these two options in a practical example. Just try out the different options for the timed loop.
    Without <reset at structure start> the timed loop wants to catch up a time delay after its first execution, with this option enabled it still works fine for the upcoming
    iterations.
    Kind Regards
    Thomas
    Attachments:
    TestTimedLoop Folder.zip ‏23 KB

  • Crash when calling dlll built by LV using timed loop.

    I have built a dll with Labview 7.1. Then I use VC++ 6.0 to call this dll. Everything is fine except that it will crash after the whole program finishes.  Without timed loop the program can exit normally. When built to exe file, it can also run normally. This happens in both Windows2000 and Windows XP.
    Anyone knows the reason for this?
    Thanks!

    Now the timed loop stops correctly everytime both in Labview environment and standalone exe. But when I call the dll version from C. The c program has no response after the program finishes.
    I built another small vi without timed loop to dll and called it. The c program exit normally. What is the problem?
    The period of timed loop is 50ms. Is it too short? I found from other post that maybe I should use while loop instead of timed loop. But i need very accurate controling of time.
    Any suggestions?
    Thanks!

  • Write to XML File crashes when multiple Timed Loops present

    Hello All,
    It took me forever to track this bug down.
    In this project we can edit operating parameters on the Host and send them down to an RT program in a cRIO-9025. The data is converted to XML and stored on the cRIO's disk.
    Occasionally, the RT program would lock up and had to be rebooted.
    It turns out that if you use Timed Loops , then a Write to XML File (or presumably any file write) will not return.
    Attached is an example. This has 5 loops to make it crash faster, but it will eventually crash with only 2.
    Paul J
    Attachments:
    XML Write test.vi ‏93 KB

    Hello Chris,
    I know that Write to XML File fails because I put in debug code in my actual program, a flat sequence which updated an indicator, and after the crash, the indicator had not updated.
    Yes, I know that it replaces the file. It's a configuration file, not data gathering. This is just an example of the bug.
    FYI,
    I increased the period for the loop with the file save to 500msecs and it still crashed.
    I then decreased it to 50 msecs, and replaced all of the other Timed loops with While loops and it does not crash, even though the file save takes much longer than 50 msecs, average ~150msecs.
    I replaced the loop with the file save with a While loop while leaving the others as Timed loops and it does not crash.
    So the bug is systemic and related to a file save in a Timed Loop when there are other Timed Loops.
    I'm not looking for a solution, I'm only reporting a bug in Labview. The solution is not to use Timed Loops, especially, as you point out, when there is file saving. It cost me several days of dicking around to figure it out. Maybe someone can save some time if they find this.
    Paul J

  • What is the best/most effective way to dynamicall​y build a timed loop in LabView?

    I am relatively new to labview (not to code in general) and am looking for the "LabVIEW" way to dynamically build a timed loop. This is what I am trying to accomplish:
    I have several heaters controlled through labview using Labview's PID toolkit. This works great. I have no issues with DAQ in general. However, throughout an experiment, I want to change the set point of each heater. I could set this up fairly easily using either a timed loop or the wait vi if I knew exactly how many different set points there would be.
    If possible, I would like to be able to read in a config file that includes the different times and set points for all heaters and dynamically create a loop that can handle this. I have tried using the Elapsed Time vi with an array of time targets; however that didn't seem to work.
    Has anyone been able to do this? Does anyone know where I could learn about using LabView in this manner? All help is appreciated.

    DHagan wrote:
    I am relatively new to labview (not to code in general) and am looking for the "LabVIEW" way to dynamically build a timed loop. This is what I am trying to accomplish: I have several heaters controlled through labview using Labview's PID toolkit. This works great. I have no issues with DAQ in general. However, throughout an experiment, I want to change the set point of each heater. I could set this up fairly easily using either a timed loop or the wait vi if I knew exactly how many different set points there would be. If possible, I would like to be able to read in a config file that includes the different times and set points for all heaters and dynamically create a loop that can handle this. I have tried using the Elapsed Time vi with an array of time targets; however that didn't seem to work. Has anyone been able to do this? Does anyone know where I could learn about using LabView in this manner? All help is appreciated.
    Write a tab-separated spreadsheet file makes it easy to use the write/read from spreadsheet files. Assuming you have a 2D-array of your times and set points it's just a question of setting up a for-loop going through the array row-by-row and extract the elements (expanded index array) to set your points and wait time.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Timed loop in LabVIEW DLL does not exit nicely

    Hello!  I have what I think is a simple timed loop in LabVIEW that exits after 100 iterations by throwing an error, and letting the loop "stop on error".  This works fine when run in the regular LabVIEW environment, however, when compiled as a Dynamic Linked Library (DLL) and called from LabWindows it forces me to terminate execution, rather than exiting nicely.  What's more, it seems to quit the actual Virtual Instrument call just fine and proceed to the next line of code, but when my main() function in LabWindows completes there must still be something not cleaned up that is causing it to not exit nicely.  Any ideas?   I've tried adding a call to QuitLabVIEW and that doesn't seem to do it.
    Thanks in advance - hoping you'll point out some really easy mistake. )
    Attached is a picture of the timed loop.
    Below is an excerpt of code from LabWindows:
     int main ()
     CallMyLabVIEWDLL();  //This line successfully launches and closes the window for my LabVIEW virtual instrument
    MessagePopup ("My Title:", "This happens after the call to your LabVIEW DLL");    //This popup shows up - indicating the call to the DLL has completed
    //But after the code has completed LabWindows still says "Running", rather than shutting down.
        return 0;
    Solved!
    Go to Solution.
    Attachments:
    LabVIEWTimedLoopDoesntExit.png ‏103 KB

    Update:  I tried the simplest possible "While" loop and it works.  If I replace it with the simplest possible Timed Loop, it doesn't.  (See attachments.) 
    The only thing I could find in a search for why a time loop would break a dll is a patch for lvalarms from LabVIEW 8.5.1 .... I'm running LV 2010 so I don't believe that's an issue.  Correct me if I'm wrong?
    Thank you!
    Attachments:
    Doesnotwork.png ‏43 KB
    DoesWork.png ‏9 KB

  • Labview Crashes when I try to close my while loops

    Hi
    I have written a LV Vi  for  simultaneously  aquiring a
    video stream from 4  Fire Wire cameras. In this vi I use multiple
    while loops(running parallel).
    Nearly every time I try to stop the VI labView crashes and doesn't respond at all.
    The only chance to stop LV is to close it with the task manager.
    I'm using LV 8.2.
    Has anybody got an idea.
    Thanks a lot
    Matthias

    Hi Mathias,
    this behaviour I experienced often when using large amounts of memory by creating large arrays (with many copies). Another proplem is to create references without closing them, this consumes windows ressources. While the VI runs, is there an increasing use of memory in the task manager?
    When the VI tries to stop, are you able to switch to the block diagram? Then you could activate the highlight mode (debugging) and LV shows, which node is still working with the green arrow at the node.
    Just a few ideas...
    Greets, Dave
    Greets, Dave

  • LabVIEW RT, Timed loop, finished late, Call by reference

    I have a timed loop triggered by the sample clock of a DAQ-Card. The sample Clock is 8 kHz and the loop will run with dt = 4. Normally the loop is running without finished late[i-1]. But from time to time it happens that the loop is running extremly longer which means instead of 0.5 millisec it needs 4 - 5 millisec. It seems this doesn't never occur while accessing DAQmx.
    The application uses plugin technologies and some of the VIs in the timed loop are preloaded and called by Call by Reference.
    Does those VIs inherit the priority, execution system and CPU of the timed loop?
    The application is running on LV RT 2009 on a Dual core PXI-Controller. The timed loop is bound to CPU 1. There is no  difference runinng the application from the development environment or as a startup application.
    For the measuring test  I modified the application in a way that I don't have:
    disk access for storing the result file
    TCP/IP communication
    Controls on the front panel of the top level VI
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

    To keep you informed:
    I stripped the application and have left only the measurement storing module and the timed loop. The loop was using the microsecond timer running each 500 µsec. Additional all Non-Real-Time modules were loaded and only one module creates a XML string and sends it to the communication layer which will drop it because no TCP/IP port is open. The creation of the XML string is done each 300 ms.
    In this case I don't have any finished late iterations
    Next I added the DAQ Module. Now I get finished late again but with a lesser frequency as original.
    I removed all unnesseccary tasks from the DAQ moulde leaving one task for a PXI-4204 for using as the clock source for the timed loop. No I get finished late seldom.
     I removed the module which will send the XML string and I don't get finished late.
    Next I was adding code to see memory allocation. I can when memory allocation is changing but it is not related to the finished late iterations.
    Next time I have the chance to do more tests I will see which DAQ task triggers the finished late iterations. I have one AI task on a PXI-4204,  4 Counter tasks on a PXI-6602, 1 DI task on a PXI-6514, 1 DO task on a PXI-6514, 1 DI task on a PXI-6259, 1 DO task on a PXI-6259, 1 AO task on a PXI-6259 and 1 AO task on a PXI-6711.
    The AI task on the PXI-4204 is running in Continous Sampling (Single Point HW Timed is not supported), all other tasks exept the DI and DO are Single Point HW Timed.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • How to pause and restart a timed loop in Labview

    I am trying to pause and then restart a timed process (series of stepd that happen at precise times), which is implemented using a timed loop.
    I was wondering if anybody out there can give me a hint.
    Thanks

    Roxanne,
    Well, it's not exactly a "pause", but here's a way to stop and re-start your Timed Loop.
    See the attached example in LV2010.
    A While Loop and a Queue are used to allow you to start and re-start the Timed Loop.
    The "Stop Timed Structure" vi is used to stop the Timed Loop.
    Releasing the Queue stops the While Loop when you end the program.
    Note that the example is very similar to the NI template "Producer/Consumer Design Pattern (Events)". (File>>New)
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    timed loop.vi ‏39 KB

  • Minimise front panel of vi containing timed loop = problem

    Is this expected behaviour...
    Run the attached VI.
    All it is supposed to do is beep every 10 cycles.
    When you minimise it and try to restore the front panel though... it locks up for a random amount of time.
    I don't think it is supposed to do that. (I'm running it on XP Pro.)
    Originally I was chasing this problem in a data acquisition loop. The buffer would overflow and exit the app with an error when it was minimised.
    It took all day to track it down to this.
    Hmmm... I just tried to save it back to a version 8.0 vi and it doesn't seem to have the same error!
    Message Edited by Troy K on 10-03-2008 05:26 PM
    Message Edited by Troy K on 10-03-2008 05:31 PM
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle
    Attachments:
    Timed Loop minimised.vi ‏85 KB
    minimisetimedloop.png ‏7 KB

    I'm using LabVIEW 8.5.1 on two PCs and it does it on both of them.
    I just emailed the vi to a colleague and after a few minimise/maximises it locked up on him too.
    I've just found that if I remove the left and right data nodes inside the timed loop the bug seems to go away.
    Steps to repeat bug:
    1. Minimise all windows (Windows+m)
    2. Restore vi front panel and run it. (It should start beeping twice a second)
    3. Minimise / Restore it rapidly by repeatedly clicking on the vi's Front Panel 'task bar button' (down the bottom).
    After a while the beeping will stop when the front panel is minimised and it wont restore. Then after a while (with or without clicking on the task bar button) the front panel will restore and the missed periods will execute very quickly (as the timed loop does what it is configured to do).
    I think because of the simplicity of the example vi the bug doesn't show up as often. When I ran it in the real application (too many vi's to post) it crashed every time. In the real application there isn't much going on in the timed loop, it is just used to queue items into a separate consumer loop. The problem is that when the bug occurs, ALL LABVIEW CODE stops executing, not just the code inside the timed loop. So another vi running in parallel (in a daemon) that retrieves messages from a device queue stops and the device buffer overflows.
    Attached is a modified vi to demonstrate that code outside the timed loop stops executing too. The bug occurs here on three different PCs, the only common thing I can think of is LabVIEW 8.5.1.
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle
    Attachments:
    Timed Loop minimised 2.vi ‏89 KB

  • Can I run a fast timed loop?

    It appears that a timed loop cannot run faster than 100 hz. In other words, the "period" input for a timed loop cannot be less than 10. Is this true? I am using the Elapsed Time VI to measure time increments. The time increments output from this VI are at least 0.01 secs regardless of how fast I attempt to run the time loop. Perhaps the limitation lies in the Elapsed Time VI, not in the Timed Loop. Should I try a different approach to measuring the delta time between iterations of a time loop? TIA.
    -jlivermore

    Here's the simple way to measure loop timing:
    Actually, what else is running in your loop (e.g. property nodes, DAQ, etc.)? Can you show us your code? What is your LabVIEW version?
    Message Edited by altenbach on 09-29-2008 11:22 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    MeasureLoopTiming.PNG ‏7 KB

  • Labview crashes every time I click on a broken arrow (vi has errors).

    I just upgraded Labview from 7 to 8.5.1 a few weeks ago.  Now, when I press the broken arrow to check the errors in a vi, Labview crashes.  This is a vi that was developed using the state diagram toolbox under Labview 7.  I now have the state chart toolbox but not the state diagram toolbox.

    Try to disconnect the state diagram from the the state diagram (right-click on the main while loop).
    If that doesn't work in 8.5, try to do this in 7.1.
    Or install the state diagram toolkit in 8.5.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Using timer/counter with PCI-6221/USB-6210 to control timed-loop VI

    Dear all,
    I need to ask about two devices and one of their functionalities, PCI-6221 and USB-6210. For our NI-based system, we need to control some timings in a Timed-Loop vi, for that currently we are using PCI-6221 and we give external TTL signal (at 1 kHz) to it,
    recenntly we need to make some changes and for that we found USB 6210 DAQ to be more suitable, but we need to clear ourselves on some specific things.
    Can the counter/timers functions available in the either PCI 6221 or USB 6210 can be used to control the Timed-loop VI by giving external clock or by using their own internal clock source?
    Although we are using external clock with the PCI 6221 but we want to know about the usage of their internal clock, also are controlling timed-loop also possible for USB-6210
    Also... What if we use the RTOS, are they still able to control the timed-loop VI  without giving any 'EXTERNAL CLOCK' and using the internal clock sources of the DAQs
    Waiting for reply,
    Bests,
    RaJaf
    Solved!
    Go to Solution.

    Ben,
    I having read previous email which I send earlier with general overview, we discussed in more detail within our team and I am giviing the specific answers.
    Please check in RED the most recent answers. Blue are the questions/suggestions by your side.
    1.    Using Internal hardware clock of PCI-6221 would enable us get rid of external clock, but how to divert the internal hardware clock to the current settings. Any idea  (can you provide us with some reference manul for otherwise). I mean is there some flag-bit etc. or VI
    2.       Is it also meant that with the installation of RTOS the timed-loop can directly get the timing source from the internal hardware clock PCI-6221? --- How???
    3.       In order to make desktop to work as RT system, what is the hardware (motherboard, processor, etc..) requirement? What are the LabVIEW modules (specific name) that needed to be installed? Our platform is LabVIEW 8.6. (Currently we have windows-7 with i7 core processor)
    What kind of application are you intending for this system? ---- high-speed laser scanning system.
    Are you most concerned about accuracy, speed, or responsiveness? To control the laser mirror scanner to move at 1 kHz or 2 kHz speed. On the other hands, using PCI-5105 (128 MB memory) as a DAQ for real-time/on-the-fly data processing.
    Bests,
    RAJAF

  • Timed Loop in Producer/Consumer Loop

    Hello!
    I have a producer/consumer loop LabVIEW program setup to allow me to properly capture images that are quite large (8MP) at approximately 14 frames per second (FPS). The program works great when the consumer loop is a 'while loop' (records at 14fps no problem), but I wanted to make it into a timed loop, so that I may vary the FPS as required. An oddity arises when I do this. Anywhere below 12fps, the loop works fine and the data is recorded properly. However, when I bump it up to 13fps, the consumer calculated FPS goes haywire and starts jumping between ~9 and ~13fps (data processing gets bogged?). When I set the required FPS to 14, the loop executes at a steady 7FPS maximum. Is there something I can do to rectify this situation?
    I have attached my .VI
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    ProcessSplitJPG-FPS.vi ‏100 KB

    Palanski,
    Are you using LabVIEW Real-Time? Timed loops in a windows OS don't really increase determinism more than a while loop with a wait until next multiple timer. Before you changed the producer consumer loop to include a while loop was the programming running correctly? You may also want to vuse the VI analyizer to see how long things are taking to run. I would leave the producer consumer loop in the traditional set up and change the FPS by controlling the wait timer, after benchmarking your code this should be done the same way as you have it for the timed loop
    Sam S
    Applications Engineer
    National Instruments

  • Timed Loop timing source - Control Loop From Task is too slow

    I'm trying to make a Timed Loop run at a period of 2 ms, with an analog input task running at 50 kHz as timing source. The input analog signal is scaled and fed into a synchronised analog output task on the same multifunction DAQ board. Using the built-in 1 kHz or 1 MHz clock as timing source for the Timed Loop works great, except for a slight time lag between the loop and my AI/AO tasks which over time becomes unacceptable because my task will be running for up to an hour. However, when I use the DAQmx Create Timing Source: Control Loop From Task vi to create a timing source, everything slows down and the fastest loop time I can get is around 20 ms. Any suggestions to get around this would be highly appreciated!
    System: LabVIEW RT 8.0 with DAQmx 8.0 running on an NI PXI-8186; NI PXI-6251 used for analog input.

    You're welcome!
    You can build an array, and if your data is not hugh (100's of MB) this may be the easiest solution. However, we aways suggest implementing the Producer/Consumer Architecture. Keep the PID in the Producer loop, but move the File IO to the Consumer. Also, it  appears that your instrument uses some form of serial communication, so that could cause lags in your system....
    What is your application about in general, what performance are you hoping for, etc?
    Joshua B.
    National Instruments
    NI Services
    NI Support Resources
    NI Training Resources

Maybe you are looking for

  • Can I use my icloud aliases on my iphone

    I have installed icloud on my macbook and on my phone I have 2 aliases in my account yet cannot access them on my phone ?

  • Cannot load Itunes or Quicktime and can't uninstall old version

    I'm trying to load iTunes. The installation fails because, "The installation of QuickTime did not complete successfully. iTunes requires QuickTime." Have tried unintallation the current version of QuickTime and installing the latest version of QuickT

  • Broken T-mobile 8220 flex cable (hinge) need help finding parts

    Hey folks. Nice forum here !  My 8220 was working nicely until I broke the phone in half (I had anger issues I guess ! ) Anyways the the flex cable is broken now. THe hinge is fine as I  snapped it back together and it operates normaly. The phone is

  • Sending attachments in email notifications

    Hi! Is it possible to attach files to email templates? IDM doc seem to have not too much info on this. Any help is greatly appreciated. Thanks.

  • ITunes update to 9.2 issues...

    I recently bought the iPhone4 and I cannot connect it to iTunes (obviously) bc I cannot get the stupid thing to update. It's currently 9.1 and every time I click on check for updates in the system preferences AND in iTunes, it comes back to say that