any event loop with a different time

Hello

I write a VI which is a state machine that is running at the time of 30ms, but while the state machine is in the idle loop I need to send a rocking live Dungeon (Boolean) a controller every 500ms. With the requirements of the state machine main to run at 30ms how to set another time or the event inside the while loop. I used the rest / function quotient with the iteration but cant seem to find the solution there.

If requirements:

  • While the loop should run at 30ms
  • every 500ms Boolean value must change state
  • the time of 500ms shouldn't slow down the main loop as a waiting

Does anyone have a suggestion?

Hello Bill_lewis,

As 500 is not a multiple of 30, it seems difficult to run a while loop.

You must use another loop in parallel or change one of the two calendar in order to toggle your Boolean to a multiple of the while loop timing.

Kind regards.

Tags: NI Software

Similar Questions

  • 'For' loop with a different number of iterations. Second, the auto-indexation of the tables with different sizes is done. It can affect the performance of the Vi?

    Hello

    I have a loop 'for' which can take different number of iterations according to the number of measures that the user wants to do.

    Inside this loop, I'm auto-indexation four different 1 d arrays. This means that the size of the tables will be different in the different phases of the execution of the program (the size will equal the number of measures).

    My question is: the auto-indexation of the tables with different sizes will affect the performance of the program? I think it slows down my Vi...

    Thank you very much.

    My first thought is that the compiler to the LabVIEW actually removes the Matlab node because the outputs are not used.  Once you son upward, LabVIEW must then call Matlab and wait for it to run.  I know from experience, the call of Matlab to run the script is SLOW.  I also recommend to do the math in native LabVIEW.

  • BlackBerry smartphones is in any event to remove the icons, time, main screen battery indicator

    I know that by default, only you can change the layout of Zen to today and which displays icon differently, but is there a way to remove all the icons, so it will only display the wallpaper.

    You need a new topic of your choice.

    You cannot delete these native icons from within the OS.

  • How to exit while loop with delay schedule?

    I have a pretty heavy program that iteratively takes a series of measures from a number of channels using a variety OR-Switch and OR-DMM screws that I assembled as a result of various examples and several help pages. Each channel is sampled once during each iteration with data to be saved in a text file for later analysis, after it is imported into Excel. I added to the screen 'real time' indicators and charts to see what looks like running data.

    Each iteration is performed using a While loop with a delay timer, even if a previous version, I used a timed loop. Measures for the series of channels are collected with a loop For inside the While loop. The loop For includes screws which:

    1 cut the channel and wait as debounce.

    2 Initializes the DMM and passes the configuration information.

    3. wait for a while to make sure that the DMM is set.

    4. measure.

    5. close the DMM.

    6 disconnect all the switches.

    The terms of the election of the channels is ends in 15-20 seconds and I am currently collecting data every two minutes, so he spends "wait" time "collection". Each iteration of the loop For initializes and closes the DMM to avoid the hot switch.

    Other components of the program are configuration setting controls, etc. (in front of the While loop), a "current measurement" indicator and a writing-text inside the loop file operation For, several indicators of the iteration (inside the While loop, but outside the loop For) and a bunch of operations related to the grouping and table that provide graphics of groups of time vs measures.

    I don't know there are more elegant ways to perform many functions that I do and I'm not posting the VI here because I want to concentrate on what I know, it's a big problem with my program (for now!) - I can't figure out how to get out of the While loop. I tried the combinations of Boolean control, its conditions of latch and Stop / continuous if true to nothing does not.

    I want a 'Stop' button that ends the While loop, at the next opportunity, but it is not working properly, I think, because the stop button does not play with good timing, because the program runs either the loop For or the time delay at the beginning of the While loop. 'Next opportunity' can mean 'Immediately', 'at the end of the next iteration of the loop,"or"at the end of the next delay schedule." I think that if I get one of these scenarios to work, I can get an any of them to work!

    Help, please!


  • Add an event (Touch) at different times to a symbol?

    Hello

    I searched to see if this has been answered. However, nothing seems to solve completely.

    The problem:

    I have a design of the tablet with several pages (three pages) and that a single arrow to move between pages in the lower right corner of the screen.

    In theory, a user can press the button and the first page would deconstruct offshore and the next page would be inspired.

    I would like to do this for each page, if a user can tap through the whole experience without knocking swipe, a loop to the first page. I was able to configure easily get on the first page

    on the second (this example uses the symbol for a touch event using triggers to start and stop).

    The Question:

    How to make a button (symbol) do the same action at different times? For example, 1 to 2 seconds, the button action going from page 1 to page 2. In 2-3 seconds, the button would then switch to be any another event for transition from click

    between 2 to 3 pages?

    I don't want to have to build several buttons and would rather resolve this problem in the code.

    Thanks for any help!

    Best,

    S

    Hello

    So, your arrow will have a click with a conditional statement event:

    If (sym.getDuration () == 1000) {sym.play(1000) ()} //page 1 is displayed

    ElseIf (sym.getDuration () == 2000) //page {sym.play(1000) ()} 2 displayed

    ElseIf (sym.getDuration () == 3000) {sym.play(1000) ()};  page 3 posted

    I assumed you put triggers in 1000, 2000 and 3000 with sym.stop ();

  • State machine with acquisition different modes/loops

    Hi all

    I did a machine design to State (as described here) to organize three (mutually exclusive) process / States: idle, measurement of calibration and continuous measurement. Calibration must be performed before measurement, because the result of the calibration is used for measurement. The data entry is a camera that should run continuously, also in rest mode.

    The problem however is that this state of calibration and continuous measurement (should) have another method of data acquisition. The measure is continuous and the images are processed in real time. To calibrate a number N of images should be accumulated and treated (simply create a background image).

    In the state machine as I have now (see attached image), I have the acquisition of vision outside the state machine in order to have a live view at any time. The problem now is that the inner loop in the State of calibration (the loop that must accumulate the framework) accumulates of course that the first framework N times, it is not question for all new managers during this State.

    Of course, I could fix this with an if/else statement in the first calibration mode accumulate images (if I< n,="" accumulate="" frame="" in="" buffer="" and="" continue),="" but="" i="" am="" not="" convinced="" that="" having="" a="" lot="" of nested="" loops="" is="" the most="" elegant="" way="" to="" do="">

    This also got me thinking, is the state machine, as I built it here all the best way to manage these two processes/acquisition modes? Or are there better ways to do this?

    Contributions and comments are very much appreciated!

    Note: I know that loop as scheduled now in State calibration is wrong with shift registers. It was a test before I realized that the fault was in the interweaving of the state machine altogether.

    Please do not attach pictures, but rather post executable code, screws (easier) or as extracts from LabVIEW (which became the screw when you drag in a block diagram).  If you have more than three attachments, compress the folder and attach the ZIP file.

    I was once describing a system similar to yours, and one of my students, who was a computer science major, said "it's not a State Machine."  I had a similar situation to yours, where I had a procurement process which took time and a 'Stateful' routine that does different things with data (in your case, use it for calibration, waiting to 'Go', absorbent, etc.).

    I understood that it was correct.  I ' D 'opposite' model, with the Acquisition, always running and "driving", the calendar and make 'Appropriate Action' on each set of data, where the Action could (and did) vary according to other conditions.  So I renamed my state machine 'Action engine', and everyone was happy.

    So I won't bother looking at your code (a quick glance showed me that I have only would be frustrated by the limited view), but will give you a suggestion for an alternative architecture.

    You want to (ideally) two parallel loops.  A single loop simply acquires the data (images) at some rate.  For each Image, it signals the loop else it's time to 'Action' on the acquired data (to do this, use a queue or the notifier).  You want that engine of the Action to perform independently the Acquisition loop, just in case a particular Action takes, say, 1.2 times sample to complete - you don't want 'Miss' samples!.

    The loop of the engine of the Action is a unique, appropriate Action at the time, on the newly acquired data.  If you are in the 'State' calibration, the Action will be "add to the calibration.  When you have accumulated enough data to do calibration, set the following Action to (for example) 'wait to start the Signal.  When you receive the Signal to begin, take Action to "acquire, process and save data.  And so on.

    As it happens, I did my code exactly in this way, but it was the idea General - Acquisition was the 'King', he ran the clock and led the ' Machine/Action State engine' to 'do the right thing, appropriate to the time' with the data.  See if this type of model is appropriate in your situation.

    Bob Schor

  • How can I Albums in the Photo App with images taken at different times.

    How can I Albums in the Photo App with images taken at different times.

    I had books in Aperture and iPhoto which have been labeled 'Family', 'Friends', etc., and I would like to move the images in the album, and there no matter when it was taken.

    Thank you

    Brian

    In the same way. Make an Album and drag the images to him. Key word or images and the use of the smart Albums.

  • Treatment in time loop with microseconds.

    Hello

    I am make only one application in Labview where I capture the image of a camera and image processing. The camera is communicate with the Board of Directors NI PCIe-1433 in the PC with the camera link. This device can operate with a rate of 2000 frames per second. For the treatment of each image in the pc I need a time loop that work with microseconds. The problem is that this time loop only works with MS Windows. If I use the real time module, can I configure this time looping with microsecond or is there another solution?

    Thank you

    Hi xisco,.

    with LabVIEW Realtime, you could create a loop with the order of a microsecond wait States.

    BUT:

    Why do you think you have need of these wait States? What is the purpose of these expectations?

  • What architecture for loop to hour of time timed with responsiveness front

    I cannot consider this application planning.  I was originally using an Event Driven Architecture with a State Machine in queue to analyse Panel UI changes and react accordingly.  (Something like the solution found here).

    Datalogging should be done in its own loop with the data passed by a queue.

    If you want, you can have multiple queues and several loops of consumer.

  • DataPump with different time zone files

    Hello

    I'm trying to import a schema with datapump to a 12 c in oracle 11.2 instance oracle instance. I got an error cause different time zone files. 11.2 is on version 14 and 12 c is on version 18. So I tried to import a single table, make a new export with that one table (table got no timestamp with time zone column data type) and exported. That has worked well. So I modified my schema export to exclude these tables with columns with data type timestatmp with time zone. When you try to import this new dump, it still does not for the same reason.

    So, to import a table worked, but import a schema failed. Does anyone have a suggestion for me, how can I import this discharge? And no, I can't install a patch with the new zone files.

    sql_coder

    I could solve it myself, had to exclude more tables, not only those with timestamp with time zone, but also excluded arrays with data like AQ types $ _ %.

    sql_coder

  • When moving in different time zones, how to keep timely events?

    When I put an event in PST at the exact time in which it will happen and then change the time zone, the event moves to another time. I have not shot time zones. Some events move and others keep time. How can I get all the events to keep time?

    Events are created in the time zone that the Mac is currently defined in support of regardless of the time zone setting. When you change the time zone of the Mac, the events will appear to change the time since they will now display the event in the current time zone.

    Allowing the use of zone:

    • Adds a dropdown in the toolbar menu. You use the menu to change the time zone in which include all events. For example, an event for 12:00 Pacific time is shown at 7: 00 GMT.
    • Also allows you to set the time zone for each event. For example, if you set an event at 7: 00 GMT and then choose Pacific Time in the drop-down list in the toolbar, this event is posted at 12:00
  • How to use the user with event loop event

    Hello

    I want to communicate between 2 VI, so I have a global variable (boolean) who gives the order to an event tool to run. The problem comes from the fact that event loop accepts no global variable, I found on the forum that I can use the user event. Of course, the second VI works normally when I push the button (boolean) in there to run the event loop. Please can someone explain me how to do this, I am a chemist.

    Thank you.

    You enter the receiver structure of event for the event you want to receive.

    To do this in two screws, you will have to share the user between them event reference.

  • Is it possible to install two schemas with different time zones?

    Hello
    Is it possible to configure a schema with a different zone in the same instance of oracle?
    Thanks in advance for your answers.

    -Best regards,.
    ENR

    Depend on more or less, now, you want to do.

    ALTER session set time_zone = work my_time_zone but you need to configure for all sessions that affect patterns

    HTH
    Antonio NAVARRO

  • several loops with error handling and controll

    I have a project where I spin 4 loops at the same time and must stop all the loops with a stop button as well as all the loops if one of the loops will receive an error.

    Loop 1.

    Loop start

    control the other 3 loops

    Loop 2.

    Analog voltage reading

    Loop 3.

    Digital inputs to read

    Loop 4.

    Write digital output

    Someone knows how to do this?

    Two other methods not mentioned in the otherwise excellent document that mentioned Matt are the use of a global variable 'stop all' and a relative using a Global Variable of VIG/functional.  The reason to talk about, is that they can be used also stop 'detached' live, live which are defined to run asynchronously (and therefore a bit 'out of control') regarding the main VI.

    I use a "combination of ingredients" for some projects I'm developing using LabVIEW 2016 and its support of the channels.  For example, I use a Messenger channel to create something akin to a message in queue manager.  When the event loop detects that the exit button has been pushed back, it puts a Message "Exit" on the channel of Messenger and stops himself.  When the Message Loop sees "Exit", it sends one release Message who else has need to see (in one case, the producer of a producer/consumer model) and stops himself.  When the producer Gets the output Message, it puts a "last element is invalid" on the flow of the channel for consumers and stops himself.  When the consumer gets the message of the last element, he stops himself.  A magnificent waterfall.

    And I work (not yet 100% complete) how to extend this to start the asynchronous calls that do not (yet) support channels as easily...

    Bob Schor

  • How do I either set channel name of a graph of cluster or get a 1 d waveform chart to start different time (t0) for each line of the waveform?

    I have a chart single 2D out a conditional of a loop indexing output such that over the rows of the table are not the same size. -Basically, they have different starting and ending points and sizes. -Not so concerned by the endpoints, because as soon as I get correctly starting points, everything shows fall in place.

    The challenge is that when I try to have the variable t0 (start time) for each line, the wave of construction vi form would always keep each line at the same starting point.

    I used the approach bundled with success (the cluster approach ensures that each waveform starts at different times according to the guidelines of my t0 defined for each line) but then I'm not able to get in the channel names I could make using the graphical approach (wave generation) waveform.

    In essence what I get here, I'm losing here.

    Because I don't want one of my mentors, Bob and Altenbach have fed up with me I have attached a vi this time

    Attached VI shows a combination of the two attempts (first with the waveform graph) and then with the graph of cluster

    1. with the first (graphical waveform), I get my channel names as you wish, but the alignment of the wave is not correct.

    2. with the second (graphical cluster), the alignment is good, but I can't do the names of channel in the chart, even if they are present in the cluster.

    I read some reviews that mentions that attributes can be displayed with waveform and data Dynamics (not clsuters) so I guess that's why.

    I saw another report indicating the start time for a waveform 1 d will always remain the same for the rest lines defined for the first line even if changed for the following lines in a loop.

    So I guess my question is: what is the way around questions like that?

    First of all, let me be the first to the congratulate and thank you for finally posting a code!  I'm not 100% certain I understand your question or your code, but I have an idea, perhaps, of what you want to do, so I wrote a little VI who made something simple that could be relevant.

    You mention waveforms of different lengths and beginning at different times.  You also want everyone to have a unique attribute (although I'm not sure what you want to do with the attribute).  So, I did the following:

    1. Generated an array of 100-sample random to represent one second of a waveform.
    2. Created 4 waveforms on this 100-sample basis.  The first waveform (channel 0) is just these 100 points.  The second, 1 channel, is the concatenation of string 0 with the base of 100 samples, or a waveform "double".  Channel 2 is 1 string concatenated with the base, and channel 3 is 2 string concatenated with the base.
    3. In order to trace the four channels that they rest 'on' the other, the waveform has the number of the channel added to it.  Channel 3 is 3 + (4 copies of the basis of 100 points), a waveform 400-point random centered around a shift of 3.
    4. All channels have dt value 0.01 (but I guess I could have varied, as well).
    5. To make the channels start at different times, I started channel N N seconds before channel 0 (by subtracting the index of the loop, I, T0).
    6. For each channel, I created an attribute called "Chan" equal to "Channel N" (where N = 0, 1, 2 or 3, as the case may be).

    This is the plot that results. Scale X is the absolute time value (no Date) using the 24-hour HH: mmS format.  You can see that the plots are 1, 2, 3 and 4 seconds of time, and are offset from each other by a second.  I used the trace attributes to change the name to the respective attribute.

    The code to do this is very simple - I almost don't need to show it, because I think it is completely described by the text above, but this is here:

    Now, it was not that much faster that some of your previous posts, when you refused to your postcode, "guess us" what you wanted (but not to not correctly guess), you tried to "push" us in the right direction (still refuses to post code), and no one seemed very happy?

    Bob Schor

Maybe you are looking for

  • M9S82EA #ABU: System disabled the 60194816 code

    Laptop computer initializes more since the power failure in rain storm. Won't power on password that I set last year. But asking for the seizure of power on or administrator password USB box provided no use Y at - it a password for this code please?

  • Can't send or receive sms on 6s

    GGot 6s another day and can not use sms someone help

  • HP G62-340US

    Hi all I am about to replace my processor, as it seems to have failed on my HPG62-340US. When replacing the processor, I thought that I might as well upgrade the radiator/fan and I was wondering if geeks colleagues there have done something like that

  • How to save two sous-schema data two in one file?

    Hello I have a VI tensions from different measurement channels one after the other. How could save the average data two in one file in two columns? The vi is attached. Thank you!

  • Partition recovery Pavilion DV6 or disks back to factory settings?

    My girlfriend has the laptop Pavilion DV6 with Vista. She is not a computer person, so there is no serious problems it is locking up and goes really slowly. I'll get his PC to the factory settings, the problem is there is no disk and I don't know whe