structures of several timers event

How would it be best to implement waiting periods of a statemachine event where there will be three independent counters for LV8.6? a 50ms, one to 300ms and the other 10 s. The control of the event already handles change events of value to a number of Boolean screws I would use timers to know when I should update my screen (50ms for LEDs, 300ms to measure the current through GPIB, 10s for temperature measurements).

What I thought about so far:

* I'm not sure that the time-out event is what I want, because it restarts every time that the structure of the event is entered and there is only a single clock value. I need to get the current time, look up when I expect it the next event to fire and to program that. That's how I'm leaning towards at the moment.

Support parallel to the structure of the event loops would be problematic because it lives inside a state machine and could only advance when an event occurs and a timer has expired. It would be too complicated for what it is.

jcurl wrote:
[..]

So you're saying there are no such thing as the "timer" events, where I put on a control and it can raise an event that the structure of the event can respond to?

[...]

Jason,

I don't know if we are talking about the same thing here.

I just wanted to point out that, from my experience, the time-out of the structure of the event leads to confussion and more often leads to applications programming based with polling stations in a single loop of mixture. And it's a bad idea.

You can always set the user events and create a folder for the user event. The source of the user event could be a timer... so you have all the options you would like to.

So for example:

A loop contains the structure of the event (nothing more). Timing loops is defined by the frequency of incoming events. EventSources for example are several buttons, digital control and an event to a user.

Loop B queries to some States of your system. If the desired set of States is given, you create a user event.

So the loop B would somehow 'time' in A loop...

I hope that now expressed in a better way,

Norbert

PS: Please keep in mind that it is recommended to use a single structure of single event in the app!

Tags: NI Software

Similar Questions

  • The commands ordered in the Structure by using the event trigger

    I wrote a few weeks ago, asking for help running of programs using .NET. (Finally understood, thanks) I'm ready to move on. My goal is to control the software Filmetrics by LV in the attached vi .NET Setup works, and now I just have a problem with the controls. To start a measurement of the film, Filmetrics takes a series of Spectra of the sample, reference and background, so I would do the same thing in LV I think that using a structure of the event in a sequence, that's what I'd do, but other ideas are welcome. I want buttons only to be triggered in order and disabled when it is not their turn. From now on, when I click 'Acquire basic' façade freezes. Also attached is a version very simple what I think, and it freezes as well. Any help would be great!

    No, do not use a sequence and several structures of the event!

    Here is a possible alternative (simple draft).

  • Structure of the multiple event

    Hi all!

    I have a headache off the coast of this problem.

    Example:
    I have a value called: numbers. If I change this value must go in the structure of the event and run the ' numbers: change in value.
    And I have a button, if this button changes, I want it to run as ' number: value change.

    Is it possible to use more then 1 event. As: "numbers: value change gold button: change in value.

    I can't understand it. Could someone tell me it is possible, and if not, how can I solve it?

    I hope someone can help me!

    Thank you!
    Rick

    Hey Rick

    Pretty easy to implement. You just need to add another condition to the case of the event:

    I hope that this extract VI will illustrate this (just drag it in LabVIEW - FYI, it is made for 2014):

    See you soon

    J

  • A case structure run several cases?

    So I have a VI, set up with a case of mutiple option structure to select a power supply that is read from (there are 32 options). Now that I did it, I realize that sometimes I want to can I read multiple entries at a time... Is there an easy way to change my configuration so that it runs several cases at a time? Right now my order is a slider to choose the case. What would be a choice of good front control to be able to select several options? Thank you

    You can create a picture of your options and the loop in required cases. As mentioned, a case may only run 1 case per loop.

    A good front panel control would be a cluster or array of Boolean (for example a checkbox by option), easy to navigate.

    /Y

  • structure of the 2011 event

    Application development in 2014 LV using a Structure of the event. The target system is running LV 2011. The Structure of the event seems to run on the target system, but it only allows me to make changes to the Structure. Right-click on it, and the menu is not the same in 2014.

    What could be bad

    Bob

    Thank you, they perform the basic version.

    Bob

  • Why my event structure reacts to an event of "change value"?

    Hello

    I created a VI with 2 while loops and structure 1 integrated event. The first while loop creates a square wave and the value of the pass signal periodically - this event is registered by a property node and also shown on an indicator. I've linked the second event called "Mode-number: changed value" so that the signal and tried in various ways to "activate" the structure of the event (I tried to use event dynamic registration, property nodes, event tool etc.

    Attached to this message is a png of the VI file.

    No idea what could be the problem?

    Thanks much :-)

    Bruno

    You must use "user events. You should also look at some of the examples/tutorials on how to use them, see here: http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/creating_user_events/

    What you have done is to try to enter a value in both structures change event - this is not actually generate a value change event. Value change events are generated when you (as a user) change a value of a control on the front panel.

    Alternatively, you can use the 'Value (signalling)' property that will allow you to update the value of an indicator and also generate the event changes its value. I think in your case if you are better to use user events.

  • several timers

    Is it possible to have more than one timer running?

    I have several clips that I want to do something for a while and then do something else, but I need them all to run at the same time. Before I start I would like to know if (for as long as the timer is running inside of the chronology of movieClips and not the main timeline) they work independently?

    Tina

    While you have not indicated your intentions for the creation of the timers, you should be able to run several simultaneously.  You can set up a simple test for you to respond to your request, such as...

    Function f1 (val) {}
    trace (Val);
    }
    setTimeout (f1, 1000, 1);
    setTimeout (f1, 2000, 2).
    setTimeout (f1, 3000, 3);
    setTimeout (f1, 4000, 4);
    setTimeout (f1, 5000, 5);

  • Structure of the Query event

    I want to create an event that meets a button on my front and a text entry area that tells the event how often to repeat the code that is inside where I've specified.

    The event must start executing the code as soon as the button is pressed and repeat the event for example every 100mS until the key is released.

    If anyone has any ideas, I'd be happy to hear. I use LabView 7.0

  • error with several timers

    I basically have a compass and I want to have the pointer to stop every 15 ° for a certain period of time. The first timer works fine, but the rest pause longer. And they vary.

    It's code for the first break:

    Stop();

    var fl_TimerInstance_1: timer = new Timer(1000, 30);
    fl_TimerInstance_1.addEventListener (TimerEvent.TIMER, fl_TimerHandler_1);
    fl_TimerInstance_1.start ();

    var fl_SecondsElapsed_1: number = 1;

    function fl_TimerHandler_1(event: TimerEvent): void {}
    Play();
    fl_SecondsElapsed_1 ++;
    }

    For the second:

    Stop();

    var fl_TimerInstance_2: timer = new Timer(1000, 30);
    fl_TimerInstance_2.addEventListener (TimerEvent.TIMER, fl_TimerHandler_2);
    fl_TimerInstance_2.start ();

    var fl_SecondsElapsed_2: number = 1;

    function fl_TimerHandler_2(event: TimerEvent): void {}
    Play();
    fl_SecondsElapsed_2 ++;
    }

    With the help of Flash CC

    Thanks in advance

    AS3 has setTimeout, which can be much easier to use and less wrong. Try to put this script every 15 frames in your animation:

    Stop();

    setTimeout (play, 1000);

  • Form of the ADF for data structure with several child records

    Jdev version: 11.1.1.2.0

    I have a data structure with a one-to-many parent-child relationship. I give an example of the data structure.

    Employee table:
    ----------------------
    EmpId
    EmpName
    Salary

    Table Historiqueemploye:
    -------------------------------
    EmpId
    Previous_Employer
    From_Date
    To_Date


    In the ADF form for entering data for a new employee, I want to give a layout (say, a button "Add row") for the history of the employee's employment. How can we succeed in ADF?

    I'm new to ADF. Would be grateful if someone can help me with detailed steps or a link showing such a demonstration.

    Thanks in advance.

    Hello

    If you exposed a View for the Historiqueemploye table object, then simply drag this point of view as a form and then drag and drop the create operation (within the structure of the View object in the data control palette) as a button for the new line is created. If you do not always display the historical, add it to an af:popup and start button context menu create or hide the af: panelFormLayt that a form is added by default.

    Frank

  • How can I reset several timers?

    I'm relatively new to Action Script and I'm having a hard time to find the solution to my timers

    loop after the last complete timer. Can someone please?

    Here is the code:

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;


    var learnDone:Timer = new Timer (3000);
    learnDone.addEventListener (TimerEvent.TIMER, timerDone1);
    learnDone.start ();

    var learnDoneMore:Timer = new Timer (6000);
    learnDoneMore.addEventListener (TimerEvent.TIMER, timerDone2);
    learnDoneMore.start ();

    var learnDoneMost:Timer = new Timer (9000);
    learnDoneMost.addEventListener (TimerEvent.TIMER, timerDone3);
    learnDoneMost.start ();


    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 0, 1, 7, true); This fades in the first object

    function timerDone1(e:TimerEvent):void {}
    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 1, 0, 7, true); This fainted the first object
    var mySecondFade:Tween = new Tween (intentionally_mc, "alpha", Strong.easeOut, 0, 1, 7, true); This fades in the second object
    learnDone.stop ();
    }

    function timerDone2(e:TimerEvent):void {}
    var mySecondFade:Tween = new Tween (intentionally_mc, "alpha", Strong.easeOut, 1, 0, 7, true); This disappears the second object
    var myThirdFade:Tween = new Tween (succeed_mc, "alpha", Strong.easeOut, 0, 1, 7, true); This fades in the subject of the third
    learnDoneMore.stop ();

    }

    function timerDone3(e:TimerEvent):void {}
    var myThirdFade:Tween = new Tween (succeed_mc, "alpha", Strong.easeOut, 1, 0, 7, true); This faints at the third object
    learnDoneMost.stop ();

    }

    function timerComplete(e:TimerEvent):void {}
    stopLearnDone3();
    nextFrame();
    }

    I don't know if timers are getting confused or simply the presentation because of the duration of the Tween.  Here is the code that I was describing, but I reduced the duration of the tweens so that they do not conflict with the schedule of the timers.

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    learn_mc.Alpha = 0;
    intentionally_mc.Alpha = 0;
    succeed_mc.Alpha = 0;

    var learnDone:Timer = new Timer (3000);
    learnDone.addEventListener (TimerEvent.TIMER, timerDone1);

    var learnDoneMore:Timer = new Timer (3000);
    learnDoneMore.addEventListener (TimerEvent.TIMER, timerDone2);

    var learnDoneMost:Timer = new Timer (3000);
    learnDoneMost.addEventListener (TimerEvent.TIMER, timerDone3);

    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fades in the first object
    learnDone.start ();

    function timerDone1(e:TimerEvent):void {}
    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fainted the first object
    var mySecondFade:Tween = new Tween (intentionally_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fades in the second object
    learnDone.stop ();
    learnDoneMore.start ();
    }

    function timerDone2(e:TimerEvent):void {}
    var mySecondFade:Tween = new Tween (intentionally_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This disappears the second object
    var myThirdFade:Tween = new Tween (succeed_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fades in the subject of the third
    learnDoneMore.stop ();
    learnDoneMost.start ();
    }

    function timerDone3(e:TimerEvent):void {}
    var myThirdFade:Tween = new Tween (succeed_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This faints at the third object
    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fades in the first object
    learnDoneMost.stop ();
    learnDone.start ();
    }

  • Several click event

    I'm trying to "stack" multiple events for a control click and not have a bit of luck.
    I have a sign of departure:
    < mx:Panel = "26" x y = "10" width = "250" height = "200" layout = "absolute" >
    < mx:VBox = "10" height = "140" width = "173" x = "10" id = "vbox1" >
    < mx:RadioButton label = 'Club' groupName = click on "affiliation" = "currentState ="ClubSelectState"" / > "
    < mx:RadioButton label = "Constituent group" groupName = click on "affiliation" = "currentState = 'ConstituentSelectState'" / >
    < mx:RadioButton label = 'College' groupName = click on "affiliation" = "currentState = 'CollegeSelectState'" / >
    < mx:RadioButton label = "UK Alumni Association" groupName = click on "affiliation" = "currentState =" "/ >
    < mx:RadioButton label = 'UK Offices, units' groupName = click on "affiliation" = "currentState = 'UKOfficesSelectState'" / >
    < / mx:VBox >
    < / mx:Panel >

    As you can probably once someone clicks on a button in this panel, it will show a panel (state) matching. For example, if the Club radio button is click it this sign:

    < name mx: State = "ClubSelectState" >
    < mx:AddChild position = "lastChild" >
    < mx:Panel id = "clubpanel" y = "10" width = "250" height = "200" layout = "absolute" title = "Select A Club" x = "284" >
    < mx:VBox x = "10" y = "10" height = "116" width = "72" id = "vbox2" >
    < mx:RadioButton label = 'Club A' groupName = 'Clubs' / >
    < mx:RadioButton label = 'Club B' groupName = 'Clubs' / >
    < mx:RadioButton label = 'Club C' groupName = 'Clubs' / >
    < mx:RadioButton label = "Club D' groupName = 'Clubs' / >
    < / mx:VBox >
    < / mx:Panel >
    < / mx:AddChild >
    < / mx: State >

    It all works very well. I want to add 'showEffect' and 'hideEffect' especially wipeRight, wipeLeft respectively. I've added the attributes on the State Board of club like that, not sure if this is correct:
    < mx:Panel = "10" width = "250" height = "200" layout = "absolute" title = "Select A Club" x = "284" showEffect = hideEffect 'WipeRight' = 'WipeLeft' >

    But I can't understand how to add what I assume to be clubpanel.visible = true to the attribute click on this line:
    < mx:RadioButton label = 'Club' groupName = click on "affiliation" = "currentState ="ClubSelectState"" / > "

    Could someone enlighten me as to what I'm doing wrong? TIA

    See if it works for you:

  • Several timers loop data acquisition

    Hi all

    I am developing a VI for FPGA Deployment. My equipment consists of a chassis/controller for cRIO-9072 with module 1-9211 thermocouple, card SD-1 module, 3-9215 HAVE modules and universal modules 2-9219. I will collect data of two thermocouples on the 9211, 14 channels on 9215 channels and 6 on 9219 modules. This system communicates to the host via ethernet.

    I have prepared a vi (see attachment), which used two DMA FIFO for writing data to data acquisition at a different speed. I will be sampling the s and 9211 9219 much more slow (500ms by samples), than other channels (40 ch/kech. / s). Currently, my FPGA vi trying only to taste two different modules. When I run the present on the host vi and try to read the data, I get only extracts of the data at different intervals. If either of her would reveal latency with the connection or the host vi failed to refresh quite quickly? I am relatively new to labview, so any help is appreciated. Thank you.

    Gaussy

    Hi Guassy,

    There are a few things that you need to change:

    (1) you must separate your acquisition in the FPGA in two separate loops if they have to operate at different speeds.  As it is, probably will run at the slower speed of the two parameters.

    (2) you must do the same in your VI in real time, or set up the DMA readings so that they will be read at the same pace.  For example, suppose that a single module acquires 1000 hz and the other at 200 hz.  If you want to read 100 samples from the first module (so your reading will occur at 1000 hz / 100 samples = 10 hz), you will need to read 20 samples from the slower module, so it is synchronized with the first module.

    (3) your timeouts are too short on your DMA readings.  Your slow acquisition is 500 us.  It will take 50 ms to read 100 samples requested, but the delay is set for 10 ms, so 4 times over 5 playback will return nothing.

    (4) you use graphics and no graphics.  A chart will only show the current data buffer that was written for her.  Refresh rate of the façade is nondeterministic, so that you can't see every update.  If you use a chart, the chart will record all data written on it to the indicated depth (default is 1024 elements).

    Also remember that you can have three FIFOs DMA between the host and the target FPGA, so use them wisely.  It is often easier to perform your purchases on the FPGA at the same pace and send them through the DMA FIFO even in VI in real-time.  If you need a few channels to connect at a lower rate, you can always throw the excess samples (there are some decimate wave screws that are perfect for this).

    I hope that helps!

  • Call for a VI in a secondary with parameters within a structure of the event and a button give up

    Hi all

    I have a control with a tab control panel and two tabs have a panel of sup in them.  When running, I load the screw I want panels of void.  In the structure of control panel event, I want to start each screws and monitor the executing State, so I can give up the VI during his execution.  A method that I use can run the VI and the abort event will work (see example).  The second method that I use does not work and that's what I want to do!  I have several entries to the VI I want past that placing the VI in the case where blocks everything and wait the end of VI, so I can't monitor the State of execution.

    I've attached an example of what I want to do.

    Any help appreciated.

    Martin


  • Copy a structure of event containing local variables

    Hello

    I am a state machine design in Labview and next state transition logic to wait be clicked a few buttons on the Panel.

    If I press a Boolean button from 1 to 9, next State should be X, otherwise condition (10 to 16 tags) should be there.

    I thought that the right approach, because it would be a structure of the event, where I added two cases: case 1 (button 1: mouse to the bottom button 2 down,..., 9 of the mouse down) and box 2 (10 mouse buttons down,...). For each of these cases, I'm reading & writing the local variable of some double digital.

    When I copy the structure of the event in another case of structure of outer case, I note the following: all cases in the event loop is missing, and the local variable renamed automatically and a new created indicator digital.

    • How to make an exact copy of the structure of the event, without the problems described above?
    • Could you suggest a different approach more effective than mine?

    Thanks for any response.

    Start by reading the guard and recommendations for using events in LabVIEW - LabVIEW 2011 help

    The fact that you try to copy and structure of the event to another, and that a structure of the event will be buried in a case initially tells me you are already heading on the wrong track and yourself in creating a world of problems.  Your architecture will never seem to work for you.

    The event structures are always active and capture events.  Even when the structure of the event is not in the path of execution, it's queue of events to which he attributed to him.  If you have events that are set to lock the façade until full, then you're really screwed because the event structure will capture the event, locking of the front panel and the execution path of your code with the state machine may never come to the specific case that has captured the event to support then release the façade.

    In general, you should have the structure of a single event in a VI, and should not be buried in a case structure where he can never carry.  You also shouldn't have several event facilities manage the same events.   These are not hard and fast rules, but until you are quite familiar with how the event structures work and completely understand the architecture of your code, you should not violate or you will just ask trouble.

    Similarly with the help of local variables.  The fact that you say that you have local variables and you try to copy tells me that you already have too many.  There is certainly a better way to build your VI, which does not require local variables with the exception of a few cases and certainly won't need several structures event buried in the structures of the case.

    You should probably have a producer/consumer architecture that handles the events.  Have a simple loop with a structure of the event which captures all user interactions.  Pass events to a loop of consumer who is also your computer through a queue of State.  (Also known as a computer state in queue or the BAU).  Let the state machine to determine how to manage the events, he received based on what is the current state of the VI.

Maybe you are looking for