Wait loop

Hello

I want my time a loop to run according to the constant time, I put in a table, but it will not scrupulously.

For example, I set the time as 1000,1000,3000,3000... : but it's more like 1000,1000,1000, 3000... sometimes. but sometimes seems OK...

What's wrong?

Thanks in advance

Salvation the seafood.

Use the "hold" function instead of waiting "until...". ». Is your vi on an RT target? If the loop is running elements, then available in your table, then you will get 0 as the timeout.

Mike

Tags: NI Software

Similar Questions

  • for the wait loop until the Subvi

    Why this loop for not expected before the end of Subvi.

    the Subvi is to go from the stage.

    Please see attached picture.

    He will meet before the end of the Sub - VI.  If she does not seem to as long as you think it should, then something should happen in the Subvi bringing back too fast.

  • Minimum time to wait in the loop of reading series

    Hello

    I would like to ask if it is possible to read data from a serial port loop each 17ms? If so, how to read Serial and it management loop set.

    I'm the Arduino Uno card reading that can run on up to 115200 baud rate of kbs. Arduino sends each integral 17ms (0-3). Now, I can't read them separately (each part one by one, I get numers as 123, 231, 12, instead of 1, 2, 3 etc.), but this may be due to other stuff I do in the loop. I elaborate more on my VI later - now I would like to know if it is possible using LV 2011 + VISA read serial number of each 17ms. What bothers me the most is that I saw many times on this forum that people suggest of don't not to go below 10ms timeout in the Serial reading loop (same base series Read and Write provided in examples of or). If ms waiting loop of x, where x is 17ms divider?

    You hear that you read whole and not full? Send you one byte or more? If it is a single byte, then just define it as the number of read. Do not put in any function wait and do not use the VISA to the Serial Port bytes. Playback VISA will be automatically terminated when one reads a single byte. You send a terminator after the number? Waiting in the example has nothing to do with a constant data stream reading and with a terminator is completely useless.

  • How to end Vi in a For loop

    Hello. I enclose my Vi. I have a question about stopping a loop For I have 2 loops for the case "Test underway". I have a termial conditional that will stop my Vi but only after you have completed all the iterations of the loop For I have need of this Vi to stop immediately, when you press the stop button. I realize that it will take probably still finish an iteration, however, at the present time it waits until all iterations are performed, before coming to rest. I'm doing it with the same front button that stops the while loop. I tried a local variable, but to change a mechanical action and I prefer not to do, if this is possible. There was a lot of posts related to this topic here on the forum but I couldn't find the one suited to my needs. Thank you for your time.

    Your While loop waiting loops to stop, so you can use local variables of your stop button to stop the for loops right now.

    See you soon,.

    Jimmy

  • JIT - random delay / waiting

    Hello

    How can I defer action in an applet? But should not be a fixed time, the best solution would be a random value. Let's say that + / 5 s...

    If generating a random real has been worth is not possible, some Pseudo-aleatoires value might help. Something like extract a numeric value from No. series router.

    Thanks for the ideas / Karsten

    Although not necessarily random, you can use the parameter msec to see the clock output to simulate a random number between 0 and 5 using something like this:

    Event Manager applet two

    event no

    Action 1 cli command 'see the clock.

    Action 2 regexp ".» * \. ([0-9] +). ' ' * ' $_cli_result ' match msec

    fracture of action 2.5 $msec 6

    Action 3 "random: $_remainder.

    Unfortunately the wait action not accepting a variable as input name if you want to run commands in a loop and have each run at a random second, you would have to create a wait loop before running the command.  Here is an example:

    Event Manager applet three

    event no 60 maxrun

    action 098 puts "loop run 5 times"

    game action 099 County 0

    action 100 all $count lt 5

    action cli 101 command 'see the clock.

    action 102 regexp ".» * \. ([0-9] +). ' ' * ' $_cli_result ' match msec

    action 102,6 multiply $count $count

    action 102.7 multiply $msec $_result

    action 103 divide _result $6

    game action 104 I have "0".

    action 105 all $i the $_remainder

    action 106 wait 1

    action 107 incr I have

    108 action ended

    109 action puts ' expected $_remainder seconds.

    incr action 110 County

    end of the 111 action

    action 112 puts "loop finished."

    This product output such as:

    #ev man run three

    loop running 5 times

    WAIT 0 seconds

    wait 5 seconds

    wait 2 seconds

    wait 3 seconds

    wait 2 seconds

    finished loop

    Thank you

  • Wait to start operating system

    Try to run a script after the reboot.

    Using a wait loop that checks host.runtime.connectionState.value = connected to determine the moment to take the step "run script".

    However, this operation will fail because the host returns connected status before the OS is finished booting.  Is there a better process/call to wait until the os has finished start?  According to me, Miss me something quite simple.

    What kind of host? VMware Tools are installed? If so, and if it's in a global workflow (compared to an action), then use the 'vm3WaitDnsNameInTools' action - he waits until the loading tools and report the DNS to vCenter... at this point, a guest operating system is usually ready for further action taken on this subject... (Note: see one of the Clone workflow & customize in the library... for example, I look at the workflow "Clone, windows with single NIC" as I type this for reference...)

  • Code to wait until something is finished before starting another?

    Hi all

    Coding is not my strong point, but I have a basic understanding of the operation of the functions, etc.

    I learned about the SEO of the chronologies of symbol with the impressive Adobe Blog tutorial, included below.

    http://blogs.Adobe.com/edge/2012/07/18/tutorial-leveraging-independent-symbol-timelines/

    I could get my symbol to play from a certain part of his timeline depending on whether the mouse is rolling in or out, but now I'm a little stuck.

    The mouseover event triggers an animation and triggers mouseout/mouseouthandler() which starts the same frame that the mouseover animation ends with another animation.

    The problem is the following. If I move the mouse quickly on the buttons, the first animated film will play to half way through, and when the mouseout/mouseouthandler() triggers the second animation, the first animation apparently 'jump' at the end and go directly to the first image of the second animation.

    I know enough to encode so that the second animation will check if the first animated film always play before you start using another / if statement. Using this method, I only know how to ignore the second animation if the first play, but this isn't really what I want to do.

    Here's the question; can someone explain to me how to create a loop to wait onboard animate?

    When I say wait loop, I'm talking about code that checks a variable and perform an action if the variable is true Goldilocks returned at the beginning of the function if the variable is set to false (to check again the variable).

    The behavior that I'm trying to achieve is a bit like queuing the second animation so that he "will wait" until the first animated film is played before the start of the second animation.

    Any ideas?

    Heya Gil,

    First of all... Thank you! Clearly that you put a lot of effort to find a solution for me despite my laziness by downloading is not an example

    I'll be honest, you lost me when we declared the function. In my view, which sets a bit beyond my knowledge of javascript this early in the game! However, I found a different approach to achieve the effect I was looking for. The link below.

    https://DL.dropboxusercontent.com/u/30528212/Edge_Animation_Example.zip

    Instead of "pending" that something happens, I used instead the event mouseout/mouseouthandler() to proactively determine which image to start playing the second transition of.

    Still a bug bit however. You'll notice if you quickly roll your cursor off the symbol animation you seem to blink before reversing it is movement. I suspect it's something to do with the code. Maybe the code is originally the symbol display a different picture in which the transition reached its peak and then proceeds to animate the correctly.

    I suspect that this because even if the transition has not started to turn red when you mouse out, you will always see a red frame appears place briefly before that the animation reverses of the frame that you were.

    Sorry to be so pedantic

  • Using more of a delay time in thread

    Hello
    I need to use two non-consecutive periods in a thread. My thread is generally as follows:
    1 tell an oriel MS257 to change the wavelength
    2 time delay #1 to give the MS257 time to change
    3 say HP 4156C to run the scan
    4 survey the 4156 C until the scanning is complete
    5 delay time #2 to 4156C time to load the data
    6 reading/analysis/backup

    My problem is that the second time delay seems to start counting immediately after the first: it does not wait for the scan to complete before the count. My VI is attached. It's a bit messy - organizational tips are also welcome!

    Thank you
    Ying

    Looking at the issue of sources: cleaning is a great tool (even thought it's far from perfect )

    Well, nevertheless, wireworking, it seems though the second express VI of delay must indeed wait loop ends. Therefore, I wonder why it is ignored. And the only reasonable explanation: you have an error on the cluster of error.

    So please debug using nail/probes on the cluster of error to make sure that you do not run the questions here.

    hope this helps,

    Norbert

  • Stop declaring event fails to stop the VI

    Hello

    I have a data acquisition system implemented as a producer / consumer architecture that works well.  In my loop of producer, I had a Master Stop boolean, triggering a send a Notification.  Wait loops of consumption containing Notifications were used to stop all the simultaneous loops before applying my cleanup code.

    The problem occurred when I moved the send notification to an event structure related to the change in value on the Boolean value of master Stop (from see attachment).  Now, from the VI, the case of timeout is called immediately.  Could someone give advice on the error of my approach, or to offer improvements?

    Thank you

    Dave

    djroseman wrote:

    I'm looking in your previous suggestion concerning the acquisition of data on the notification queue.  I have a problem to understand why the loop would have sent a notification TRUE if I had already changed the value of the Boolean Master Stop, but I need to test it.

    The Notifier is not sending a REAL notification, it is simply not get sent anything at all until you press the stop button. Since there is no value timeout connected to it, she's waiting for forever (until a notification is received). The acquisition, while the loop can repeat until all nodes inside he runs, and waiting on the Notification is not terminate until the: a) he receives a notification, b) happens to expire (which he will never do without wired time-out), or c) the declarant is destroyed elsewhere, where error.

    So, you get an acquisition, and then the loop is sitting there waiting for a notification. When this notification finally arrives, it stops the loop of the acquisition. Try to set a timeout on waiting on the Notification.

  • Pass the Boolean b/t parallel threads

    Dear Board of Labview,

    I have two Labview processes running in parallel.   Entering the data and the other data output are done.   They where originally designed to operate independently of the other, but today I need them to make some modest integration.   The two processes are very complex, so I would avoid a costly reconstruction.   I am looking for a quick fix and dirty.

    I need #1 process (which is loop based) temporarily hold the execution based on a condition (Boolean flag) process #2.   I'm not familiar with the techniques of parallel processing in labview, and I wonder if I'm doing this more difficult it really is.   Can I put a wait loop in a process which refers to an indicator in another process?   What is the best way to pass Boolean data between parallel threads?

    Thank you

    Zach

    That vi is perfect.

    In your case by using a variable is probably correct. But do not use a global - use a local! I would stay again far using variables-you never know what the future holds. Maybe you end up adding a few other loop. Maybe you want to add error checking and loops to stop on error of the signal.

    There is a significant difference between Globals functional and just a simple variable. Since the FG is a vi that one instance can run at a time *. With a variable, you have no way of knowing which is written or read what or when, unless you use semaphores or structures from sequence.

    * unless you make it reentrant

  • Enqueue and dequeue

    Hi all

    I have jusr found an interesting question, which confused me too much. Hope you can help me. Look at the picture (Panel and block diagram). When I press the button loop dequeue, the number will change to 50. When I press STOP loop enqueue, then press the dequeue one, the number will never change at 50. I really don't understand. In addition, on the basis of the second sequence of operation, what can I do to jump the dequeue loop and change the number?

    your queue and dequeue loop run at rates almost the same (which are crazy because you don't have any waiting loop enqueue.)

    So when you tap hold stop button loop it dequeues an element and stops and you go to another sequence and get value = 50. (Note that you always queue data)

    When you press stop loop enqueue, dequeue funtion had already removed data from the queue and waiting for other data. Because the time-out dequeue is - 1 he'll wait forever and the loop will not stop and you would get any value out of the loop.

    To work around the problem, you can give some timeout to dequeue function. (just a workaround, may not be a good technique)

    Now made explanation what actually you trying to do with this?

  • Deploy and run the part of the project in real time RT

    I am developing a project, LabVIEW-RT, with a User Interface on the PC and evanescent code that runs on a PXI system.  I read a few posts discussing the possibility (or lack thereof) to start the RT of the project by program part.  Here's what I mean: my project has a first level VI on the host PC, call 'Host UI.vi', and a first level VI on the RT target, call it "target RT.vi".  There is the usual assortment of other features of the RT, such as flow, LAN and network Variables shared, etc.

    During development, I open the project, find the code RT target, select the target RT.vi and click Run.  I can do the same with the host UI.vi.  My code works (or not, depending on whether I have introduced new bugs).

    What I would like do is to run the host user interface and run the code to mimic an RT target selection in my project and perform a right-click.  I partly managed, but a small step escapes me.

    Can I programmatically deploy my RT code and make it pop a window front so I can click on the Start button.  I even managed to start running programmatically using VI server.  However, when I start it programmatically (rather than clicking Run), my shared network Variables are not available.

    I studied it a bit by using Distributed System Manager.  With her, I can 'see' my shared Variables of network on the target of the RT, but its status is offline.  I put online by clicking on the button 'Start process' in DSM, however, when I then try programmatically start my vi target RT using VI Server, Shared Ntwork variables goes Offline (accordint DSM).

    Question - is there a way to do a program equivalent to locate my network shared Variable in DSM and clicking on start processes?

    [I had a great idea while writing this post.]  I have noticed that if I deployed my VI and also expanded my network shared Variable, DSM has shown to be online, but the target RT start VI VI Server, the NSV went offline.  What happens if I have deployed it after from the remote?  Good idea, too bad that it didn't work...].

    All the best ideas?

    BS

    Well, I just did!  I wrote a demo project RT with the following characteristics: RT side consists of a single VI that affect False in a Boolean Variable (NSV) shared network, goes in a while loop until there is true, goes into an another wait loop to make it False, then ends.  The NSV is hosted in a library on the remote target.

    The host does the following:

    1. Determine the IP address of the target of the project.
    2. The first name of the VI RT to run, to return a reference to it.
    3. Use the reference to deploy the RT VI on the remote target.
    4. Use the IP address and the name of the RT VI for a VI Server reference.
    5. Use the reference to start the code that runs on the target of RT.
    6. Go in a loop looking at the NSV and wait for the status of the error not be 8BBB0006 (uninitialized NSV).
    7. With the value returned by the NSV (must be set to False, defined by the code of RT), deny it, set it and wait that it will change.
    8. Do this one more time to return the NSV to its original value (as defined by the code of RT).

    Before running the code, right-click on the target of RT in the project and turn on "disable AutoDeploy Variables.  J of Zach, an Applications Engineer of NOR, suggested that this step, which can be the key step in the resolution of this dilemma.

    To test this, I restarted my PC and the aim of RT.  Once both had restarted, I opened the project on the PC, and without interaction with the section the project somehow RT (including not not clicking 'Connect'), I ran the host code.  He started the remote code and was told that the round trip time for set and reset my NSV was about 29 msec.

    I intend to make a full text of this and submit the entire project, with documentation and all the screws under utility, I used, to community page OR.  I'll try to get this done this weekend...

    Bob Schor

  • "Arduino TTL series for Windows (LabVIEW VISA).

    Quick Q to the forum.

    I guess that the TTL output series of Arduino can be read and written directly by LabVIEW but I don't know if this is the case when you use the TTL series on the arduino.

    I realize that it is possible to talk to arduino via its serial port secondary (or primary), one who sets himself up as a port virtual com how a USB serial Converter and use a USB cable. It is very good.

    But what speaks directly to the Council?

    If I want to configure Arduino, a wait loop to pronounce on its input series ttl line how to connect to it from my Windows and LabVIEW?

    I have to worry not about levels of the PC serial port interface? Can I just connect TX RX and ground of the serial port directly at the entrance of serial Arduino TTL?

    Thanks in advance.

    Easiest thing, in my humble OPINION, would be to use a USB-serial to TTL level adapter. Something like this: http://www.mouser.com/Search/Refine.aspx?Keyword=RS-232-WE.

    If not, a search for RS-232 level, removal of the circuits should show a number of options, ranging from IC meant for the task to the discrete component simple circuits.

  • write to the .xls file hourly

    Hello everyone!

    Feel free to help !

    I have a small question about writing to the file. So basically I have to read 10 temperatures by 10 Thermocouples of a storage tank. I want to write in an excel file every hour. But the waveform is active all the time. So I don't want the wait loop every hour.

    Help, please!

    I have read several forums about him but couldn't really find any solution!

    Thank you!

    Here is a version of 2013.

  • Tuneling works in lan not internet

    Hello

    I develop a simple application that opens a socket with a proxy to connect to the http server and do themselves of it.

    Develop an environment:

    The proxy is a virtual machine that is running on the development computer, but has another net. My pc has net.1 and the virtual machine net.31

    The blackberry is a simulator of 9700 and MDS - CS active.

    Socket connection

    URL = "" socket: / / ' + _screen.getProxyIP () + ":" + _screen.getProxyPort () + ";" deviceside = true; interface = wifi. "

    If I try to connect to the http server in the LAN, it works fine. The connect responds too 200 and 200, get answers.

    But when I try to connect to the http server is in internet, connect 200 responses and the EEG is unresponsive, I do a _in.ready wait loop and is never true.

    The same application on windows works fine in local network and internet.

    Is a question of Simulator? Is a problem of network delay?

    Best regards

    You try to establish a direct connection TCP or Wifi? deviceside = true (direct TCP) and = wifi interface should not be used together.

    The get request makes it to the web server?  Are you able to connect to the web server using the BlackBerry browser?

Maybe you are looking for