Two timed loops separate but connected

Hi,
I have a simple Data Acquisition setup where I read 32 voltages, and write them to file.  I want my front panel to update the displayed voltages every 2 seconds, but only want the same values to be written to file every 5 minutes.
I've tried nesting one timed loop in another, but the displayed values update at the same time interval as the write to file (Write-to-file loop nested in main timed loop). 
I've also tried creating one timed loop for the display (2 second interval) and a separate timed loop for the write to file (5 min interval).  However, while the display updates, the write to file does not work.
I just want two timers working simultaneously, but one gets data from the other after 5 minutes.
Sorry if this is a repeat post, but I couldn't find answers elsewhere.
Thanks in advance,
Walter Kaminski

Hello:
You can use a single while loop an a couple instances of the Elapsed Time Express VI. You configure it to send you a boolean true when the time you specify elapses. Then configure one of them for 2 seconds and the other one for 300 (5 minutes). Use the output "Elapsed Time?" to control the selector of a case structure so that when the time elapses, the action you want executes.
I attached a small example.
Let me know if it helps.
Robst.
Robst - CLD
Using LabVIEW since version 7.0
Attachments:
Time Intervals.vi ‏64 KB
time invervals.JPG ‏38 KB

Similar Messages

  • Does two timed loop work together? is it possible....

    Hello
    I use Crio in scan mode and have problem with timed loop.  I use two timed loop for two different PID loop. I need to get 1ms delay for PID loop. But When I two run realtime side with timed loop, only one of them work (when ı send command from host side). Is it possible to run two time loop 1ms. How can I configure each timed loop work together properly? (ı configured the each time loop as synchron scan enginee 1ms)
    Both array are used for sinusoidal position data form host vi. I use time delay (1 ms) to make certain frequency with sample size(I adjust sample size for 1000 for 1 hz 500 for 2 hz).Each loop control  to position of servo system with PID. So I use two VI in my host side and I send two different sinus data with array. I tested with one timed loop it works vey well. But When I try it two time loop it dosent work.
    Attachments:
    RT TEK.vi ‏105 KB

    Two loops in parallell is quite easy, you just need two unconnected loops. If there's a wire in between you get data dependency which means the 2nd loop will wait until the 1st one finishes.
    Is that what happening to you? (I cant open the file)
    /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

  • Who know the difference between the two Timed Loop structures in NI's examples named PAC Simulation.vi?

    My LabVIEW version is LabVIEW 8.0.
    When I look up the help document about Timed Loop, I find two examples about Timed Loop with the same file name and different file path.
    One is "labview\examples\general\plat-timedloopframes.llb\PAC Simulation.vi",
    and the other is "labview\examples\general\timedloop.llb\PAC Simulation.vi".
    The function of these two examples is almost the same. But they display different results when running. I debug them and find that the value of Actual Start [f] of these two timed loop is different. Its value is constand in one vi and increasing in another vi. But the configuration of these two timed loops is the same.
    Can anyone tell me the diffrence between these two timed loops?
    Thanks!

    After I posted this, I realized there was one more "Time" clock, namely the Time node on the Event structure.  How is this clock (which I will call ET, for Event Time) related to the Global Start Time (or GST) and the TimeStamp (TS)?
    ET represents time in milliseconds, using a U32.  The largest value that can be represented is roughly 4 billion, but there are more than 30 billion milliseconds per year.  Hence this "clock" cannot directly keep the same time as the GST or TS.
    However, on the PC, if you multiply the ET value by a million (thereby converting the time to nanoseconds) and compare this value to GST, you'll see they are basically the same.  Thus, on the PC, ET and GST are "in sync", but not in sync with TS.
    On a real-time PXI system, we already established that TS and GST are "in sync" -- what about ET?  Curiously, this does not seem to be synchronized with anything.
    A Word to the Wise -- when I originally added the Event structure, I synchronized it with the Timed Loop using a Value(Signalling) property node, which worked fine on the PC, but failed to fire on the PXI.  I'd forgotten that you can't use this trick on real-time systems, as they have no Front Panel objects, hence the implementation using Dynamic Events. 
    Attachments:
    TS GST ET VI.png ‏16 KB

  • Timed loop in a subvi, one or the other runs but not both.

    I have a vi with two sub vis. Each sub vi contains a timed loop that updates a global variable. In the top level vi I read from each global and display its content. When I run the top level vi I see only one global counting but not both. If I start and stop the top level vi the sub vis take turns counting but they never both count. If I replace the timed loop with a while loop in each subvi then both count. If I move the two timed loops from their respective sub vis and place them in the top level vi then both globals show counting. Can any body explain what is going on.
    I'm using Labview 2010 SP1.
    Attachments:
    Test Of Timed Loop.zip ‏72 KB

    Never Mind!
    When I cloned the subvi I forgot to change the structure name of the timed loop. Placing an error indicator inside the subvi disclosed the error -808 (Error -808 occurred at an unidentified location. Possible reason(s):LabVIEW:  The given name is already being used by the following timed structure.).

  • Unable to run Timed Loops

    Bit of an odd one that had me scratching my head.
    I have a development system consisting of a PC running a 7842R, acquiring analogue and digital data from the FPGA, loading it into a shared variable, and reading it out within a timed loop on the host as one parallel loop in a producer-consumer architecture.
    All's well until one day last week when I noticed my host VI becoming unresponsive.
    After a bit of digging, I find that the timed loop doesn't run at all. Replacing with a while loop with a wait at least allows me to show that the error is timed loop related, but it's not a viable long term option for me. Creating a new project and a new VI with a simple timed loop showed the same behaviour.
    A restart of the system, and rerunning the same VIs, and no problems since.
    So, questions:
    1) Has anyone else seen this behaviour?
    2) Any idea what causes it? A service crashing, for example?
    3) Is there a way of recovering without a reboot? If it's a service crash, I'm hopeful.
    The system will eventually form part of a production test environment, hence the query.
    Edit - also, wiring error terminals of a timed loop is a good way of highlighting errors of course.
    FWIW, LV2012 SP1 32bit, Win7 64bit, Core2 Duo, 4GB RAM, tassels from the handlebars etc.
    CLD

    The timed loop is used to read all elements from a DMA FIFO and load them into a buffer FGV, which spits out packets of N samples long once they've assembled within the FGV. Ordinarily, I'd do this with a timed while loop and be perfectly happy to do so. However, the elements are actually an interleaved array, meaning that I have to demux them in the correct order that they were loaded.
    I use timed loops for a number of reasons: on my current Windows host, I've found that using a while loop has caused me more problems with respect to disordered packets, and that at least with using multiple timed loops (two, at most), I can assign priority to the acquire loop. Finally, it's also a development platform, and will be deployed onto an sbRIO once the electronics integration is finished in a week or two!
    W.r.t. system resources, there's very little else running on that system, but that doesn't normally stop Windows
    I recognise it's not ideal to run a software timed loop under Windows, but when you cannot run a blank project with Optimizing timed loop rate.vi from the shipped examples with nothing else running, it makes me curious to know why!
    CLD

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

  • Timed loop inside a flat sequence not terminatin​g

    Inside a while loop there is an event structure.  Inside that there is a flat sequence.  On one of the frames there is a timed loop that quits after so many iterations.  The timed loop finishes but the flat sequence doesn't execute the next sequence.  What am I not doing right?

    First, you have too many local variables.  This could be leading to race conditions.
    I think you have a couple problems in the use of event structures.  It is a bad idea to put any long running code inside an event case.  It will prevent the Event Structure from handling any other events in the mean time.  You have several timed loops running that in that one sequence frame.
    But the bigger problem is the next sequence frame.  You have a while loop that only ends once all the queues are empty.  Can you guarantee that all the queues get emptied?
    You have laid out the code very neatly, but you have used a lot of odd things in there.  (Number to boolean array, to cluster, to unbundle the cluster to individual indicators.)  Why not just go from Boolean array to and index array function.  No need for the intermediate cluster conversion.  Why not set up the indicators as an indicator array and just write to them directly.
    The code is so much intertwined between when queues are created, filled, emptied, destroyed, events happen...  And this is all multiplied by at least 4 times for each camera.  And there are 4 major event structures going on.  This is a very ambitious project for an inexperience LabVIEW user.  You need to step back, get one thing working right, and design so that you can scale the architecture upward.  Many of the structures you have essentially duplicated and belong in subVI's.

  • Limited sampling rate with multiple timed loops

    I am trying to use two timed loops.  The first timed loop is supposed to acquire some analog inputs, average the values, and then display the average values on the Front Panel at a rate of 2 Hz.  When I want to acquire data I enter a second timed loop and try to acquire data at a rate of 50 Hz.  The second timed loop is designed to acquire 1 value and then append the data to a file.  During the 50 Hz acquisition I want the first timed loop to also run so that the Front Panel continues to refresh values at 2 Hz.
    The problem I'm getting is that the second timed loop doesn't acquire and write data any faster than the first timed loop.  So in this case I'm limited to 2 Hz data acquisition when I want 50 Hz.
    Attachments:
    SWIFT_Dive Record2.vi ‏270 KB

    Hi FRLFTE,
    the second loop run not faster because both loops are in the same "big" while loop, so that the second loop has to wait till the first is ready.
    Mike

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

  • I've tried downloading iOS5 several times and after an hour each time I get a message that says my network connection has timed out.  But I can't find any information about "timing out" or how to correct the situation.  Any help?

    I've tried downloading iOS5 several times and after an hour each time I get a message that says my network connection has timed out.  But I can't find any information about "timing out" or how to correct the situation.  Any help?

    Disable your antivirus and firewall, and try again.

  • Why i get different value when subtractin​g two elements of different arrays then the actual value in a timed loop

    Hi Everyone
    I have a probem in substracting the two elements of two different  1-D arrays. The problem is, I am taking out data from a CCD camera which gives me data in form of 2-D array. So i select 1-D array out of it. Now this CCD output is in a timed loop, hence i am getting data in each loop. I select a perticular array output of the CCD and this is then passed to shift register and in all the loops later on, one of the element of the output array of the CCD is substracted from the same indexed element of the selected array. For reference i have pasted the snap shot of the block diagram. In this snap shot you see three probes. The value at the prob 1 is 232, at probe 2 is 255 and at 3 is 4294967273, where as actually i sould have a value of -23 since i am substacting prob 1 and probe 2 values. Since the value of probe 2 will always remain at 255 as i have fixed it by choosing an array form CCD and i checked the value of probe 1 which never goes above 255 so why do i get this false value here.
    Can you please help me in problem.
    Regards
    Chauhan
    Attachments:
    clip_image0011.gif ‏15 KB

    Your data is U32 (unsigned integer) which does not have negative values. According to unsigned integer math, "negative" results will wrap.
    You need to work in a datatype that is appropriate for what you want to do. How many significant bits do you have in the raw data?
    Message Edited by altenbach on 03-17-2008 11:15 AM
    LabVIEW Champion . Do more with less code and in less time .

  • I have two iPads and one is connected to the internet but my other iPad was connected then was not and since then I have not been able to add my internet back onto my iPad it only says cannot connect to the server any help would be great thanks

    I have two iPads and one is connected to the internet but my other iPad was connected then was not and since then I have not been able to add my internet back onto my iPad it only says cannot connect to the server any help would be great thanks

    If you are having WiFi problems it is necessary to isolate whether the problem is with your network or your iPad. Note: Do NOT consider your network to be blameless if some other devices can connect to it.
    First, test your iPad on some other WiFi networks: a friends, Starbucks, Barnes & Noble, etc.
    If it works well there then the problem is probably with your network. Try restarting your WiFi router by removing power for 30 seconds. If that does not help check for a firmware update for your router. If none exists which corrects the problem consider replacing the router.
    If your iPad does not function well on other networks it possibly has a hardware problem. You could try Settings > General > Reset > Reset Network Settings to see if that corrects the problem. If not, contact Apple Support or visit an Apple store for evaluation. They can provide a replacement if your iPad is bad.
    If you need more help please give the make, model, and version of your WiFi router and how you have it configured.

  • Two of our ipod touches won't connect to the home wifi.  They have done before. All other apple devices connect fine.  They can see the wifi devices, appear to try to connect (the circle whirls around) but connection doesn't complete.  Ideas?

    Two of our ipod touches won't connect to the home wifi.  They have done before. All other apple devices connect fine.  They can see the wifi devices, appear to try to connect (the circle whirls around) but connection doesn't complete.  Ideas please?

    I have 2 of them that only connected for a day and then reset network settings and they connected again for a day now resetting network settings does not fix it either. My iphone used to work with my home network but after upgrading to the latest OS which is the same versions as the ipods it no longer works either. Acts the same as the ipods. It would seem that the latest tweeks to the OS is the problem with wifi connectivity.

  • Need multiple 'MAIL' Icons.   Have two mail accounts and i want to keep them separate but want to EASILY switch back and forth from the main screen instead of going through, Settings, Mail, and selecting account. Major pain

    Have two mail accounts and i want to keep them separate but want to EASILY switch back and forth from the main screen instead of going through, Settings, Mail, and selecting account. Major pain the butt.  This has been a request from Apple users for many years.    it's great you can now combine all emails into one, but some people want them kept separate and have separate icons on the main page.   They could easily do this by having one "MAIL" account as white and another red.  Or put MAIL 1 and MAIL 2.    Or an actual label that the mail accounts are called on the ICONS!!  
    Help!

    eshghoolak wrote:
    ...I could switch back and forth between accounts while in the mailbox, with one button.  I think that is what you are referring to?  Whoever said it's just a simple switching - you obviously haven't had the pleasure of using an Android device.  It's not that quick to go back and forth - definitely not efficient...
    Not that it matters a lot, Android vs iPhone interface is largely a matter of personal preference and what you know... I'm not sure which one you're saying is not efficient...
    In any event...
    I currently have two email accounts setup.  My iPhone main page Mailbox settings reads:
    Mailboxes
    Inboxes
    All Inboxes
    Gmail
    [email protected]
    Accounts
    Gmail
    [email protected]
    I wish there an efficient way to move back and forth while in the "Inbox" between accounts.  Also, Why does one gmail account show as "Gmail" and another as the actually address?
    The names are based on the names you gave the accounts when you set them up.
    Settings>Mail, Contacts, Calendars.
    Tap the account you want to re-name. Go to the "Description" field and put in what ever you want.
    Second, there is no way to quickly choose a bunch of emails to delete. I have to manually go into each one and move it to the Trash folder.
    If you tap the edit button in the upper right while in mail, you can select multiple items to move, delete or mark (flag).
    I don't want any of the condescending remarks, that I've read here and in other forums.  I'm honestly looking for a solution, which I think you are too!  One thing I realized is that iPhone users in these forums are really defensive and quick to say "that's how it is, live with it, if you don't like it go away"  Um...the only thing that tells me is you are pretty bitter and have kept telling yourself that, to force yourself to like your device.  I prefer to express my issues, and find solutions.  There is ALWAYS a solution...
    I think what you will find is that many people here, myself included, tend to get a bit short with people who start off with attacks or whining about how something has been asked for for years and should be easy, rant about things that have already been beaten to death multiple times in the forums, talk about how much better Android or BB are at something (really... if it's that much better, why did they buy an iPhone to begin with?), etc., or continue to ask questions that could easily be answered with a simple search, or even just by looking back at the last dozen posts to the forum, half of which probably asked the EXACT SAME question.
    I don't think any of us go out of our way to be rude or uncivil.  That said, attacking the people who are attempting to help you is much more likely to generate a response of 'if you don't like it, go away', than it is to generate something that will be truly helpful.

  • I currently have one input but need to run two loops. I cannot get the two while loops to run so that they both pick up the same data, they are both picking up alternate samples. How can I get them to both pick up all of the values?

    The system I am trying to create calculates a number of values based on an input. I need to make the calculations and display the values for an entire production run and for each hour. The only way I know to do this is to create two while loops, one looking at all the values that are received and one looking only at the values for hour long periods.
    Any help would be great.
    Thanks
    RossH

    Why do you think that you have to have two loops to accomplish this task? Why not use one loop and accumulate the same data into two data sets based on the two sets of criteria?

Maybe you are looking for

  • Error in Client Administrator in SCC4 ....

    Hi Experts, I logged on through sap* 000 client and made a 210 Client in scc4. 1. When i am creating user in sap* 210 Client through SU01 to create a Admin User, it is giving error : No default address has been created. How to maintain and where ? 2.

  • Outline stroke command?

    I'm making an extension panel, and I want to convert some fat roundendcapped lines to paths, but it seems there's no command for this in the SDK. Object -> Path -> Outline stroke Is it true? If so, do you know a workaround for this? I made an Action

  • Smooth preview in Bridge.

    Bridge shows pictures too smoothy (like light blur) in actual size. ".PSD" or ".PNG" are smooth, but ".AI" is normal! How to solve this huge problem?

  • Widget Browser not working

    Hello Community, I'm desperate. I downloaded the Adobe Widget Browser today, but it isn't working. I have already tried to uninstall and install again, but it still does't work. I can log in but when I'm trying to download a widget the message is: Th

  • Multiple selection customer field at header level... Is it possible?

    Y'all, I would like to know if it's possible to append a table into the include structure (CUF) at header level in the contract and create a search help screen with multiple selection values return. This requirement comes because we have to mantain a