Using the Structure of the event in a Machine of State Enum

Hello!

I'm new to labview(~10 months). I tried my best to search on the forum/net but didn't have an explanation.
I simplified the code to show the problem. I'm using Labview 2013 worm 13.0f2 (32 bit).

The "EventStructure_Trigger_in_EnumStateMachine.vi" is a State Enum machine.
The "resting" State contains a structure of event that detect evnet of changing value of 3 buttons:

Do something touches: simply show something of the display flag
Start Run button: bring the program into "run" State
End key: put the program in the 'final' State and then close it

The State of 'run' is a time loop that will be stopped only by clicking the 4th button - button stop running and bring back the program in case of 'lazy '.

The problem is to "run" State, any click on irrelevent buttons 3 (buttons only detected by the structure of the event in case of 'lazy') will make the program crash.
By comparison, I create an another vi attached as 'WhileLoop_in_EnumStateMachine.vi', which is almost the same except that the event structure is replaced by a while loop (and do something key has no function). In this vi, everything works well - by clicking the irrelevent buttons will not crash.

I can't understand why.

P.S. I failed to attach .vi onto this post... a zip compressed instead.

A problem that resembles yours: http://forums.ni.com/t5/LabVIEW/why-does-simple-case-structure-code-hang/td-p/3176592

I think that the response of Stuart will help you understand how your code handles this situation.

You must manage your events outside your main loop to your structure to operate on any captured event.

Tags: NI Software

Similar Questions

  • How to solve problems using the event viewr log?

    Hello guys,.

    Can someone tell me how to use the event viewr log and resolve the problems or errors?

    I can solve the problems by myself, but do not know as the use of the display of event logs and information.

    Kind regards

    Claude of RAM

    Notes on the use of Event Viewer:
    http://www.gerryscomputertips.co.UK/syserrors5.htm

  • How to use the T distribution table in sql statements?

    Hi all

    I'm in the need to use the T distribution table in sql... I don't know how to use...

    Is there a function to use the values of table in sql statements?

    Can someone please help me in this?

    How about this http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions157.htm#i1279931?

    Concerning

    Etbin

  • 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).

  • Problems using the event to write new parameter values to VISA structure

    Hi all

    I created a VI to read an Omega flow meter. It is possible to change setpoint (setpoint (0-2) SLPM) of the meter and the gas (O2, CH4,...). To read instrument I write its ID (A-Z), followed by a carriage return, for example: A + 0x0D

    I created a VI with the events to write only the parameters to the instrument when a value is changed. My VI works but from time to time, it does not write the parameter change (gas or set point). I think that is has something to do with the while loop containing an entry VISA.

    Open FMA contains parameters and VISA opend

    Case of timeout initialize writing gas and setpoint for the first time

    Other events are for the change in the value of setpoint and gas

    How can I make sure that any change of setting will be writtent the instrument?

    Thank you

    Salvation Bass,

    Well, it is true that I lose this way time-out feature.

    No, you do not lose this feature. You put in a different position.

    You must call it BEFORE your loop!

    I'm not sure that I am following on this one there

    Why are you not sure? You have a large number of constants "0d" and it would be great to see that they are displayed in HEX mode instead of the normal display mode.

    The new VI manages events sometimes... but sometimes, missing a few changes... I think it is because there is an entry in the while loop. Do you have any idea how to prevent this?

    Never, NEVER use parallel loops to write and read on the same device on your serial port!

    How do ensure you that you always get the right answer to your order sent before?

    What is the purpose of using a second loop here? A loop with no wait States?

  • Control a Subvi VI main using the event Structure

    Hi all

    I'm moving hand Vi VI Sub values...

    However, my Subvi works with a structure of the event. (Change in value).

    So when I run my main VI and I press the highlight (yellow bulb), the sub vi does not run...

    I'm sure... I m missing something very basic.

    My main and the Subvi operate with a structure of the event.

    Please see my attached files.

    Each event structure listend to a button to calculate different: one on the respective fromt Panel. (Even if they have the same label, they are completely separate!)

    Events are mainly for any user, they won't be triggered if a terminal is written by program. If the front panel of the Subvi is closed, you cannot press the top button.

    Can you explain the purpose of your exercise? You seem to confuse you upward in some misunderstandings based on the flow of data and events.

  • using the event

    Hello.

    When I try to change the value of y in my vi my theta value is 0 (the default).

    Change value of theta event is ok. But I need help value change.

    My files on the attachment.

    Thank you.

    The value of theta is not zero. However, when you change is you use the original image rather than rotated table array.  I think that you need to feed the displacement to the left register terminals to the structure of the event for the image data and Boolean.  In the picture below the arraos view the original connections.

    Lynn

  • Is there a c# example to use the event handler ExpressionEdit Custom Button control

    TestStand 4.1

    VISUAL C# 2008

    I've added the event handler for ExpressionEdit events as I would any event handler:

    exprEdit.ButtonClick += new NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler (_ExpressionEditEvents_ButtonClickEvent);

    Then, I create the event handler using the syntax

    public void _ExpressionEditEvents_ButtonClickEvent(NationalInstruments.TestStand.Interop.UI.ExpressionEditButton btn)

    {

    }

    I get the following error when I compile Isaiah:

    Error 1 no overload for delegate matches '_ExpressionEditEvents_ButtonClickEvent' 'NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler '.

    I guess that means that I don't have the right parameters or types in my statement of event handler, but it corresponds to the object browser.  Any ideas on what I'm missing?

    See my last edition but I think you want your handler to look like this:

    Public Sub exprEdit_ButtonClick (ByVal sender,
    NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEvent
    (e)

  • using the event keydown aboard animate (was: keydown event)

    I want to use the keydown event and I used this syntax that works very well:

    $(document) .one ('keydown', {Function

    If (e.which == 32) {}

    Alert ("Something");

    }

    })

    But I wonder why this syntax does not work:

    $("#Stage").on ('keydown', {Function

    If (e.which == 32) {}

    Alert ("Something");

    }

    })

    Thank you.

    KeyDown events are sent only to elements that can receive focus. Default divs do not receive focus. Setting the tabindex on a div property can lead to receive the focus. If you set the same on stage, it should work once the stage has the focus.

    DIA-

  • How seeds Cache using the Event Table of the poll

    Hello Experts

    I have configured the Event Table of the poll in my PC
    Steps to follow:
    (1) table created using SAEPT. Oracle.SQL scheme in 10g
    (2) any SAEPT. Oracle.SQL by creating a new connection pool in the physical layer
    (3) configured in repository - tools - utility - OBI event Polling tables by selecting SAEPT. Oracle.SQL and gave 15 min in the polling frequency
    (4) inserted data in SAEPT. Oracle.SQL
    (5) NQserver.log checked after the time of the poll which is 15 minutes. NQserver.log was not getting updated or details about the event that occurred.

    You think that I missed a few steps in the configuration of EFA, if so... Please help me I need to implement on the client machine soon.

    Enjoy your time guys.

    Published by: Newby on July 1, 2010 10:34

    As much as I know the vote event tables are used to purge the cache automatically. It is not used to start the cache.
    If you want to start the cache, the ibots use or you do like a program...

    Published by: user8000915 on July 1st, 2010 07:37

  • Using the event Script to load the Excel model data for users

    Hello

    Whoever did this in the FDM 11.1.2.1.

    We want to exploit the event Script to load the data validated MDF for a standard template so that users can make some adjustments and then load the same data through the FDM? Is there a better alternative. Basically, trying to avoid making adjs data forms in HFM in view of the number of columns that we have and validations for each line required with adjustments.

    Thank you

    PM

    Hello

    google + Administrator's Guide.

    It's just a matter of thought in the solution:

    -Runs a SQL query to export data from table (TDATASEG). You can filter the query by LOADID

    -Write csv file records

  • Need help with the events of user base in state machine example in queue

    I wrote a small example queue state machine to try to teach myself about the creation and use of the user events.  The purpose of the machine is periodically pick a number (I do now with a control instead of a generator of random numbers for troubleshooting), and compare this figure with the number I put in a control.  When they match, I want to raise an event to fire so I can do something about having found a match.  The examples in the file LV references help show events within the structure of the event, but I want to reach out of a State and trigger an event...

    Can someone point me in the right direction here?

    Thank you

    Hummer1

    I think the service you're looking for is generating the user event.  What to put in your consumer loop, inside the case structure when identical numbers.

  • Sam s173-1415: cannot use the restore CD - 'Bad Machine' error message appears

    I have a s173 1415. I had to format the hard drive, when I went to use the original CD that came with the laptop it said BAD MACHINE. So I installed Windows XP.

    Now, I have all the necessary drivers and can not find one for the dvd/cdr drive, so sometimes the disc is recognized and sometimes it disappears.

    I want to set the laptop to original state, but the CD won't let me.
    What can I do?

    Hello

    It s very strange that this error message appeared.
    Generally all compatible CD should be delivered with this laptop.
    If you want you can order form taken CD supported and compatible, Toshiba service partner. It s not very expensive.

    You will also find the page of all drivers on the Toshiba driver download:
    http://EU.computers.Toshiba-Europe.com/cgi-bin/ToshibaCSG/download_drivers_bios.jsp#

    Please install all drivers in the correct order. The chipset utility must be installed and the beginning.

  • Output of the application using the event structures

    Hello

    In my project I used event structure that works well.

    Now I want to exit (close) demand when I press the EXIT button on the front.

    Here, I joined my project as an indication.

    Concerning

    Hari

    Hi thinnker,

    You must change the configuration of node Sub VI for this... This, then it will open whenever you call...

  • Trouble using the event functions in a class.

    I'm writing code in a class, so my main actions button panal of my .fla is not too crowded. Here's my coding class:

    set grid {}
    import flash.display. *;
    import flash.events. *;

    public class g1x1 extends MovieClip {}
    public void activateGrid() {}
    this.addEventListener (MouseEvent.CLICK, onMouseClickEvent);
    }
    function onMouseClickEvent(event:Event):void {}
    trace ("mouse clicked me");
    }
    }
    }

    Then on my main timeline I give the floor to the use of this class:

    instance: g1x1 = new g1x1();
    instance.activateGrid ();

    I also tried connecting the button, using export for actionscript, but I don't know what I'm doing wrong I keep getting errors when I try to compile.

    I know that something is wrong with my code, I'm used to the assignment of codes right button in AS2.

    Can Sombody tell me what I am doing worng?

    Thank you

    Matt.

    This is how it should look like:

    Class:

    set grid {}
    import flash.display. *;
    import flash.events. *;

    public class g1x1 extends MovieClip {}

    public void g1x1()

    {

    }
    public void activateGrid()

    {
    this.addEventListener (MouseEvent.CLICK, onMouseClickEvent);
    }
    private void onMouseClickEvent(event:Event):void

    {
    trace ("mouse clicked me");
    }
    }
    }

    your document class or the timeline the .as

    Import grid.*;

    private var myGrid1x1:g1x1 = new g1x1();

    myGrid1x1.activateGrid ();

Maybe you are looking for