So I have a lot of while loops that need to not run concurrently.

I'll attach the VI at the end.
This seems to be working very well overall as far as functionality, but the timing is getting funky.
I've tried to use a Wait and Wait for next ms multiple to prevent these loops from running at the same time and causing hardware conflicts.  It seems like I'm really messing up the loop counts, though, as I've got indicators on the loop iterations which are telling me that some of the loops are running a lot faster than the others.
I got this idea for Wait For Next Ms Multiple on here in a search and it seems to work great on my simple two-loop program on my other system, but isn't working out well with this many loops.
Basically, I'd like for these 7 or 8 loops to each run every 10 seconds or so, but NOT start all at the same time so that they aren't trying to access the same DAQ and causing hardware conflicts.
Other than that, I know my code isn't pretty and I've abused local variables like crazy, but it's basically doing what I want.  Just not WHEN I want.
What's the secret to this loop timing?
Thanks in advance!
Still confused after 8 years.
Attachments:
voltage and temp2.vi ‏1644 KB

Ralph@NES wrote:
What's the secret to this loop timing?
Dennis and otheres already gave you some good advice on the DAQ part, so I won't repeat it.
There are some real glaring errors besides the problems you are telling us.
FIrst, your idea to run both a wait and a wait next ms multiple in the same loop is flawed, because they will both run in parallel and the longer of the two will fully and exclusively determine the loop time. The shorter of the two will  complete earlier and will have absolutely no influence on the loop timing. You need to familiarize yourself better with dataflow programming.
Notice that you open all these files, but depending on the cases, you loose the file reference when exiting case structures (tunnel set to use default if unwired). The default is an invalid reference and this means that the "file close" cannot complete under this condition.
From an UI perspective, it seem ridicuous that the user needs to press a dozen stop buttons to stop the program, with no way to recover if e.g. one of the stop buttons has been pressed only by accident.
I am pretty sure your entire code could be reduced in complexity by 90% with a bit of effort. You are doing way too many duplicate things.  A state machine comes to mind. It would automatically protect states for executing concurrently.
Your FP could be simplified by using arrays of indicators for example.
I would probably not try to fix the current code. This is a case where a complete teardown and rebuild would be approriate. Good luck!
Message Edited by altenbach on 08-10-2007 08:09 AM
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • How do I make one while loop that runs 1 piece of data at a time?

    I have a question about a while loop.  Currently, I have 4 or 5 dynamic data lines that I would like to run through a while loop that will tell me if the data is within a certain range or not.  However, the ranges are different for each piece of data, and I dont know how to do each one separately.  Do I have to make 5 different while loops? Thanks!

    pg22aw wrote:
    I have a question about a while loop.  Currently, I have 4 or 5 dynamic data lines that I would like to run through a while loop that will tell me if the data is within a certain range or not.  However, the ranges are different for each piece of data, and I dont know how to do each one separately.  Do I have to make 5 different while loops? Thanks!
    Do you want to compare the value with a defined value and also the ranges for the 5 data is different?. What are you doing in the while loop. If the data is in an array of dynamic data you can seperate the amplitude value and check the whole array of value with the ranges that is also build same as the data theh you will get the output as a boolean array.
    The best solution is the one you find it by yourself

  • Question: Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages? - Problem: I have 1400 e-mails with attachments that need to be conv

    Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages?
    - Problem: I have 1400 e-mails with attachments that need to be converted into pdf and the attachments cannot be embeded.
    System: PC Windows 7 using Acrobat X Prof. - Thank you!

    Hi ,
    There is an option of embedding index for faster search while converting email to a PDF .
    However I am not sure that will serve your purpose or not .
    I would recommend you to get in touch with Microsoft support as well .
    Meanwhile I'll work on it and get back to you in case I get a desired solution .
    Regards
    Sukrit Dhingra

  • I have hundreds of the same shape that needs to be converted into a symbol for easy editing. Is ther

    I have hundreds of the same shape that needs to be converted into a symbol for easy editing. Is there a way to do this in Illustrator?
    Background here may be relevant: The place I am working is currently using ai CS 3 & 5 and the files in question are converted Freehand files. I have never been a Freehand user, but apparently you were able to swap one shape for another in Freehand. The closest Illustrator equivalent that I am aware of is the symbols panel. I know how to swap one symbol for another, how to create a symbol from a piece of vector art and how to modify a symbol. What I am trying to do is convert several instances of the same object into several instances of the same symbol without having to replace hundreds of objects manually (ie. trying to get the right placement in a grid and everything).
    Is there any efficient solution to the task I have in Illustrator CS 3 or CS 5?

    Try this.
    http://illustrator.hilfdirselbst.ch/dokuwiki/en/skripte/javascript/zamena?redirect=1
    http://illustrator.hilfdirselbst.ch/dokuwiki/en/skripte/javascript/zamena_size?redirect=1

  • I have a one year CC subscription that i do NOT want to renew. How?

    I have a one year CC subscription that i do NOT want to renew. It is ended July 15 2014. I don't understand how I end this subscription. I don't want to cancel it now, just be sure that it will NOT be renewed. How?

    Hi there
    Please check here: Cancel your membership or subscription | Creative Cloud
    You can cancel your membership after payment for month 12 has been taken if you don't want to renew for another year.  Your month 12 payment is due on 15th June so you can cancel anytime after this date and before 15th July.  You will still have access for that period.
    Kind regards
    Bev

  • I have been told my macbook does not have enough gb for Lion. and that i can not keep my mobile me mail without lion. so does this mean I have to drop mobile me and get another email address?

    I have been told my macbook does not have enough gb for Lion. and that i can not keep my mobile me mail without lion. so does this mean I have to drop mobile me and get another email address?

    You probably know that mobilme goes away in June this year. There are two ways to access your mail account on iCloud, either through Lion or via the web. Web access won't get you to all the benefits of iCloud but will allow you to get to Mail, Contacts, Calendar, and Find My iPhone.  See this FAQ: http://www.apple.com/mobileme/transition.html
    If you decide to go with Lion, the maximum memory you can install is 4GB, however the system will only use 3GB, which is enough to run Lion. Lion requires 2GB, however, some have not been satisfied with it's performance in 2GB. One source for memory is OWC at http://eshop.macsales.com/shop/memory/MacBook/DDR2/

  • I'm checking my iTunes account, and it shows that a bunch of apps have been added to my account that I did not buy, nor are they on my iPhone.  What can I do?

    I'm checking my iTunes account, and it shows that a bunch of apps have been added to my account that I did not buy, nor are they on my iPhone.  What can I do?

    change your password and see if they purchases hit your card on file

  • What happens to the while loop iteration counter if it runs unchecked?

    I want to use the iteration counter to initialise a value on the first loop of a while statement. ie i = 0, x = 100. Fine. The application I am building will be left to run for weeks or months on end without stopping (hopefully :¬)). What happens to the iteration counter in this situation? Does it reset to 0 or what? I don't want it reinitialising any values while the loop is running other than when it starts.
    I set up a while loop to try to figure out what happens and the iteration counter stops at 2147483648 which is 2^31 - 1.
    Any help would be appreciated,
    Thanks,
    Niel.

    It might be something you already looked at, but perhaps it's an option to perform the initialization outside (before) the while loop. That way it will be initialized correctly only once, no matter what the iteration counter does.
    Of course if you need the counter for other purposes than initialization you might have the same problem...
    Note that a lot of the timer functions also overflow after a certain time (I believe 24 or 48 days?) so be careful running very long loops (but you already knew that probably).

  • How can I update cluster items from inside a while loop that does not contain the cluster?

    I have a VI that contains front panel clusters and two while loops. The main cluster contains items such as a doubles "distance" and "stepsize" and boolean "step" (a whole buch of this type stuff). The first loop contains an event structure to detect front panel changes and the second contains code and sub VIs to perform operations based on detected events.
    The operator can enter data into either double or click the boolean. If distance is changed the second loop does what is required to process the change. The same happens with stepsize. If step is clicked the ±stepsize value is added to distance and the result is processed. In each case the front panel should track the result of the input and subsequent processing.
    Because the clusters are outside the while loop, they are not updated unless I click 'highlight execution' which seems to allow updating each time the execution highlight is updated. There are other issues if I move the clusters into one of the loops.
    I've tried referencing the clusters and using local variables and nothing works. It looks like overkill to use shared variables for this.
    Any ideas would be greatly appreciated.
    Thanks,
    Frank    

    Hi Ben,
    Thank you for the response. I followed the link and tried reading everything you posted on AEs but I'm afraid that I didn't understand it all. It seems that each AE example had a single input and a single output (e.g. a double). Is this the case? 
    What I have is a couple of front panel clusters containing (approximately) 18 control doubles, 8 indicator doubles, 5 boolean radio button constructs and 26 boolean control discretes. I clusterized it to make it readable. In addition I'll eventually have a cluster of task references for hardware handles.
    All I want to do is update the front panel values like I would do in a C, VB or any other language. I've tried referencing the cluster and using the reference from inside the loops. I've tied using local variables. Neither works. I'm experimenting with globals but it seems that I have to construct the front panel in the gloabal and then I wouldn't know how to repoduce that on the front panel of the main VI.  Sometimes it seems that more time is spent getting around Labview constructs than benefitting from them.
    I hope the 'Add Attachment' function actuals puts a copy of the VI here and not a link to it.
    Thanks again for the suggestion,
    Frank 
    Attachments:
    Front Panel Reference.vi ‏33 KB

  • Anyone else had trouble getting RID of Mt Lion? I was shocked to learn that I could NOT run some of my software on it and attempted (with online help) to reinstall SNow Leopard. My computer is now in the hospital! I should have been told beforehand.

    I 'upgraded' to Mt Lion over the weekend. It seemed very slow, and sluggish. Within a day I realized also that my Reunion program would not work,
    my Quicken would not work, and who knows what else. I kept getting alerts saying that I could not use any PC programs. So, I decided to go back to Snow Leopard - I spent two and a half hours on the phone with two very capable people, then was told that I'd have to take it to an Apple Store. I DO have
    extended warranty but a lot of good THAT does!  Besides, our nearest store is 160 miles away! So, I took it to our local authorized dealer. It is currently
    being worked on, and the minimum will be $189!  Fortunately, Time Machine was being backed up by my external hard drive.  But, I just received a
    call and they can't make my password work to get in!  Somehow that has changed back to an old one I don't remember! 
    MY COMPLAINT:  When speaking with a rep about the feasibility of downloading Mt Lion, not ONCE did anyone tell me that I 'might' have these
    problems.  I NEVER would have upgraded! Now I just want my computer restored to USABLE -

    What an unfortunate story.   I hope you will quickly get things back to normal.  
    To be fair though, there has been quite a lot written about the effects of mountain Lion and the loss of Rosetta, as one example.   I am wondering just how much research you did before buying.
    But on the brighter side, you can wipe Mountain Lion and reinstall Snow Leopard with not too much trouble.   It would have been much worse had you bought a new machine with M.L. pre-installed and then found your programs wouldn't work.
    Message was edited by: seventy one

  • Is it possible to have songs in the iTunes library that I do not want to be added to iTunes Match?

    I ask this because a few days ago my iTunes library crashed and iTunes does not recognize my purchases anymore so I have a lot more than 25,000 songs in my library and instead of deleting  600 songs from my library, I would like to select some of them so they won't be added to iTunes Match. Does anybody know if this is possible?

    I didn't say "re-create" I said "restore from a backup." Restoring from a backup will place all the files just as they were right back where they need to be. This includes the .itl, .itdb ad .xml files iTunes needs to recognize that the files on the internal HDD are the same as the files in the cloud.
    You do have a backup, don't you? If you don't then I strongly recommend you start backing up immediately.
    If all else fails you can email iTunes Store support and ask them to reset your iTunes Match DB on the server. This will require your iTunes to go through the entire scan, match and upload process as if it were the first time.

  • I have some content in my library that I do not want to sync with my ipod touch. The content has previously been synced and I want to remove it without deleting it from my itunes library. Is this possible?

    I have some music content in my itunes library that I do not want to sync with my ipod touch. The content has previously been synced and I want to remove it without deleting it from my itunes library. Is this possible?

    Hi Pez,
    iTunes in the Cloud is not iCloud. Any songs that you have purchased but have not downloaded (or have deleted), go to iTunes in the cloud. The setting I mentioned will show all of your purchases in the various views in the Music app, whether they are on your device or not. If you turn that setting off, you will only see items that are actually on your device.
    Glad to hear the second sync worked! But if they all start appearing again, make sure that setting is turned off
    Cheers,
    GB

  • HT204368 I have a Tango TRX bluetooth speaker that is suddenly not able to connect to my New iPad. It worked fine for a few eeks and now I get the previously unseen "This device not supported by iPad" message. It was supported for three weeks. Thanks

    Most of the question is in the discussion header. I have a Tango TRX bluetooth speaker that worked fine for three weeks with my third generation iPad. I started having trouble connecting and recieved the "not supported by iPad" message. It connects just fine until I open any app that requires sound and at thet point I recieve the message and the device disconnects. The Tango still pairs flawlessly with my laptop which is not an Apple product. How could a product suddenly become unsupported? 

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    Try a reset. Press & hold the Power and Home buttons simultaneously, ignoring the red power off slider, until the Apple logo appears. Then release both buttons. This should not affect any content on the iPad, it is similar to rebooting your computer.

  • HT1349 I have music in my itunes library that I did not download from itunes, when I try to play them, I know get a pop up "could not play, original file could not be found" This started suddenly, I have never had a problem playing this music before.

    I have music in the itunes library that I downloaded from another site that all of a sudden will not play. I keep getting the message "original file could not be found" Any suggestions?

    that pop up if u delete or moved any song around in ur music folder which ituns cant find it now .you got re do it

  • I have been billed for an app that I did not order

    I have been billed for an app that I have not ordered. What do I do to get the money refunded please?

    Click here and ask the iTunes Store staff for a refund.
    (105211)

Maybe you are looking for

  • Changing the datasource of a Crystal Report to a Oracle DB using TNS

    I have a problem trying to change the datasource of a crystal report. In the new connection I want to connect to a Oracle DB using TNS. Without TNS it's finally working flawlessly with the following code:      private static void switch_tables(Databa

  • I am getting error message when trying to a document in Adobe InDesign

    Hi All I am getting the following error message when trying to open a document in Adobe InDesign Document contains an invalid frame. Story text begins - Delete frame and associated story? Options are yes no. clicking no a couple of times and the docu

  • How to send SMARTFORMS output as attachment through?

    how to send SMARTFORMS output as attachment through e-mail? after executing SMARTFORMS how to send that output via e-mail. Help me. thanks surya. Moderator Message: Please search for available information first Edited by: kishan P on Nov 7, 2010 7:19

  • What is the best way to display list of software titles for sale?

    I am a small retailer that would like to display a list of approximately 15-30 software titles in the most professional way (with prices). Can anyone recommend a layout that would serve this purpose, the ones in the template just don't seem to cut it

  • Webi OpenDocument URL NAII=Y Not Displaying Prompt Window

    Hi everyone, I have a webi document with 2 prompts. The first is a mandatory prompt that is generated by a universe object. The object is named "Subtract Number Of Days Prompt" and when it is used in a query filter it will generate a prompt and then