How to use a structure of the event with a state machine


I don't know exactly what you're asking, but it sounds as if you want a bunch of script tests and if the user says stop, to immediately stop the current test and abandon others?  I'll assume you know how to clear the table so that it will not abandon the others, so I guess that you have wrong to abandon the current test?  If it is indeed the case, the problem is that you are not able to spread the message of the VI FP main which is the GUI for the sub vi which is the test where the test may or not have a GUI (FP visible) of its own.  Threading is the first thing to come to mind, but it will be may not need the use of events.

You can do this by passing a refnum of the stop button to the Subvi, where you can then add to wait to the structure of business event.

I have attached 2 screws, mainvi.vi which is just a loop displays the number * 2 (number of seconds since the race) to be called subvi.vi and then check to see if the button is pressed.  mainvi.VI is in no way a state engine, it's just a simple loop for demonstration purposes.  subvi.VI just waits 2 seconds and leaves, this is a better engine State structured with an init State to start a case of survey to wait events and an exit status to clean.  You can change everything as you wish so that he can do what you want.  You will notice that even if subvi.vi is running, it will automatically end when you press the stop button.

I hope this helps.

A

Tags: NI Software

Similar Questions

  • Structure of the event in a state machine

    Hi all

    I have a state machine with a sort of stand-by, where a user can select the next button state. I tried using a structure of the event with changing the values to select the next case, but when the state machine is in a specific case and the button of another State on the blocks of all things. I've attached an example, the lights simply stating that you are in the State.

    Thx for your time,

    Bert

    Edit: actually, I miss-clicked

    1. you have not need a while loop around the structure of your event.  With no wired time-out, you will never get a timeout event.

    2. your button events are set to 'Lock Front Panel until end of the event'.  Uncheck the box which.

  • How to use a structure of the event in a Subvi

    I am using a structure of the event within a Subvi.  The Subvi has a table constructor that built tables and the structure of the event is used so that when the program runs, it allows you to change the elements of the array.  It works, but when I apply within a Subvi, it does not work properly.  This goes into a Subvi, because it will be part of a much larger progrram, so it must be modular.

    If you are using a structure of the event, it is not a Subvi.  If you worry about modularity, you should not use the structure of the event.

    You seem to have a fundamental misunderstanding of modularity.  An event structure must be placed in a while loop.  If you have a while loop in a Subvi, you have transferred control of your program to the Subvi.  You are not at this stage modular.  Your higher level GUI has no control.  You would have to create a stupid system of variables to pass data down to the loop to stop the loop and return to your main VI.  This is not a good design decision.

    Instead of searching for a way to make something broken, you should spend effort trying to understand what you really want to accomplish.  You should also spend some time to learn how to work the event structures.

    This application is small at the moment and it is already on the way to the unreadable.  It's a terrible thing to do for you.  Break these habits now.  variables are only when absolutely necessary.  Using subVIs to accomplish individual tasks, do not run the entire application.  With the structures of the event, use a value of stop button change event for will not be held hostage to the time-out.  If your variable is '2' in it, you're doing something wrong.  It has to be something different between set points, put it in the name.  If you want to make the subVIs, create an icon.

    But first and foremost, invest time in understanding dataflow

  • How do I step manually in code that uses a structure of the event, when I want to select a particular event?

    I use an architecture of producer/consumer for an application with a structure of the event in the upper loop. Events are triggered by the user from the control panel using Boolean switches that are "change when you press on" and "release switch. My question is how can I manually step through the code using various events? It doesn't matter what I'm still not in the same event.

    Thank you.

    You can view the code? Is what event still enter? I did have problems step by step in code that uses a structure of the event. You must be patient, but because the application is slowed down a bit and it can take a while to get into the case of the specific event depending on what events you deal. Usually, I place a breakpoint in the case I am interested and run the application as usual. Once I hit the breakpoint is when I turn on highlighting of execution.

  • can I use a structure of the event in another structure of the event

    Hello

    Can use a structure of the event in another structure of the event?

    Thank you

    Viviane

    I would put your waveforms in the registers at offset.  You can then use your structure for the main event to trigger on the Show 1... the value change events and process the data, however you need from there.

  • Can I use Ctlref in a structure of the event with a mouse to an event?

    I have a large number of controls on a front panel. I use a structure of the event that triggers the movement of a given motor when you press the corresponding button. However, I would like to avoid creating events for identical most of N, so I relied on the use of a mouse down on the front panel event, then retrieve the reference command using the Ctlref node (with gives 'Reference to the control on which the event occurred', according to manual labview) and analyze an array of references to know which engine is supposed to move. However, it seems that this node is not (contrary to what the manual said).

    I found other ways to do what I need (I thought using a table containing details of my controls and the coords in the structure of the event node), but I wanted to know why I can't find this node (that is displayed for the event "value change" for example). I'm using Labview 2013.

    No luck for you. Mouse down on the Panel does not have the refnum control because it does not work on a control. Mouse down on a control has it, and since you can configure the mouse down events on multiple controls in the same case of event, it also provides a refnum of control so that you can still use the order in question.

    This is probably also the question that Jeff might have seen. When you set up multiple events for the same frame that LabVIEW displays only the terminal event that are present in all of these events. Terminals that do not exist in at least a specific event of the multiple events for this image are more selectable.

  • Control the Structure of the event with text file

    I'm new relativaly in LabVIEW (experience only about 2 weeks). I am currently control a stepper motor using a structure of the event. Similar to the sample code given by LIFA, I entered my settings how the engine not move away, then press a button on the windows before, and it works this way. I also have other equipment that works as well in LabVIEW, as a transnational step; all components operate individually.

    Now, I'm trying to make the more automated system and to ensure that all the different equipment work in the same code. So, I tried to implement a structure of the event using a text as an input file to try to control events. The text file has a table 1 d of numbers going down vertically (only the line numbers change). So, I used a table of index function to take the numbers one by one, use a loop (while loop in this example) to go to the bottom of the column of numbers. However, the event not register the change, even if the indicator shows the value is changing.

    Attached, it's my test code and the text file that I use to try to control the structure of the event. Please let me know what I am doing wrong. Thank you.

    Oh, now I understand what you tried to say. I'm using a loop and a case structure to activate different events with the entries in the table. I thought case structures and event were the same, but you taught me the event structures are used just for the façade stuff. Thank you all!

  • How to manage the structure of the event with two loops

    I have a question about the structure of the user event with 2 buttons?

    key 1: START LOGGING DATA

    key 2: STOP LOGGING DATA

    How do I control my

    structure of the event so that it will work? because now that the loop is save data... I can't stop the loop, when I clicked on buttons.

    super_saiyans wrote:

    the problem with moving it is that I don't have control of the DATA RECORD STARTING?

    Of course, you do.  When you get your press conference button, you say your state machine to move to the State of logging.  You must also make sure that you return to visit the State to wait for the event to check out the events of the stop button.

  • How to stop the While loop in the Structure of the event with the same button?

    Hello

    I have a problem. I want to use a single control to activate an event in a structure of the event and the same control to end a while loop in this case.

    It is possible to use 2 controls to do this, but I need to be alone.

    Thank you

    You should NEVER place while loops inside the case of the event, and it is never necessary to do. Think about it: all you have to do is spin the code. You can easily use the outside while loop for everything. Simply place the code of the loop internal (without the inner loop) inside the case of delay and manipulate the time-out period between a pending finished and the infinite (-1), depending on the State of the Boolean value.

    A very simple example (LV 8.0)

  • Instead of using the structure of the event with the producer consumer?

    I used the architecture of producer-consumer in the past to control a state machine with the structures of the event.  I'm working now with the basic version of LV that does not include the structure of the event.  Can anyone recommend alternatives to the use of the same architecture in this case?  Thank you, David

    Before the introduction of the structure of the event, the only option was the election.  Control terminals are in a time loop (the producer) with shift registers and a wait, usually about 100ms.  At each iteration of the loop, the control's current value is compared to the previous value.  If it has changed, and then take appropriate action.  Andrey suggested, queues are a good way to pass information between the loops.

    It works for the equivalent of the value change events.  Things like mouse to top or filter events were much more difficult or not possible.

    Lynn

  • by using a structure of the event to restore a Boolean control with change in value for the menu ring

    I'm trying to get two Boolean buttons to reset when the value of a ring menu.  For this I use a structure of event defined to execute with a ring value change.  However I have another code that should be run while the structure of the event expected to change value.  I place my structure of the event inside the while loop buttons reset as expected but my other code is not run (except when the value of change). If I place it outside the loop the rest of functions code as expected, but the buttons do not reset.  Any help you offer is much appreciated.

    Hello

    ADD TIME OUT EVEN AND GIVE DELAY OF 100 MS.

    Adds the case-application-timeout event

  • reset the timer using a structure of the event

    I wrote a simple code to count the second and the timer can be reset if I press the button "reset".

    It works; However, there are two problems,

    1. when I run the program, the timer takes 1 second to start

    2 when I press the reset button, the timer also takes a second to answer

    I think it's the 1000ms that is connected to the left corner of the structure of the event. Is there a better way to overcome this problem? (the timer starts and resets immediately

    When I launch the program and press the "reset" button)

    Thank you!!

    Dear ivy037

    You can make the time outside the structure of the event as in the attached code.  I would like to know if this is satisfactory.

    Thank you

  • Structure of the event with value changes

    Hello, I had a problem with the use of a structure of the event. I want the values to change the table itself when the user changes the units, such as the flow rate 4 l / min = 240 l / h... It should appear in the same table. I've already got a code here, but it's quite confusing and does not

    Could you please help?  Thank you

    So that it doesn't?

    How it did not work?

    What you want it to do?

    What did do?

    We cannot read your mind, you must explain in detail.

  • Structure of the matter and structure of the event with a condition of the indicator (boolean)

    Hello

    I read a lot of posts but I can't solve my problem. I would like to set up a business structure and the structure of the event, and the condition to run the code inside is a Boolean indicator, in this case called Wahnelt (screenshot). I know I should use signal value, but I don't know how to implement. Here is the program:

    Any help will be more thankful

    a state machine with timer elapsed...

  • Programmatically trigger a structure of the event with the value (signaling) is not responding

    Hey, in my attached program I check if the two steps of translation are in a specific position. If Yes, I want my code to execute a sequence of movements. If this isn't the case, I'm asking the user if he wants contributed from this position anyway. It has three options: Yes, go to load (the specific position) and cancel. If he hits Yes, I am using a property of signal value which should update the controls Boolean true, allowing the sequence. Cancellation and work "to load" perfectly fine, but 'Yes' does not work. I think I need a structure of the event to ahndle the value of the Boolean control 'x' change event, however, the addition of this structure of the event for some reason any even do not allow me to click on the Start button of the procedure.
    Thanks for any help in advance.
    Doug

    Really, you should look into using a State Machine.  You should have really not what happens inside a structure of the event.

    In addition, I would like to use a shift register to store this value instead of a front panel control.

Maybe you are looking for

  • can I just use icon for Favorites

    I don't want the description of the bookmark just the icon is it possible, that otherwise the toolbar is too long

  • Bluetooth on Satellite U400

    Hello I recently bought a new Satellite U400-15e and assumed he had installed bluetooth. After turning the switch of communication, I put my phoneto search for devices, but he found nothing. I tried to get several times with the same result. So I gue

  • HP Probook 4730 s system device base and network controller driver

    Dear employees of Hp, I have install on my HP Probook 4730 s new Windows 7 Ultimate and I cannot find and install the base system device and network controller driver. Can you help me please? Kind regards Robert

  • C410 charger problem

    When I copy and scan and I place the document on the glass, press scan or copy and printer tries to feed a document at the top and gives me an error document feeder jam. It does not analyze the document that I placed on the glass.

  • Computer Windows Vista is unable to see the Boxee Box or Windows 7 computer.

    original title: network sharing I have a Windows Vista-based computer, a Windows 7 computer and a Boxee Box from d-link. The windows vista machine is set up for sharing, but I thought that you should choose what is shared.  I'm not able to see the Wi