How to make a VI wait to execute until another one finishes

Hi all,
I have been reading the labview help for the sync functions, but I am still confused about how to perform this simple task. I have a labview program that connects to a DSP via serial (RS232). I use VISA Read and VISA Write to read to and write from the device. My goal is to first write, wait until writing is finished, then wait for, say, 100 ms (so that it is ensured that all the data has been sent correctly), and then perform the read operation.
At the moment I have VISA Write connected to VISA Read via the error out-to-error in wire. However, I am not sure that they perform one after the other correctly, so I would like to implement a more robust synchronisation.
Thank you very much in advance
Solved!
Go to Solution.

There is also another issue with the synchronous mode on VISA calls. As far as LabVIEW is concerned it is done once the data has been handed to the OS or lower level drivers. For instance, if you use the synchronous call for a VISA write on a TCP connection it will virtually always return immediately even though a trace (using something like Wireshark) clearly shows the data being delaying, buffered and sent out well after the call to the write complete. Given this is NI's position on how this call should work I imagine you could run into the same thing with other interfaces. Their position is that once they have handed the data to the lower level for delivery the call is complete, regardless of whether the data transfer actually was completed.
Even so, if you know what the data you expect back looks like you can simply use the read timeout to effectively give you the delay. Putting arbitrary delays in such as the wait 100 ms may work now but not work in the future. You are far better off to use your actual data streams to control your synchronization. This is especially true in a command/response type of protocol.
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

Similar Messages

  • How to make a short clip out of the original one ?

    Some days ago, I asked a question on editing a clip in this forum. The responder asked me to provide a few seconds of the clip for his examination. But I got stuck. I didn't know how to make a clip of a few seconds out of the original clip and that it had the exact same format and properties as the original clip.
    Neither Premier nor After Effect have an ouput option such as "same as original source" .
    So, my question is how to make a short clip out of the original one with everything the same properties as the original one.
    Thanks in advance.

    May be I haven't made myself clear
    Sorry, but I think that I am still not following you.
    I want to export and render the short clip to a new file which I want to have everything the same as the original clip. Just like I cut off a few seconds off it and that few seconds becomes an independent file.
    OK, you have your original source file. It is complete and is also unaltered. If you want a "Copy" of it, just use Windows Explorer, or similar to make that Copy. If you want a separate file of your edited version of that source file (as it appears in the Timeline), use the WAB (Work Area Bar) to include just that edited instance of the source footage, and Export just the WAB. This will give you a separate file with the edits in it.
    I still feel that neither is what you want. If you can step me through, maybe with screen-caps, what you have and what you wish to end up with, I can see the operation more clearly.
    Good luck,
    Hunt

  • HT204053 how can I reset my apple ID for create another one?

    how can I reset my apple ID for create another one?

    So sorry; somehow I forgot to provide the link.   Here it is ...
    Frequently asked questions about Apple ID
    Again, my apologies.

  • How can I delete my apple id and create another one with the same email?

    How can I delete my apple id and create another one with the same email?

    So sorry; somehow I forgot to provide the link.   Here it is ...
    Frequently asked questions about Apple ID
    Again, my apologies.

  • How to cancle the previous apple ID and creat another one for the same ipad mini

    Please advise how to cancle the previous apple ID and creat another one for the same ipad mini.
    Thank you.

    You can log out of an account (you can't 'cancel' an account) by tapping on it in Settings > iTunes & App Store - any content that you downloaded with that account will remain tied to that account. You can then create a new account via the Create New Apple ID button on that screen. If you don't want to give credit card details then follow the instructions on this page when creating the new account : http://support.apple.com/kb/HT2534

  • How to make a slide wait until user has answered a question correctly, even after activating a smartshape?

    Background:
    I have created a quiz in which the user must answer each question correctly before proceeding to the next slide. This is what I did:
    Set preferences to Settings > Required > Answer All - The user must answer every question to continue
    Set the number of attempts on the question level to Infinite
    Made the Next button invisible and disabled the playbar
    This way, the user can only proceed to the next question slide with the Submit process – and, since attempts are infinite, that means only after successfully answering the question.
    Current goal: 
    I want the user to be able to click on a prompt for a hint. To set this up, I did the following:
    Created a smartshape labeled “click_for_hint” displaying text that says, “Click here for a hint”
    Created a smartshape labeled “hint” displaying text hint
    Set “click_for_hint” to show “hint” on success
    Now, when the user clicks on the text that says, “Click here for a hint,” the hint pops up. So, that works – awesome! However, once the hint is activated, I would like for the user to be able to continue infinite attempts until successfully answering the question… and only then, after answering correctly, proceed to the next slide.
    The problem:
    If the user has submitted one or more incorrect answers and then activates the hint, the slide no longer waits until the user has answered the question correctly. Instead, it automatically resumes playing, proceeding to the next slide. I tried setting the smartshape “hint” to pause on success, but that did not work.
    Is there a way to make the slide wait until the question is answered correctly before proceeding to the next slide, even after the hint has been activated?

    Are you aware of the fact that your Required setting can cause problems, blocking the user? It is also totally unnecessary, because you have infinite attempts on question level, and did hide the Next button (hope you don't need Review, otherwise I would recommend not to hide that button but to drag it under the Clear button: Question Question Slides in Captivate - Captivate blog)
    The hint problem is linked with the fact that a simple action will release the playhead. I would like to see the timeline of the slide, to compare the pausing points of the shape button and the question slide. And maybe this blog post can also clarify difference between simple/advanced: Why choose Standard over Simple action? - Captivate blog
    As for shape buttons on question slides: Buttons on Question/Score Slides in Captivate 6? - Captivate blog

  • HELP! How to make RRI from BEX query into Workbook with one report???

    How to make RRI from query into Workbook???

    Hi Alex,
    A workbook is a set format of queries, so when you try to jump to another query , you will definitely open another session and hence another excel file. This is the same for web templates also though you have an option of opening the new result in the same window.
    You would have to use some macros and open the query on the same page. A RRI is a query jump and not a drill down . A drill down would be getting more of the dimensions into the query.
    Regards
    CSM Reddy

  • How to make The Java Screen Recorder similar to this one?

    Can u talk about this how can make this code with java?
    http://www.devharbor.com/java/300-Screen-Recorder.html
    The author of this application says this maked by Java Swing.
    My Question is:
    What is Java Swing?
    It's easy to make this app?
    What API/Component needed for export video to MP4 Format like this application?
    How can make a similar application for education purpose with Java.
    Thanks

    808154 wrote:
    :) Thank you for answering my question,
    but impossible in nothing bro, Yea, that's what Aleksey Vayner claimed and he didn't do so well.
    I need to know about swing and start to work with java to develop this software and if I need some help I ask here.Clearly yes. You also need to make simple programs and practice for a long time before you're gonna be able to write a screen recorder with MP4 output.
    I try to develop this before 3-4 years ;)I guess 3-4 years is a realistic goal, if you really concentrate on learning Java.

  • How to make Vista partition on the HDD as first one with Recovery CD

    Hello,
    i want to format and recover the information to my "Vista" (C://) partition, which is the first. But when i choose the option "Format and recover to an existing first partition on your hard disk(without RE)" the computer began to recover to "Partition Type: windows NT NTFS (ID: 07)" which size is only 1.50 GB.
    In the middle of the process it shows "not enough space on a disk"
    Question: how to make "vista" partition the first one? What is "the first partition" in the second option of formating and recovering the system?
    Thank You for Your answers

    Hi
    You can obtain from your friends (I am sure someone has it) Microsoft WXP installations CD and install OS on C partition. On Toshiba download page you will find chipset and all necessary drivers to make WXP running properly. When finished connect external HDD or USB memory stick and copy all your data there. you can also install Nero demo version and create data CD or DVD. It is lot of work but if you have time you can do this without any problems.
    Other way connect your HDD as external one to other PC and copy all your important data. Sorry but I do not see other solution.

  • Script executed by another one

    Hi everybody,
    I want to write a script to execute another one. In the first one,the user must give some parameters(for example the number of records to insert in a table). By the second script,records have to be inserted in a table according the parameter the user gives. How may I do that?
    Thank you for your help.

    Hi thiand,
    In your first script use start command including parameters,
    @other_Script.sql param1 param2
    In other script you can reference these through &1 and &2
    [SQL*Plus|http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12170/ch6.htm#sthref1061]
    Regards
    Peter

  • How to make select statement wait

    how can i make the select statement wait until there is not lock on the table( or a row) and return the row once the lock is released is there is a lock on it
    example
    i have a Table t1 with columns c1 and c2
    process1
    stmt1 as select c1 from t1 where c1=1
    process2
    select c1 from t1 where c1=1
    /*some operations */
    update t1 set c2=4 where c1=1
    when process1 is executed it has to wait for process 2 to complete the return a row since it has to be synchronised and are run from different location
    thanks in advance

    You want to get around session consistent select. This is such a nice feature actually. But if you really want to do it, you can fool process 1 by telling it you want to do an update.
    This is process 2:
    SQL> update emp set sal=900 where empno=7369;
    1 row updated.Note I do not commit yet.
    This is process 1, with a "select for update".
    SQL> select sal from emp where  empno=7369 for update wait 10;
    select sal from emp where  empno=7369 for update wait 10
    ERROR at line 1:
    ORA-30006: resource busy; acquire with WAIT timeout expired"wait 10" tells Oracle to wait 10 seconds to get a lock.
    Now process 2 commits within the 10 seconds. The result of process 1 is then:
    SQL> select sal from emp where  empno=7369 for update wait 10;
           SAL
           900
    SQL> commit;You have to issue a commit or rollback in process 1 immediately to release the lock that process 1 laid on the record.

  • How to make a component wait for an event?

    Hey there Adobe community, I recently started using Flash Builder and I have a problem. I have a windowed application in Flash Builder with some script code and then a base64 image.
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           xmlns:flexlib="http://code.google.com/p/flexlib/" preinitialize="loadImage()">
        <fx:Script><![CDATA[
            import flash.display.BitmapData;
        import flash.utils.ByteArray;
        import mx.controls.Image;
        import mx.core.UIComponent;
        import mx.graphics.codec.JPEGEncoder;
        import mx.utils.Base64Encoder;
        private var image:Bitmap;
        private var base64image:String="";
        private function loadImage():void
            var loader:Loader = new Loader;
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
            loader.load(new URLRequest("mypic.jpg"));
            trace("started loading");
        private function getimg():String
            trace("flexlib accessing image ", base64image);
            return base64image;
        private function imageLoaded(event:Event):void
            image = new Bitmap(event.target.content.bitmapData);
            base64image = getBase64FromComponent(image);
            trace("image converted");
        ]]></fx:Script>
        <flexlib:Base64Image value="{getimg()}"/>
    </s:WindowedApplication>
    The flexlib tag should render an image from a string. I want to load an image in the actionscript code, convert it to a string and then draw it. However, as soon as the application starts it attempts to render the string, which is still empty.
    The trace is like this, for some reason the getimg() is called twice:
    flexlib accessing image
    started loading
    flexlib accessing image
    image converted
    As you can see, the image isn't converted until after flexlib tries to draw it. The solution would be to make the flexlib component wait for the imageLoaded event, or make the specific tag re-initialize itself. How can I do this?

    Great, thanks. Now I can narrow my problem scope down.
    This is now the isolated culprit of my program:
    "Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space"
    I already ran garbage collector just before 2nd method but the same error still occures.
    But if I were to comment out method 2, run the program (to generate the file from method 1), then do the opposite and run again, it will work. ie. I have to run the main program twice.
    I don't understand this. The free memory after running GC after method 1 has reset the free mem to approx 1654kb so why can't method 2 run properly?
    Even if I just run method 2 alone, the free mem it starts with is 1639kb.
    Here are the memory values during the execution.
    //all memory values in kb
    Max memory = 65088
    Allocated memory = 1984
    total free memory: 64743
    free memory before method 1: 1639
    // Run method 1
    free memory after method 1: 875
    free memory after running garbage collector: 1654
    //Run method 2
    free memory after the main computation in method 2: 4807
    free memory AFTER running garbage collector: 6733
    Any solutions?

  • How to make a callback to be executed between PreUUTLoop and PreUUT?

    I am building a model in Teststand, which will be a base of any client sequence file, I expect some of callbacks in the model to be executed between PreUUTLoop and PreUUT, how  can I do it?
    Thanks
    Jacky

    Jacky,
    You can make as many callbacks as you like execute between the PreUUTLoop and PreUUT callbacks.  Just as an example, here is how I would insert a new callback a modification of the Sequential Model:
    - Copy over the <TestStand>\Components\NI\Models directory to <TestStand>\Components\User\Models directory.
    - Open the SequentialModel.seq found in the User\Models Directory
    - Go to 'All Sequences' under the view dropdown.  Right click, and select Insert Sequence.
    - Rename the sequence to whatever name you would like.  Right click on this newly created sequence, and go to Properties...  Click the Model Tab, and select Model under the dropdown box.  You have now created a model callback.  The only thing left to do is insert it into the "TestUUT" and/or "SinglePass" execution sequences. 
    - In the view dropdown box, select the TestUUT execution sequence.   You'll notice that quite a few subsequence calls and statements are already used between PreUUTLoop and PreUUT.  Note the "Next UUT" Label.  If you would like to have a callback run only once, before the start of the UUTLoop, you'll need to insert the sequence call before this label.  Otherwise, you can insert the sequence call after the label.  For this example, lets insert a sequence call before the NextUUT label.  Right click on PreUUTLoop Callback step, and select Insert Step >>Sequence Call. 
    -Go to specify module under this sequence step.  Select the current file checkbox, and choose your newly create model callback  from the dropdown list.
    At this point, you've inserted a model callback between PreUUTLoop and PreUUT.
    Chapter 10 of the TestStand reference manual should provide you with a lot of information on modifying the process model.  Make sure to take a look at it.
    Let me know if you need any other help.  Have a great day!
    Andrew W || Applications Engineer
    National Instruments

  • How to make Flash to wait for user input

    Hi,
    I found this PHP script, then I made some changes to make it
    FEED the Flash user interface with online user input.
    The main concept of this script is WAITING for user input, so
    it shows the messages and then go to next line and so on.
    The user input go to directly to TEXT file which writes in
    lines, each line has a unique id = (mag_id).
    There "get_msge.php" which works as the middleware between
    FLASH and messages text file.
    The problem, its doesn’t show any data while there are
    data in the text file.
    Help here please, best regards.
    This is the link of
    problem illustartion
    AS is:
    // create an object to store the variables
    varReceiver = new LoadVars();
    // load the variables from the text file
    varReceiver.load("get_msg.php?file_id=1&msg_id=1",
    "POST");
    // trigger something - when the variables finish loading
    varReceiver.onLoad = function(){
    //the variables have finished loading
    if (this.msg_id == 1) {
    _root.xmsg1_swf.text = this.msg;
    _root.xmsg1_ch.text = this.msg;
    gotoAndPlay("line2");
    } else {WAIT }
    PHP is:
    <?php
    //get these values from the FLASH
    $file_id_swf = $_POST ['file_id'];
    $file_name = "messages/messages".$file_id_swf.".txt";
    $msg_id_swf = $_POST ['msg_id'];
    // [0] ."||".[1] ."||".[2] ."||". [3] ."||".[4]."||". [5].
    //$msg_id."||".date."||".time."||".$from."||".$to."||".$msg.
    $fp = fopen ($file_name, 'rb');
    while (!feof ($fp))
    $msg_txt = fgets ($fp, 1024);
    $line = explode ("||", $msg_txt);
    $msg_id = $line[0];
    $from = $line[3];
    $to = $line[4];
    $msg = utf8_encode ($line[5]);
    if ($msg_id == $msg_id_swf)
    echo
    "msg_id=".$msg_id."&from=".$from."&to=".$to."&msg=".$msg;
    }//while
    fclose ($fp);
    ?>

    Well, given the things that you've written, I don't think it
    could. There technically isn't any code in flash that lets it
    "wait." In order to "wait," you must run the script over again
    until some condition is met.
    However, your code does look accurate. Why do you need to
    wait? The onLoad function will be invoked WHEN something is loaded.
    So, I don't see the reason for the "waiting."
    In addition to that, I would like to say that using text
    files isn't that great with flash. I have done this before and
    noticed several problems with using text files. The biggest problem
    is that the text files are cached after being loaded. Every time
    you re-load it again, you will get what you got the first time
    until you reset your cache (ie. close your browser). I suggest
    using MySQL. (Just my thought.)

  • How to make Launchd/LaunchAgents wait for volume mount?

    I've been trying off and on for months to resolve a problem I have starting up named on my OS X 10.5 Mac Mini, which acts as a home server. Actually, I've been trying since 10.4 came out.
    All my configuration files are located on a volume located on an external pair of RAIDed drives. At system startup the volume mounts automatically, and I have soft links pointed to the remote directories, in this case /usr/local/etc/. The problem is that system startup doesn't wait for this volume to come online before starting to run items in LaunchAgents. Therefore, using the StartAtLoad option, I'll see messages in the system log from bind saying that it tried to start, but the config file /usr/local/etc/named/named.conf wasn't available, so it died.
    I've experimented with WatchPaths - that doesn't seem to work reliably because by the time it gets going, the path is available; since it doesn't actually check availability, but only status change, it doesn't work. (If I log in and touch the file afterwards, named starts right up.)
    I can figure out some hack to run a script and check the status regularly and launch/re-launch, but I'd rather figure out how to do this the "right" way with launchd. Current (still broken) script is below. Thanks for suggestions!
    KeS
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.bind</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/sbin/named</string>
    <string>-f</string>
    <string>-c</string>
    <string>/usr/local/etc/named/named.conf</string>
    </array>
    <key>WatchPaths</key>
    <array>
    <string>/usr/local/etc/named/named.conf</string>
    </array>
    <key>Sockets</key>
    <dict>
    <key>Listeners</key>
    <dict>
    <key>SockServiceName</key>
    <string>domain</string>
    </dict>
    </dict>
    </dict>
    </plist>

    Umm, ok. Are you suggesting that there's more likelihood of getting an answer there, or that it's in the wrong place here? I hate to bother developers with a user question. I'm not asking for new features.
    Tx.
    KeS

Maybe you are looking for

  • Will i need to ersae my disk?

    Hopefully some one can help.... I have a Flat Screen iMac, 800Mhz G4 Superdrive. 256 MB RAM and 60GB Hard Drive. I have also fitted AirPort card. I had been working on OS 10.2.8 however i wanted to upgrade to Tiger. I purchased set of 4 discs from Ap

  • Please help, xinit/startx problems when attempting to load Gnome 3.

    I'm relatively new to Arch, but I'm loving every minute of it. I'm here today to ask you to help my troubleshoot a simple problem that's caused me plenty of headaches. I've never had the ability to install ANY Graphical interface on my actual compute

  • Iphone 3gs wont sync to update software

    Trying to update softwareto the new version that just came out.  I can upload the program that need to update but when my phone syncs to back up information it just goes into space and never gets past the 1st of 6 backups.  It will just sit in back u

  • RE: (forte-users) search and replace within aTextData

    Welll, you're both right. The MoveToChar makes it unnecessary (if a little sloppy) to MoveNext as long as you've changed the character. thus, outStr: TextData = new; outStr.SetValue(inStr); while (outStr.MoveToChar(' ')) do outStr.ReplaceRange('_', o

  • My phone is stuck in the recovery mode and iTunes is saying that it is unable to continue with the activation

    I dropped my phone and it needed restoring and my partner did the reset but it just went into recovery mode I now can not connect it to iTunes as it is saying unable to continue with this activation. Does anybody know what I can do to fix it?