Loops and saving problems

Hey,
I am having a problem saving my data. I have a program that simulates a tap. Essentially a certain voltage will trigger the data to be collected. To present it to everyone in this forum I have just simulated this effect. If the button is turned on then it will pseudo randomly trigger the first inside loop. 
Here starts the problem. When the first inside loop is triggered the graphs show the resulting data and a box pops up asking if you want to save this data. Well everything time I click yes it won't save.Then the next time the first inside loop is triggered the save dialog box pops up to save the current data. It is really weird. If you want to see what I am talking aobut please run the program and click yes you want to save a couple times and I think you will start to understand my problem. 
Essentially I want to be able to see the results of the data and decide if I want to save it or not. If I choose yes then I would like to name the file path.
I have looked at this for hours and can't come to any conclusion why this is happening. Maybe a flow or loop issue?
Please note, the outside loop should always be on to keep the program continuous.
Thanks for any help on this
Solved!
Go to Solution.
Attachments:
newtapsimulateddicussion.vi ‏285 KB

Hova wrote:
@ altenbach which inner loop are you referring to?
There are only two while loops: the outer loop and the inner loop. Why are you confused?
Hova wrote:
... in Labview flow moves top left to bottom right correct?
NOOO!!! You are incorrect. The execution order is completely independent of the diagram coordinates.
The important word is "data dependency". In your code, the dialog and the while loop can execute in parallel, because they do not depend on each other. If you would place any of the inputs to the dialog inside the inner loop (e.g. as in the picture), the dialog now depends on data from the while loop and thus cannot start until the loop has finished.
Play around with execution highlighting to get a better feel for all that.
You can un-mark the solution via the options menu of the post. Have you tried?
LabVIEW Champion . Do more with less code and in less time .
Attachments:
LoopDataDependency.png ‏7 KB

Similar Messages

  • Loading and Saving problem in 2D space based rpg

    I am implementing a system in which the game saves the offset of the default position of an object in space and the object's position when the game is saved and applying that to the objects when the game is loaded. I get a strange problem however where every other undock after loading the game is far far away in space. I think it has something to do with the saved position of the object you docked with. Here is the code involved in loading the game (it just calls IO.java via dataAgent and gets data from a file)
    public void loadGame() throws FileNotFoundException, IOException {
            //load the game
            String[] tmpData = null;
            tmpData = dataAgent.loadGame();
            //interpet the data
            hud.currentDockedCelestialObject = Integer.parseInt(tmpData[0]) - 1;
            player.currentWallet = Integer.parseInt(tmpData[1]) - 1;
            player.currentSolarSystem = space[hud.currentDockedCelestialObject].solar;
            hud.renderMode = 1;
            hud.player = player;
            hud.space = space;
            hud.dPressed = true; //tell HUD we are docked at something
            //now we need to determine the position of all the celestial objects based on the saved position of the object in question
            int tmpx = Integer.parseInt(tmpData[2]) - 1;
            int tmpy = Integer.parseInt(tmpData[3]) - 1;
            //compare it to the docked celestial
            int changex = space[hud.currentDockedCelestialObject].positionX - tmpx;
            int changey = space[hud.currentDockedCelestialObject].positionY - tmpy;
            //apply the offset to all the objects in the current solar system
            for (int i = 0; i < space.length; i++) {
                if (space.solar.matches(player.currentSolarSystem)) {
    space[i].positionX += changex;
    space[i].positionY += changey;
    //now we need to load the ship type
    player.ship.type = Integer.parseInt(tmpData[4]);
    //configure the shields and hulls
    configureLoadedShip();
    //finish up
    hud.space = space;
    hud.player = player;
    Configureloadedship() just makes a call to apply the correct weapons and armor to the ship you have. Here is the saving code:public void saveGame() {
    //saves the game
    String[] toSave = new String[5];
    toSave[0] = "" + (hud.currentDockedCelestialObject + 1);
    toSave[1] = "" + (hud.player.currentWallet + 1);
    toSave[2] = "" + (space[hud.currentDockedCelestialObject].positionX);
    toSave[3] = "" + (space[hud.currentDockedCelestialObject].positionY);
    toSave[4] = "" + (hud.player.ship.type);
    try {
    dataAgent.saveGame(toSave);
    } catch (IOException ex) {
    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    Adding and subtracting 1 durring load and save solved the problem of the java file reader skipping the 0 values in the first few lines of the saved game file.
    The game is loaded when the game starts and saved when you dock.
    Ty in advance for your help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    public String[] loadGame() throws FileNotFoundException, IOException /*should never be thrown*/ {
            String[] toReturn = null;
            //load the data
            FileReader read = new FileReader(data);
            BufferedReader buff = new BufferedReader(read);
            String tmp1 = "";
            String tmp2 = "";
            while((tmp1 = buff.readLine())!=null) {
                tmp2 = tmp2 + tmp1+"~";
            //break it into a usable form
            toReturn = tmp2.split("~");
            System.out.println(tmp2);
            return toReturn;
        }and
    public void saveGame(String[] toSave) throws IOException {
            FileWriter write = new FileWriter(data);
            BufferedWriter buff = new BufferedWriter(write);
            //clear the old file
            data.delete();
            data.createNewFile();
            //zap the data to the file
            for(int i = 0; i < toSave.length; i++) {
                buff.write(toSave);
    buff.newLine();
    //write
    buff.flush();
    }They are basically just buffered readers and writers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • HT2523 Word docx file conversion and saving problems

    I've recently switched back to Mac after many years as a Windows user. I was delighted to be able to open my Word documents in TextEdit, but have had to reformat certain parts of the documents (specifically, bullets, tabs, and wrap to page) EVERY TIME I open the document. These are not saved in the file. I'm happy to change the format of the documents to rtf or whatever to keep the changes, but can't figure out how to do that either. The ultimate format for these docs is PDFs, so I don't really wish to buy MS Office for Mac. I can't find anything about this in TextEdit help.

    In support of your advice ....
    Preview will open directly .doc/.docx Word files. The path to PDF can also be through the Export facility.
    Preview is only as good as Pages when attempting to open Word documents. If the OP has complicated Word documents that will not open with Preview, then a suggestion is to download and install the free LibreOffice 4.x (libreoffice.org) application. This will certainly open Word documents.
    Rather than learn LibreOffice just to convert PDF, the OP can use the following Terminal command:
    Terminal:
    /Applications/LibreOffice.app/Contents/MacOS/soffice --headless -convert-to pdf:writer_pdf_Export sample.docx
    This will write out a PDF of the input file to the current directory. Providing *.doc or *.docx on the command-line will convert all files matching this description to their PDF counter-parts. There is a --outdir argument that given a path to a directory, will place the resulting PDF there for improved organization.
    The above command does not visibly launch LibreOffice. The only output is a single line to the terminal indicating that the conversion has taken place.
    Cheers.

  • Illustrator CS6 opening and saving problem. Please help

    Hello
    I have Illustrator CS6 installed on windows 8.1. Every time I save a file as ai. format, it will automatically create a copy on the desktop. When I deleted the copy and try opening the original file, the error message "The file is an unknown format and cannot be opened" pops up. I've checked that the file is not "read only", deleted the pref files and even reinstalled Illustrator CS6 but none of these have solved the problem. I have also noticed that I cannot copy or rename the file as the same error message pops up. Any solutions? please help

    (1) When I go to open files, raw or jpeg, I now need to enter a value for 'enable' on the open dialog.  That never was necessary before.
    Could you please post a screenshot with the pertinent Panels/Dialogs visible?
    (2) When I go to save as jpeg, the file type defaults to eps. 
    So you select jpg from the dropdown list and it switches to eps?

  • Importing and Saving Problems

    Hello,
    I need help with getting my AE 7.0 Professional Version to work. It will not allow me to import and save my work.  Does some know what the issue may be?
    Here is what system I am using:
    MAC OSX 10.6.8
    2.33 GHz Intel Core 2 Duo
    2 GB Memory
    After Effects
    Student Version 7.0 Professional

    Hello Rick,
    I tried to locate the correct Rosetta download for OSX 10.6.8 and I was not able to find it.  I tried downloading the Rosetta for OSX 10.6.3 and it would not work with newer versions.    Do you know where I can find this Rosetta Download or is there another option you might know about?
    Ben

  • I have downloaded Firefox 5.0 at least three times and saved file, but I don't know how to install and run. It keeps asking me to download new version and Save file. I'm in a never ending loop, it keeps downloading same exe & does not install Please Help

    Please tell me how to install and run new Firefox 5.00 after I have downloaded the new version and chosen Save File. I just go into Loop and screen says new version available and download again !

    Did you ever resolve the iCloud problem.I am in the same position and its driving me mad!!! If you have a link to an solution I would appreciate it.

  • Saving Jpeg in Photoshop CS4 and having problems

    Okay, i have been looking all over the internet and i hope it's something really foolish...
    After editing a photo in Photoshop (CS4) and saving it as a JPEG / JPG, many people using windows can't open the file, and it gets the extension .JPGG ( ...?... )
    If I import the picture in Iphoto first and then mail it ther is no problem.
    perhaps this is quite obvious to some, but it's a mystery to me.
    To update my website i need to save my JPG files to an XML folder and then flash reads the files and opens them in the site.
    The JPG files i saved using photoshop won't open in the site, even worse, the site won't even load because the loader gets 'stuck'.
    i tried putting them in Iphoto first because that helped with with mailing, but it doesn't seem to be working this time.
    I've tried all the JPG saving options like Baseline etc. converted them to RGB ( they already were) so i'm out of options.
    ANYONE ?

    Welcome to the Apple Discussions. I have CS3 so don't know if there's major changes to the formatting process by each version. That may be a question to ask in the Adobe support forum.
    However, for a workaround you might try using the Automator workflow I created to change any image file to jpg with the sRGB color profile. Just drag the files onto the workflow icon and they will be converted. You can get it, "Convert to JPG and Embed sRGB profile", at Toad's Cellar. See if those jpgs will work OK. There will be some jpeg compression applied but if they are for posting on the web it may not be objectionable.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • Problem with  whitespace  then loading and saving xml

    i do not know how to handle this problem. i modifed a texteditor to send XML to a server and load XML back to the container.
    but then i do changes to the Textlayout it shows up like this --->
    Text in Container not modifed
    Text in Container modifed ---> with space beween the colorchanged string
    Text inContainersend and loaded ---> i think this has something to to with the
    TextFilter.export(_textFlow,TextFilter.TEXT_LAYOUT_FORMAT,ConversionType.XML_TYPE)
    can someone give me a hint...

    Hi,
    the link is --->
    http://www.horstmann-architekten.de/contentmanagment/SimpleEditor.html
    its a modified example of the texteditor provided by Adobe. You can send a xml to the server. and also read it from the server. You just use the xml identifer to give the xml a name.
    Try it out:
    1.  change the text and
    2.  give a XML-Identifer
         and then send it to the server. --> send to server
    3.  type in the XML-Identifer you have used and
    4.   load it from the server ---> Load from Server Button
    evering works ok exept the columns formating.
    I Think the colums Formating is not embeded in the XML as it should be. I attached the Files. (Newbie programmer)
    With best regards
    Michael Sprinzl
    --- robin.briggs <[email protected]> schrieb am Do, 17.9.2009:
    Von: robin.briggs <[email protected]>
    Betreff: Problem with  whitespace  then loading and saving xml
    An: "Michael sprinzl" <[email protected]>
    Datum: Donnerstag, 17. September 2009, 2:12
    Sounds like you have two different issues going on: (1) inline graphics aren't coming out correctly when you use the TextLineFactory, and (2) columns aren't working correctly. It's difficult for me to tell by looking at the application you link what is going wrong. One of the examples does seem to have columns working -- can you be more specific about what you're doing, and what results you are seeing? As for the inline graphics, there is a timing issue involved with using URLs, due to the asynchronous loading. See this comment in the docs for TextFlowTextLineFactory:
    Note: When using inline graphics, the source property of the InlineGraphicElement object   must either be an instance of a DisplayObject or a Class object representing an embedded asset.   URLRequest objects cannot be used. The width and height of the inline graphic at the time the line   is created is used to compose the flow.
    - robin

  • A few selection of websites after fully loading become blank and start an infinite loop of loading. I reinstalled firefox once already and the problem persists. What can I do?

    A few selection of websites after fully loading become blank and start an infinite loop of loading. I reinstalled firefox once already and the problem persists. What can I do?

    Sorry I do not know what the problem may be. <br />
    If no-one comes up with better ideas of what causes this then my questions and suggestions:
    What do you mean by an infinite loop ? <br />
    The page loads and then goes blank. What exactly happens next, does the page fully load and fully display again before going blank, and repeat this cycle endlessly in the same tab.
    You do say the problem persisted in safe-mode and you had looked at the basic troubleshooting article. Buy that you can stop the problem by disabling javascript.
    * did you disable all plugins - and did you still get the problem then ?
    As you mention disabling javascript stops the problem, have you tried with<br /> Java script enabled but
    * block popups ON
    * load images automatically OFF
    * advanced options - ALL OFF<br /> What happens do you get the problem then or not.
    While on this firefox site if I look at the error console Ctrl+Sift+J or Tools -> Error console If I clear the console content and reload the webpage the error console shows only a couple of messages. YouTube home page give a lot of yellow triangle warnings about 200, but no red warnings, do you get red warnings.
    You could also try on the problem sites eg YouTube changing the permissions with tools -> Page Info | Permissions
    Did you try the Basic Troubeshooting suggestion of making a new profile. (Heeding the warning not to delete settings, otherwise you loose all bookmarks etc) did that help ?

  • Problem occurring when opening and saving files in AI SC5 with Windows 7

    Hi, I ‘am a Graphic Designer and first time working in UAE Windows 7 is basically the only OS here. My PC is:
    HP Elite 7000
    Intel® Core™ i5 CPU 2.67GHz
    4GB RAM
    32-bit
    Now to the problem, not that knowledgeable in IT stuff so here goes:
    1. Problem occurring when opening and saving files in AI SC5 with Windows 7. (You will actually see a “Not Responding” word coming out while opening and saving files, whether small or large files)
    2. Locked layers occasionally are moved accidentally.(Working on multiple layers is normal so we need to lock it specially the once on top. But there are times I still manage to select locked layers)
    3. After typing and locking the text, pressing “V” for the arrow key shortcut is still added to the text that is locked. (After typing I lock the text layer with my mouse and Press “V” to activate the arrow key… yes the arrow key is activated but the text is still typing the actual keyboard pressed)
    I’ve only use the brand new PC and installer for a month now. Not sure if this is compatibility issues or something else I’m not aware of.
    Thanks in advance to people that will reply.
    Cheers!!!

    Well I’m still wondering if it is compatibility issues because I’m also having problem with Photoshop CS5. These 3 are all bought at the same time (PC, Illustrator and Photoshop installers). The problem I’m having in Photoshop is not that too important, every time I Ctrl+O to view files, all PSD are shown in white paper like icons, no preview, and saving as well.
    Or I just purchased a corrupted or pirated installers… Adobe updates are done every time I’m prompted.

  • Hello I am having problems viewing areas of a pdf...it's a form fillable pdf that someone else has completed and saved..I'm able to view all but the areas that have been filled in.. any info would help

    Hello I am having problems viewing areas of a pdf...it's a form fillable pdf that someone else has completed and saved..I'm able to view all but the areas that have been filled in.. any info would help

    Hi Bob, I just tried your suggestion, but the interactive PDF is in spreads by default, no way to change the setting. When I choose to view by single page in Acrobat, it displays a single spread.
    When I choose to view by spreads, it displays 4 pages, two spreads. That's the topic of this whole discussion, I believe. I do own CS 6 at home, however my employer supplied me with CS 5.5. And I have very little, if any, influence on purchasing.
    So, I have no good way to make an interactive PDF (with differing recto/verso headers and footers), that is accessible and shows the correct header/footer. It's either single pages (with one header/footer), or recto/verso headers/footers but PDF only as a spread, as well as I can tell.
    Unless you know something else I can do...
    Best, Marilyn

  • I have my catalog "Back Up Each Time Lightroom Exits" checked, and always have. That means the catalog should have been backed-up and saved everyday, if not more than once on some dates. So with a a major problem now and needing to use the Catalog backup

    I have my catalog "Back Up Each Time Lightroom Exits" checked, and always have. That means the catalog should have been backed-up and saved everyday, if not more than once on some dates. So with a a major problem now and needing to use the Catalog backup from last Friday, I go to my Lightroom Backups folder - and the most recent one showing not only isn't yesterday, it's OCTOBER 28 !?? Where the hell are the daily backups between October 28 and November 14?

    Oh wow - JET LAG strikes agin - my apologies; I have located the missing weeks of back-ups. After getting home from a 30-day trip to Europe, I had changed the location of my LR catalog back-ups to an external drive, and forgot that I did that. I have found them, and all is good. Never operate Heavy Machinery without enough rest. Cheers

  • Creating and Saving My Own Midi Loops/Instrument

    I know how to create a new instrument in GB but can I also create and save midi loops that are attached to the instrument and save them in the loop browser? The same way other midi parts work so when you drag the midi out of the loop browser and into your session it loads both the part and the instrument at the same time?

    spidernook wrote:
    can I also create and save midi loops that are attached to the instrument
    select your loop and use the Add To Loop Library menuItem

  • A problem with delays in timed loops and DAQ

    I am programming a simulation for nuclear rewetting for a visitor centre at my company in Switzerland. It involves heating a "fuel rod" and then filling the chamber with water. The pump automatically starts once the rod core reaches 750C. After this, a requirement stipulates that flow rate be checked to ensure the pump is operating at the necessary conditions. If it isn't, the heater must be shutdown to avoid, well... meltdown. However, we must allow 10 seconds for the pump to respond, while still allowing a DAQ rate of 10-100Hz.
    The challenge is that I can't add a delay in my main loop else delay all acquisition, but I can't figure out how to trigger a peripheral loop (with DAQ for the single channel of checking flow) from the main loop, and when the peripheral loop determines if flow has initalised, respond back to the main loop with the okay.
    I think much of my confusion is in the interaction of the loops and the default feedback nodes that labview is putting in willy nilly. Would the only solution be to have two 'main' loops that don't communicate with eachother but rather do the same thing while operating on different timing? Tell me if you want me to post the file (although its on an unnetworked computer and I didn't think it would be too useful).
    Thanks+ Curran
    Solved!
    Go to Solution.

    Here it is! It is not in any form of completion unfortunately.
    So reading in the temp with NI9213 and watercolumn height with NI9215, we determine to turn on the pump with NI9472. NI9421 determines whether the pump is on (there is flow) and I must respond accordingly.
    I have 3 scenarios similar to this one as well, so having redundant loops with different timing like I mentioned would be way to heavy. I think I may have though up of a solution? At the time the pump is initiated, we record the iteration and wait for a number of iterations that correspond to 10s to pass before fulfilling the pump shutoff requirement?
    Attachments:
    rewettin1.vi ‏15 KB

  • I am having a terrible problem trying to get a player to loop and play all the time.  Please help

    Heres my code. I added a bunch of extras in there in hope that it will work.  It does auto start, however it won't keep looping and restart it.  Whats wrong with it?
    I have loop = true and i have autorewind = true autoplay=true autostart=true.  I don't get it.
    <object id="player1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.115" width="250" height="250">
          <param name=bgcolor value="#FFFFFF">
          <param name=movie value="players/player.swf">
          <param name=allowfullscreen value="false">
          <param name=allowscriptaccess value="always">
          <param name="flashvars" value="file=http://www.websitename.flv&autostart=true&loop=true&fullscreen=false&amp;controlbar=bottom &autoPlay=true&amp;autoRewind=true">
          <param name="SCALE" value="exactfit">
          <param name="LOOP" value="true">
          <embed src="players/player.swf" width="250" height="250" loop="truhe" scale="exactfit" name="player1" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" bgcolor="#FFFFFF" allowfullscreen="false" allowscriptaccess="always" flashvars="file=http://www.websitename.flv&autostart=true&loop=true&image=&fullscreen=false&controlbar=bot tom&autoPlay=true&amp;autoRewind=true"></embed>
        </object>

    Hi, you are welcome
    eidnolb

Maybe you are looking for

  • SAP ERP 2005 SR 2 IDES installation error in step "Run ABAP Reports"

    Hello, I'm installing SAP ERP 2005 SR 2 IDES on Win2003 R2 SP2 and Oracle 10.2 to create a test-system for my diploma thesis. During the step "Import ABAP" I got the following message: object_checker.log ERROR: 2008-05-21 20:50:38 1 objects have erro

  • 6.0.1 &6.0.2 are crashing and unstable with Sys.7. PLEASE HELP

    Laptops or desktops running sys7 that NEVER crashed before are CONSTANTLY crashing with 6.0.1 and 56.0.2 fireFox on Windows 7

  • 3.1.2 "upgrade", is EVERYone having the same problem?

    So is every single person who has upgraded their OS had the same problems? Mainly: 1. WiFi connectivity 2. Pressing the home button twice does not open up the music menu anymore. 3. Apps crashing constantly. I would appriciate any feedback on these a

  • How to put image in tooltip?

    I know that to create a tooltip I would put the following code into the HTML Form Element Attributes property of a page item. onmouseover="toolTip_enable(event,this,'my tooltip text');" But, how do I get an image in the tooltip? Thanks, Maggie

  • Last date of the selected quarter

    hi all - I have been struggling to figure out how to get the last date of selected quarter. for example, if the user has selected 2014 Q1 from the date hierarchy, I want to show 2014-03-31. any idea how to accomplish this? thanks in advance