Delay/Timer only in a conditional loop.

Hello,
I want to use a delay(or some kind of timer) within my
program. I intend to use to it within a conditional loop. Specifically,
if a particular condition is true, then I want to wait for 50ms and
then check another condition, which if true, I want to stop my program.
I have used wait vi in the timing section. But this vi pauses my
whole program. Specifically, when the above mentioned condition is met,
I want the delay vi to execute along with my data acquistion vi. At
present, when the delay vi executes, everything (data acquisition, peak
detetction, plotting etc) in the program pauses. I guess its correct
functionality of wait vi but it does not suit my need.
Does someone have any alternate for pausing (delay/timer) a
particular condition loop without affecting the other parts of my
program? Specifically, only the conditional loop delays for a certain time while other features like data acquisition, peak
detetction, plotting etc excute normally.
Message Edited by Neuropotential on 02-22-2010 12:47 PM
Message Edited by Neuropotential on 02-22-2010 12:48 PM
Solved!
Go to Solution.

Yes. This is exactly what I was looking for. But, there is a issue. In practise, i will not be looking at 10 sec delay but a very small number like 50 ms. With this approach, when I set a value of 50ms, my program stops after close to 90-93ms (After 50ms, there is a AND gate, when true stops the program; Refer to the attachement).
There are multiple reasons which I see. First is obvious I am using a windows xp with lot of other stuff going on simutaneously. Also. elapsed time vi is an "express vi". Do you think this can be one of the primary reason for such a delay? Finally, I intend to use this program on RT based machine.
Do  you see it working exactly as expected on those machines or do I have to modify my code? Please guide me. 
Also, how to I mark your post as answer and other good things. 
Thanks 
Attachments:
Image.JPG ‏60 KB

Similar Messages

  • Best way to capture data every 5 ms (milli-seconds) in the .vi diagram when using "Time between Points, and Small Loop Delay tools" ?

    - Using LabView version 6.1, is there anyway to change the "Time Between Points" indicator of (HH.MM.SS) to only (mm.ss), or to perhaps only (.ss) ?
    - Need to set the data sampling rate to capture every 5 milliseconds, but the defaults is always to 20 or greater; even when the "Small Loop Delay" variable is adjusted down. 
    Thank you in advance.

    I have no idea what "Time between Points, and Small Loop Delay tools" is. If this is some code you downloaded, you should provide a linke to it. And, if you want to acquire analog data every 5 milliseconds from a DAQ board, that is possible with just about every DAQ board and is not related to the version of LabVIEW. You simply have to set the sample rate of the DAQ board to 200 samples/sec. If it's digital data, then there will be a problem getting consistent 5 msec data.

  • Time not stopping with while loop

    Hello,
    I've attached my VI.  I am having trouble with while loops.
    I want to turn on LEDs. The first LED should turn on after 3s.  The second LED should turn on after 5s.  The third LED will turn on later. 
    The LEDs turn on based on the following conditions:
    Case 0: numeric control > 10 then led_1 off, led_2 off, led_3 off
    Case 1: numeric control <= 10 then led_1 on, led_2 on, led_3 on
    Case 2: numeric control <=5 then led_3 on
    Because of the way I'm delaying time, I have the following problems
    Case 1 --> case 2: led_3 doesn't come on right away
    Case 2 --> case 1: led_3 doesn't turn off right away
    Putting probes in certain areas leads me to believe that these problems are due to the way the time delay is being generated.
    Thanks in advance.
    EDIT: Looking at it more...it seems to be that when the stop condition is true, the loop runs one more iteration. Is there a way to keep it from running that "one more iteration."
    Attachments:
    timing.vi ‏15 KB

    One of the problems is that your VI is not able to "breathe" because it is sometimes trapped inside inner loops that consume all CPU and step on each others toes. All you need is an single outer loop and a few shift registers.
    May of your specifications are still not clear, for example what should happen to LED 1&2 in case #3? Should they remain in the state they are in, or should they turn off, for example.
    Here is a simple rewrite that spins the outer loop at a regular rate, has no inner loop, and does not need any local variables or value property nodes. See if it makes sense. Also note that your code can be simplified dramatically by using arrays. Since the stop button is read with each of the regular interations, we don't need to worry about sequencing.
    Most likely you need to do a few simple modofications, because your specs are not clear.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    timingMODCA.vi ‏15 KB

  • Cannot change delay time for animated GIFs

    I just got PSE 6.0 for Mac, and I've slowly been learning how to do what I'd like to with it. I've noticed that there have been some problems with the program, though, such as sudden lockups that make me force-quit. One of my more serious issues involves making adjustments to the delay time in some simple, animated GIF files that I have been working on, using the Save For Web command. For some reason, I can't change the delay time from its default of 0.2 seconds to anything else; the slider doesn't respond when I click on it, nor can I make any direct adjustments in the field itself. In the end, I'm stuck with just that 0.2-second delay. Is this a bug in the program, or am I just missing something?
    If this helps, I have created a set of animated GIFs with two layers/frames apiece, looping continuously. The second and topmost layer is asigned a Dissolve filter, and usually left at 100% opacity when I make the final adjustments. The workspace background for each is transparent when I begin.
    Oh, also, I am using PSE on an Intel iMac with OS 10.5.6, with 2GB RAM and enough hard drive space to fit everything.

    Unfortunately, this is a known bug in PSE 6 for mac:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=333620&sliceId=1

  • Is there a way to create a fade only for the first loop?

    I have a loop (Modern Guitar Rock 04), which I've extended out so it repeats four times. I select the Fade Tool and X-Fade for drag. I then drag just in front of the loop and onto it, which creates a fade. However, this also creates fades at the beginning of the repeating loops. Is there a way to create a fade only for the first loop?

    The loop function always repeats the same region so of course the fade is also copied. So option+drag the original region to make a (non clone) copy, fade the first region and loop the second one (which you just copied).

  • One Time Only charges in SD-SA and Sales Orders

    Hi,
    We have a requirement to provide a header surcharge condition in sales order / scheduling agreement for one time only charges. This basically required to throw a lump sum charge on order and charge the customer. User would enter the pricing condition manually whenever required and then once this is entered the full value of condition should be charged on the next invoice that is created, after adding the pricing condition on order.
    The challenges that we are facing are:
    1. Once the pricing condition is entered on order/SA, standard system would keep on condition in all the subesquent invoices.
    2. The amount charged is prorated based on the quantity billed.
    3. Any subsequent change of quantity in order results in recalcuation of condition value based on the quantity and might lead to a situation where amount would exceed the actual intended charge.
    1. Is there a way to restrict order pricing condition to be copied on to one specific billing document. Once it has been charge should not be charged again on any of subsequent invoices.
    2. Whenever the condition is passed to invoice, should be passed with full value.
    3. Subsequent changes to order quantity (due to new del. schedule or order change) should not trigger the recalculation of this header condition.
    Adding condition in delivery or invoice directly would easily meet the requirement but due to some limitation we have to add the condition at order only.
    Can anyone suggest how to approach this problem technically? Is there any enhancement possiblity. Can we create some base value formula/condition value formula to override SAP standard behaviour.
    Any help in this regard is highly appreciated. Points guaranteed for helpful replies.
    Regards,Gajendra

    Solved myself

  • GP - post condition loop block

    Hi there,
    I developed two web dynpro applications that implement the Callable object interface. Let's say they are called wdpA and wdpB.
    wdpA has  output parameter id with multiplicity (0..1)
    wdpB has input parameter id with multiplicty (0...n = list)
    Is it possible to do wdpA in a post condition loop block (execute it at least once) and after that block go to the next block that contains wdpB. In going from wdpA (possibly executed multiple times) to wdpB, i want to consolidate wdpA-output_id to and wdpB-input_id so that the id's that were generated in the loop can be processed in wdpB.
    Kind regards,
    J.

    Hi Joren,
    I don't think it's too difficult. You can find a description and an example here:
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/82/0e6f4132f15b58e10000000a1550b0/frameset.htm">Implementing Callable Objects for Background Execution</a>
    In any case you need some references/public parts to determined GP DCs, if you have a NWDI, than it should no problem to reference to them. If not, perhaps the following blog describes a good workaround:
    <a href="/people/andre.truong/blog/2006/06/26/working-with-the-apis-of-caf-guided-procedures-nwdi-or-local-development">Working with the APIs of CAF Guided Procedures: NWDI or Local Development?</a>
    Regards,
      Jan

  • Conditional Loop doesnt work correctly.

    Hi There,
    If you analyze my code, its all about parsing a dictionary.
    Im checking the dictionary for the "aardvark" word. It gives me
    false all the time. When "aardvark" is the first word in the array,
    i.e my_dictionary[0] is "aardvark". I wonder why the conditional
    loop isnt working fine. Im checking if the user string aardvark is
    == my_dictionary
    ; it should be giving me the true value.
    Is there any error in the code? Can anyone explain me where
    im going wrong?
    P.S -> The traces put everywhere gives me the right
    output. Except for the result of the if().
    Regards and thanks a lot in advance.
    Roshan Kolar

    Hi Raymond,
    Thanks for the reply. I got the problem, actually the
    conditional loop was perfect, the parsing was not. The reason
    being, some words in the dictionary had a Space/NewLine/Carriage
    Return at the last index after the word. It was all random, so some
    words were taken, but some were not like "vicious" == "vicious " -
    gave INVALID WORD.
    So I redesigned the parser, where I removed the unwanted last
    char - now the condition worked fine. Thank god I was working even
    after posting the query.
    Thanks a lot Raymond.
    Regards,
    Roshan

  • Phase calculation in conditional loop

    I collect data from 2 channels on an Agilest oscilloscope (DSO-X-2004A) using the IVI Scope Acquire block. After acquiring those signals, I want to know the phase difference, which I calculate in the following manner: Tone Extraction CH1, Tone Extraction CH2, Formula (detect phase1 - detect phase 2). 
    I want to run this in a loop, and store the phase difference each loop. For that I have a conditional loop (set to 10 iterations for now), and after each phase difference calculation I save the new data point to a txt file. Is there another way of storing/saving the phase difference calculation from each loop, besides saving it to file?
    The next problem I have is that after all the loops are finished, I want to look at the phase difference data and plot it vs iteration number. This is a problem because I get the error: "The selected file does not contains any Signals that could be imported" when trying to load the data at the end. I have the load ascii block outside the conditional loop that generates the data file, so I don't know why the load ascii is trying to excecute before the loop is done. I tried splitting everything into Sequence conditions with execution delays, but that hasn't worked either.
    Is there a better way to save the calculation from each loop, or how do I appropriately load by text file after creating it in the same signal express project?
    Thanks,
    John Oxaal

    Thanks for sending the the project.  For now if you would like to easily integrate the setup that you have in SignalExpress into LabVIEW you can actually convert the project into LabVIEW code.  As long as the LabVIEW version is as late or later than your SignalExpress version, you can do this.  Please refer to document below on how to convert signal express project into a LabVIEW VI.
    How Can I Generate a LabVIEW VI From My SignalExpress Project?:
    http://digital.ni.com/public.nsf/allkb/96C01D2680084AAA86256F33007D98FA
     Once you figure out how to take in your data in LabVIEW, you can start placing your data in the array that I mentioned from which you can process the data.
    Cameron T
    Applications Engineer
    National Instruments

  • Digitaizer Card Acquisiton Delay time

    Dear Sir/Madam,
    I've got some problem about the 5911 Digitaizer Card Acquisiton Delay time .
    How to measure the time from the Trigger siganl to the first point of Acquire ?? Do LabView Support this function??
    Beside what is the difference between the "Acquisiton Start Time " and "relativeInitalX" ??? Plz
    Plz help me ?? Thx
    With Regards
    David
    Attachments:
    Acquire.gif ‏40 KB

    Hi David,
    Both the Acquisition Start Time and relativeInitialX provide the same information: the time in seconds from the trigger to the first sample in the acquired waveform.
    The only difference is that the relativeInitialX is an output from several read and fetch VIs (ie, niScope Read Cluster) whereas the Acquisition Start Time is a property in a Property Node which can either be read from or written to. Thus you can set the Acquisition Start Time through the property node.
    Hope that helps, have a great day!
    Brian Spears
    Applications Engineer

  • Using DelayQueue with dynamically changing delay times?

    Greetings all:
    First-time poster, so please be gentle. :-)
    I am implementing a cache timer task whose job is to removes idle elements from a cache after x time, and was considering a DelayQueue as potentially more efficient than iterating through the entire cache each time. Important point is that the delay time of elements in the queue will be dynamically changing while they're in the queue, until the point when they become idle, i.e., each time an element's content changes, its expiration time moves further out.
    I went looking in the DelayQueue source (and from there to PriorityQueue) as I was interested to see how it implements its sorting mechanism, and it appears to me that it may not handle this properly. Specifically, it appears that the queue is sorted when elements are added or removed but not otherwise, so that you could end up with the head of the queue being an element that has not really expired.
    Question: Has anyone used a DelayQueue for this kind of scenario, and if so, did it work as expected?
    Thanks,
    Brian

    If you want this behaviour I suggest you look at
    overriding LinkedHashMap as it has a means to
    maintain sorted from most recently accessed to last
    accessed.
    Thus to clear it all you need to do is remove the
    oldest elements.Interesting. Currently I'm using a HashMap so changing to a LinkedHashMap would require virtually no changes to existing code. It still won't quite work as-is, though, because access only gets updated on put's and remove's, whereas I would need access updated on any modification to a contained object as well. I'll think about it a bit more - thanks for the suggestion.

  • Conditional looping. How to refer to the previous result s of looping?

    Hi,
    I'd like to repeat a sequence for second time only if the sequence failed first time. To do that I'd like to use the Looping feature from step properties. Question: how should I build the Loop Status Expression refering to the Step Staus (Pass/Failed) of first loop?
    Solved!
    Go to Solution.

    In the Looping properties in Loop Type select Pass/Fail count.  Then set the Stop after to 1 and iterations to pass.  You can set the maximum number of iterations to whatever value you desire (in your case it sounds like 2).  You can play with the numbers to fit your scenario.  As you play with the numbers you'll see the expressions values changing.
    I could give you a better answer if I understood exactly what you wanted but this will probably do what you want.
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • CRIO 9474 Output delay time

    I'm going to use the cRIO 9474 digital output modlule to control a high speed/high current driver. The following data is stated in the manual: Output delay time (full load): 1 μs max. Full load is 1A, the current output for the driver is only 10mA. Is there any chance that output delay time will be longer then 1us with such small load (10mA)? Will there be any jitter? My switching frequency is going to be around 200-300kHz.
    Best regards,
    Per

    Hello Per,
    There is a bit on confusion about the 1μs that we spec on the manual.  That time or delay time is just the time that it takes the signal from the cRIO Backplane to the MOSFET in charge of turning the channel ON or OFF.  That time won't change depending on the load.  That means that the gate will start turning ON or OFF at the same time no matter what the load is.
    What changes is how long it takes for the line or channel to get to the desired voltage value.  That will change depending on the load but shouldn't be too significant.
    We don't spec that because that a value that depend on your load.
    Hope this answers your question.
    Ricardo Santa Olalla
    CompactRIO Product Support Engineer
    National Instruments.

  • "Only files in Apple Loops format will be shown in the loop browser".

    I recorded a Drum loop from my Korg m50 workstation into logic pro 9.
    After recording i tried to import that loop into Apples loop library. After doing so i get this message.."Only files in Apple Loops format will be shown in the loop browser."
    What do i do?
    Please help.
    Thanks
    Rohan

    I've recently gotten this error when I try to drag an audio file into the loops library (to create an apple loop.)
    Comes along with Result Code=-43.
    I'm trying to quantize some rhythmic loops using flex, then turn them into apple loops for the library.
    My process:
    Take original audio.
    Flex it using slice mode.
    Bounce in place.
    Drag new region into Loops browser.
    Errors ensue.

  • Set frame delay time for animated gif using ImageIO

    I'm trying to change the delay time of each frame for an animated gif by changing the metadata for each frame as following but it doesn't change anything.
    static private IIOMetadata setMetadata(IIOMetadata metadata, int delayMS) throws IOException
              Node root = metadata.getAsTree("javax_imageio_gif_image_1.0");
              for (Node c = root.getFirstChild(); c != null; c = c.getNextSibling())
                   String name = c.getNodeName();
                   if (c instanceof IIOMetadataNode)
                        IIOMetadataNode metaNode = (IIOMetadataNode) c;
                        if ("GraphicControlExtension".equals(name))
                             metaNode.setAttribute("delayTime", Integer.toString(delayMS));
         }Does anyone know how to set delay time for animated gif using ImageIO ?

    I'm trying to change the delay time of each frame for an animated gif by changing the metadata for each frame as following but it doesn't change anything.
    static private IIOMetadata setMetadata(IIOMetadata metadata, int delayMS) throws IOException
              Node root = metadata.getAsTree("javax_imageio_gif_image_1.0");
              for (Node c = root.getFirstChild(); c != null; c = c.getNextSibling())
                   String name = c.getNodeName();
                   if (c instanceof IIOMetadataNode)
                        IIOMetadataNode metaNode = (IIOMetadataNode) c;
                        if ("GraphicControlExtension".equals(name))
                             metaNode.setAttribute("delayTime", Integer.toString(delayMS));
         }Does anyone know how to set delay time for animated gif using ImageIO ?

Maybe you are looking for

  • Ringtone help window

    How do i shut off the help window in Itunes for ringtones? Every time i click on the bell icon to start the create process the help screen shows up, i then click on store to do it there and the create ringtone is grayed out. I have checked my setting

  • PROBLEM IN SELECT OPTION

    Dear all, i want to display the document no,document status,date of document,document type and item details here input field is document number.tables are bkpf and bseg.i wrote the program and executed that program it causes runtime error.so please s

  • SAP-HR-Organizational Management

    Hello SAP Experts, I would like to learn SAP-HR complete module. so would like to know what are the Process or way to learn SAP HR as it contains many Sub modules from which module should i start ? any link from Sap Help or any response will be appri

  • JDK vs JRE

    In production environments it's usual to install the JRE instead of JDK, thinking that JDK contains development tools that shouldn't be in these environments. However, there are people who think some of these tools are useful even in a production env

  • FM 11 Crashing in book printing

    Hi All, When I try creating a book PDF, by File>> Print, the FM 11 invariably crashes. I can create individual PDFs, not a book file. I have the latest FM 11 and Acrobat 9.0. Windows 7.0 Thanks, Subh