Event structure in a State machine

Hello all,
I've got a state machine with a sort of Stand-by state from where a user can select the next state using buttons. I tried using an Event structure with value change to select the next case but when the state machine is in a specific case and the button of an other state is pressed the whole thing blocks. I've attached an example, the LEDs just indicate what state you are in.
Thx for your time,
Bert
edit: Indeed, I miss-clicked
Solved!
Go to Solution.
Attachments:
Question.lvproj ‏2 KB
Question.vi ‏21 KB

All your inner while loop should not be there, they just gum up the gears. It is a bad idea to trap the code inside inner loops, because during that time, events cannot be handled, whil they are still queued up. For example if you are in state 1 and press state 3 100 times, then exit state 1, state 3 will be entered 100 times in a row, witout a possibility of escaping.
Thus the use of an event structure is also ill advised here.
Here's is a quick draft showing the same code without inner loops and without the event structure just to give you an idea what I meant. See if it gets you some ideas. It is still not perfect ...
(Sorry, I had to disconnect the type definitions, because you did not include it)
LabVIEW Champion . Do more with less code and in less time .
Attachments:
Question 1mod2.vi ‏19 KB

Similar Messages

  • How to use a event structure with a state machine

    First, I would like to inform you that I only work on LabView part time, and have much to learn.  Anything I do learn, I usually forget until I need it again, because I only work on it part time.
    Using your StopWhileLoopMOD[1].vi, I am trying to put a state machine inside the event structure.  
    Related link: http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loop-in-Event-case/td-p/465564/page/2
    Here is my application:  on the front panel, the user can select any combination of 7 different tests.  I have created cases to perform each step of each test in the correct order, but if the user presses stop, the tests won't stop because some of the cases have a while loop inside the event structure (like you mentioned is a bad idea).  The user should be able to stop the test, reselect tests to perform, and re-start the tests. 
    When the start button is pressed for the event structure, I need all the cases to run in the proper order, unless stop is pressed.
    In the past I have indexed an array and used that to run the state machine, but it won't stop immediately.  
    I have sub VIs that are built in while loops because the outputs of the product needs time to stabilize.  The state machine stops and waits up to a certain number of iterations.  If it passes the test, the while loop stops and the next state starts.  If it takes too long, it exits and reports an error.  Maybe I need to just use the state machine and not an event structure?
    Is there a good example of an event structure?
    metzler CLAD
    Solved!
    Go to Solution.

    I'm not sure exactly what you are asking, but it sounds like you want to script a bunch of tests and if the user says stop, to immediately stop the current test and abandon the others?  I'm going to assume that you know how to clear the array so that it will abandon the others, so I'm guessing that you are having trouble abandoning the current test?  If this is indeed the case, then the problem is that you are not able to propagate the message from the main VI FP which is the GUI to the sub vi which is the test, where the test may or may not have a GUI (FP visible) of it's own.  Threading was the first thing to come to mind, but this may not be necessary using events.
    You can do this by passing a refnum of the stop button to the subVI, where you can then add that wait to the event case structure.
    I've attached 2 VIs, mainvi.vi which is just a loop displays the count*2 (number of seconds passed since running) that will call subvi.vi and then check to see if the stop button is pressed.  mainvi.vi is by no means a state engine, it is just a simple loop for demonstration purposes.  subvi.vi just waits 2 seconds and leaves, it is a better structured state engine with an init state to start a poll case to wait for events and an exit state to clean up.  You can modify this any way you wish to get it to do what you want.  You will note that even if subvi.vi is being executed, it will terminate immediately when the stop button is pressed.
    Hope this helps.
    A
    Attachments:
    mainvi.vi ‏17 KB
    subvi.vi ‏33 KB

  • I need help with event structure. I am trying to feed the index of the array, the index can vary from 0 to 7. Based on the logic ouput of a comparison, the index buffer should increment ?

    I need help with event structure.
    I am trying to feed the index of the array, the index number can vary from 0 to 7.
    Based on the logic ouput of a comparison, the index buffer should increment
    or decrement every time the output of comparsion changes(event change). I guess I need to use event structure?
    (My event code doesn't execute when there is an  event at its input /comparator changes its boolean state.
    Anyone coded on similar lines? Any ideas appreciated.
    Thanks in advance!

    You don't need an Event Structure, a simple State Machine would be more appropriate.
    There are many examples of State Machines within this forum.
    RayR

  • Using multiple events structure inside state machine to control the Tab

    Hi y'all,
    Anne here.I have a Tab indicator in my front panel and I want to be able to control the flow of my program based on what controls I clicked inside the tab. I am using a state machine architecture and inside every state, I use an event structure to check for user interaction  to determine the next state and what tab page is going to be displayed next. This means that I am actually using multiple event structures in my application and I use them in just one while loop, but just that they are not running in parallel since I am only using "one event structure per state" which means that only one event structure is running at one time. My questions is, programming technique wise, am I doing it correctly? So far, I am not facing any problem (I am still in the early stage of the project) but I want to check with you all first on your opinion regarding this architecture. Will there be any issue on using multiple event structures in a vi? Since I will be using a tab, and the controls available in the tab will be the controls that will control my event structure for that state, by right, there should be no issue. Am I correct to assume this? Is there any limit on the use of event structures? I have attached here a simple sample of the architecture that I am talking about for your reference. I have attached a 2010 version and a 8.6 version. Let me know what you think or any opinions that you may have.
    Hoping to hear from you soon! Thanks so much in advance!
    Cheers!
    Anne
    Attachments:
    State Machine-Event Structure Sample_2010.vi ‏19 KB
    State Machine-Event Structure Sample_8.5.vi ‏25 KB

    Hi jak888,
    I decided to use tabs cause I don't want to have subvi pop ups every time i need to perform the process in the state and show an update in the front panel. This is actually going to be more of an ATE where you will have to choose first whether the one using is the operator or the engineer. If the operator is logged in, she will proceed to choose what test to run (this state will have its own event structure). This part, I don't want a pop up, so what happens is that from Login page, if the user logs in as operator, the tab will automatically switch to the Test Selection page. After selecting the test, it will proceed to Start Test state and the tab will show the Result Summary page. If the user logs in as engineer, then a totally different tab will be automatically shown next and so on. By doing this, I will be able to show an update on the front panel objects without having the subvis pop up. I will also just need to use the call reference functions to call my subvis, making my Main VI more generic. The tab Page header will be hidden so the operator will actually not see that there is a tab and that there are a lot of controls and indicators cause they are hidden in the tabs and that page will only be shown based on what they selected from the main tab. 
    I appreciate your thoughts! thanks so much!

  • Shutting down a queued event state machine with multiple parallel loops

    I am trying to find the best way to shutdown a program that consists of a queued event state machine architecture with multiple parallel loops. Can anyone recommend the best way to accomplish this in my attached VI? (From browsing the forum, this seems to be a common question but I haven't found a solution that works for me.)
    I welcome any other feedback on my code as well, if anyone is willing to offer it.
    My Program Requirements:
    If the user presses the "Shutdown" button, the program should prompt the user with "Are you sure you want to stop the program?" and then either return to the Idle state or proceed to stop the program. Additionally if there is an error, the program should prompt the user with "Clear error and continue, or Stop program?" Then either return to the Idle State or proceed to stop the program.
    Details of architecture:
    The program consists of 3 parallel loops: (1) an Event Handling loop that enqueues various States to a State Queue, (2) a State Machine which enters the latest state that is dequeued from the State Queue, and (3) an Error/Shutdown handling loop which processes any errors in the Error queue.
    During normal Shutdown, in the Event Handling loop the "Program.Shutdown" event case executes, and the States "Shutdown" and "Idle" are added to the State Queue. In the State Machine, the "Shutdown" state is invoked. A special error code "5000" is added to the Error Queue. In the Error/Shutdown handling loop, the "5000" error triggers a prompt that asks the user if they want to stop the program. If the user chooses not to stop, a notifier StopNotif is sent to the "Shutdown" state and "Program.Shutdown" event case with the notification "Go". If the user chooses to stop, the notifier sends the notification "Stop". The Event handling loop and State Machine are terminated if they receive the notification "Stop".
    In case of error, the program behaves similarly: if the user chooses to clear the error and continue, the program returns to the "Idle" state.
    HOWEVER - if the user chooses to stop the program, the program stalls. The notifier that is sent to stop the Event Handling Loop and State Machine cannot be read because the Program.Shutdown event case and the Shutdown state (which contain the "Wait for Notifier" function) are not active.
    I have been able to activate the Shutdown state by enqueuing it in the Error/Shutdown handling loop. But I don't know how to activate the "Program.Shutdown" event programmatically, and thereby access the "Wait for Notifier" function inside it.
    I tried to place the "Wait for Notifier" function outside the event structure, but then the Event Handling loop never completes. Placing timeouts on the "Wait for Notifier" and on the Event structure makes the program work, but I want to avoid using timeouts because I don't want to turn my event-driven program into a polling-based program. I'd also like to avoid using variables or property nodes to stop the loops, because that requires creating a control/indicator for something that the user doesnt need to interact with.
    Thank you!
    Solved!
    Go to Solution.
    Attachments:
    Queued event state machine parallel loops empty.vi ‏46 KB

    Thanks for clarifying that, Ravens Fan.
    I marked crossrulz as the solution for pointing out User Events to me.
    I also adopted Ravens Fan's suggestion to keep the Shutdown procedure out of the Error Handling Loop. This has simplified the architecture by eliminating the need for Notifiers. Instead, I have used booleans in case structures to stop the Event Loop and State Machine, and Release Queue to stop the Error Handling Loop.
    For reference, I'm attaching my corrected code.
    Thank you to everyone who helped!
    Attachments:
    Queued event state machine parallel loops empty in progress.vi ‏44 KB

  • Producer consumer vs state machine

    Hi there,
    I have been on and around for quite a while to understand how can I re-design an application, which was originally built using a mix of sequence structure, while loops and event structures. And now I am making a newer version of the same application, for research purposes, while learning the LabVIEW techniques. Earlier I used LabVIEW versions 5 and 6 to make simple programs for fuzzy logic and neural networks. And that's not a good reference.
    Ok, after learning that Producer Consumer (PC) and Standard State Machines (SSM or SM) are two new approaches for a better (scalable, flexible and efficient) coding as suggest by veterans, in one thread where I asked about another issue, I have started digging into this topic and now I am on a point where I have to implement it finally (spent pretty much time in the learning phase).
    I have several questions.
    To start the discussion, I would give a brief description of my application.
    It's a networked application, where the network communication happens using DataSocket (one reason to use LabVIEW as the environment).
    We are talking about the client application, which communicates with other applications on remote computer, via Internet.
    User interface involves a tab control, with several pages-
    On startup, the controls/indicators (now onwards referred as controls only), are initialized, datasocket connection is checked (rather internet is checked, and a connection established with the remote datasocket server) (page 1)
    If connected to the datasocket server, the user selects Login/Registration (page 2)
    Login and/or Registration happen on page 3/4
    Then the user sees a table of remote users to connect to (page 5)
    Upon selection of a remote user, and after clicking on "connect", the user will see a video indicator, with a lot of other controls. (page 6)
    On this page with video indicator and controls, the user has a lot of activities, in which many messages are sent and received to/from the remote machine.
    the user may disconnect and go back to page 5, and log out and go back to page 2 and so on.
    I hope this is clear.
    I have thought about two different ways to do this application. Using PS or by SSM.
    In the attachments, I have given a diagram (with errors, of course, because of unlinked controls), for each of the approach, plus the original application's diagram.
    I hope this is sufficient for anybody to understand my case and give suggestions.
    I am looking for suggestions about which is a better model for my type of case. I have been to discussions like this one and saw that there are many issues regarding dequeue in PC model. So I am curious to know if SSM is a better and latest model or it's more primitive? Which looks better for my application's performance?
    Thanks ahead!
    Vaibhav
    Attachments:
    OldDesign.vi ‏41 KB
    PCDesign.vi ‏42 KB
    SSMDesign.vi ‏46 KB

    Vaibhav wrote:
    @ Harold
    Thanks. Any suggestion how can I start and stop that loop in parallel with other loops? Like, if some event occurs, the loop should start execution, and keep on moving, while other events are being traced and executed.
    In those examples where you had a while loop inside a case structure, that bit of code will only execute one time.  It will immediately read the boolean at the start of the program, if the value was true before the porgram started, then the while loop will run.  Once that while loop stops, the case structure will end.  It will never execute again unless you completely stop and restart your program.  If the boolean is false before the program starts, the false case will execute immediately.  Nothing happens since it is empty and it is done, never to run again (unless you stop and restart your VI)  You should turn the structure around.  Put the case structure in the while loop.  Make sure you put a small wait statement in the loop so that it doesn't run full speed eating up CPU cycles just polling the status of the boolean.
    @ Ravens
    Thanks for the detailed comment.
    One thing I would clarify. The user will not be able to switch between the pages using the tab control. The program will direct appropriate page to the user. I kept the tabs visible just for your idea of the pages. Sorry, I didn't mention that.
    Do you think it's still a bad design?
    If the tabs will be hidden or disabled, you will probably be okay.  I wouldn't call it a bad design.  I wouldn't do it that way.  But as long as you understand the possibility of problems and prevent that.  Especially some time down the road when you modify the program in some other way that could lead to a problem because you forgot about the dependencies of the event structures on the state of the state machine. 
    Yes, I agree about only one event structure to handle all the events. But since the user will not be able to click somewhere else, other than those possible controls, I thought to keep it like this.
    I thought the events are captured only if we are in that case. I think I am wrong, right? Events are captured at any time, even if the case has never executed before, or will never execute.  Ok, The events will be captured, but will not be executed until in that case.
    And that's the reason why I have two separate event structures, in two separate phases of the program.
    Because, prior to page 6, the events will occur sequencially. The user will click somewhere, then some message will be transmitted over DataSocket, then some message may come , then again some user action and so on. But, when the user starts using page 6, there will be parallel process of user controls events and actions, and incoming messages and corresponding actions. For this, in the page 6, I need a different kind of execution. So I separated the two event structures.
    At first I thought to have SSM, and then I thought to PC, just because I can have two separate parallel processes - one for user events, and another for messages (because that way I can take maximum advantage of message tracking). But looking at other complexities, I find SSM more appropriate. Can you please tell me how can I have my message loop and events loop parallel to each other and just one event structure?
    You can have a dequeue function in your state machine loop and have it be a consumer loop.  Use a timeout on the Dequeue.  If there is a timeout, have the statemachine execute normally after that perhaps just passing the enum wire straight into the case structure of the state machine.  If it doesn't timeout meaning you got a message, then look at the message that is dequeued and act on it.  Perhaps it means ignoring the enum coming in from the shift register and changing the enum to something else to feed into the case structure of the state machine.  Attached is an example
    Attachments:
    PCDesign[1]_BD.png ‏6 KB

  • Event structure input event question

    I'm using a state machine to do some data decoding stuff. The default initial state is Idle, which checks an output boolean value from a FIFO buffer. If the boolean value is True, go to the next state; otherwise, keeps waiting. See attached "idle_noEventStructure.vi" for part of the code. But this method will consume a lot of CPU usage.
    In order to save CPU time, I try to use an event structure in Idle state to wait for the output boolean value change. But I don't know how to add an event for the boolean value change. See attached "idle_eventStructure.vi".
    Any one could help?
    Thanks.
    Attachments:
    idle_noEventStructure.vi ‏7 KB
    idle_eventStructure.vi ‏8 KB

    MileP,
    First off, in the state machine example you give "idle_noEventStructure.vi" the reason you may be experiencing poor performance (high CPU) is that your while loop is running as fast as the OS will allow sicne there is no timing implemented.  You should always you a "wait" function inside the loop (see attached file).  The loop should only run as fasat as you need to check the FIFO for new data.
    If you want to use an Event structure you can use dynamic event registration to create an event for the FIFO data.  I have outlined this in the attached code.  It may not be eactly what you need but should give you he right idea.  An event is created for the boolean output from the FIFO and this event is registered with the event structure.  I am simulating the FIFO data using the "Producer Loop" and the Trigger control.  I am simply stopping all the loops when the Trigger button is pressed, but this is done using the event creation.  This method still requires a polling loop ("Consumer Loop" in my example) to check for FIFO data, but the lopp rate can be handled more carefully this way.  And I am not sure there is anyway around using some method of polling.
    Dan
    Attachments:
    Event Registration.vi ‏17 KB

  • Help with State Machines

    I am implementing my application using state machines, and I have the following problem.
    1. I have an initialized state that will initialize my controls.
    2. Next I want the next state to check for user input.(boolean button will be pressed to determine which state is next).
    3. In one of the states, I want the user to be able to change the initialized values, and afterwards go back to the user input state, to determine which state is next
    I have implemented the initialize state as well as the user input  state(use event structure for that state), but I do not know how to let the user be able to change the values of my control , then the user acknowledges the change, and the state goes back to the user input state waiting for the next state.
    Thanks for any help
    Solved!
    Go to Solution.

    Thank you Ravens Fan, I did not really understand your message. I have a simplified version of what I am trying to accomplish.
    1. I have 3 controls and one indicator
    2. When the Vi is run , the controls should initialize to the values in the intialize state. The next state will now be the user input state.
    3. When at the user input, the user can either press the "analyze button" and the result will be displayed in the indicator. or the the stop button to stop the simulation, or
    4. The user can change the values of the control, after all the controls have been changed to his desired values, he can then press "accept values" and the state goes back to the "user input".
    Thank you for any help
    Attachments:
    example.vi ‏26 KB
    example control.ctl ‏5 KB

  • Problems closing several loops in a state machine with an event structure

    I am having some problems closing three loops running in parallel in a state machine.  I have one loop for an event structure to monitor user controls to change the state.  The other loop is the state machine which will control an actuator, and the third loop is for data aquisition/analysis.  I want to be able to hit the stop button and go to a "shutdown" state where I can home the actuator then close the loops and finally go to the last "shutdown" subdiagriam in the flat sequence structure.  Currently when hitting the stop button it goes into the shutdown state and will end the state machine loop but it appears the other loops are not closing until I hit the stop button again.  Could this be due to using a local variable for the boolean to control the loop conditions? I attached a screenshot of the block diagram.  Any advice would be great!
    Attachments:
    example.png ‏108 KB

    You have a classic race condition due to overuse of local variables. If the stop event fires in the upper loop, the local variable connected to the loop termination condition has already been read (it is false!). This means that the upper loop will iterate once more and again wait at the event structure for the next event. At this time, the local variable connected to the loop termination is TRUE, but the loop cannot complete until the event fires again, for example if you press the stop button once more.
    The correct way is to connect the terminal of the stop button across the right event frame directly to the loop termination terminal. Now it will get the TRUE value correctly once the stop event fires for the first time.
    LabVIEW does not execute left to right, execution order is determined by the wiring.
    I also agree with the above message that you should rethink and re-architect your code using established coding guidelines. 
    LabVIEW Champion . Do more with less code and in less time .

  • How to run a particular case continuously in event based state machine architecture.

    I am making a program using event based state machine architecture, it is running as expected whenever i am generating an event, case structure corresponding to that event executes.
    we are taking some measurements from oscilloscope e.g. i am having one boolean button for rise time whenever i am pressing that that button it displays the value of rise time, it displays only once( since i have generated an event on that boolean button so it executes only once and displays value for one time and then comeback to timeout state) but in our program what we want, we want it to update value continously once that button is pressed.
    Now for a time being i have placed while loop on the case corresponding to rise time but this is not the right approach.
    since i am using state machine architecture( event based ), i am not getting how to run particular case continuously ,or if there is any other better architecture that i can use to implement the same application.
    Attached below is the program.
    Attachments:
    OScilloscope .zip ‏108 KB

    Say, in the attached program, when the user selects Autoset, it inserts corresponding state (Autoset) and now if you want this state to run again and again, probbbly you can again insert Autoset state while executing Autoset state... ohhh its confusing... check the picture below (A picture is worth a thousand words):
    1. Based on user selection, insert Autoset state.
    2. Re-insert Autoset state again and again while executing Autoset state.
    3. Now to come out of this loop, based on appropriate event generation, insert any other state AT FRONT (equivalent to Enqueue Element At Opposite End).
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Run Code Continuously in Event Driven State Machine

    Hi there, I was wondering what is the best way to run code continuously in an event driven state machine. Particularly, I am going off the JKI state machine. At the moment I put the code I want to run continuously (acquire from an instrument) in the timeout case of the event structure. When the user presses the button, the event sends the value 0 to the timeout terminal of the event structure (through a shift register). If the user stops the acquisition then the value -1 is sent to the timeout terminal. This is a tip that I took from an article by Mike Porter.
    Would it be better to run this process in a separate loop? Is a state machine a bad design choice for running code continuously? I don't like my current solution because if I have another process I'll have to start putting case structures into the timeout case. Also, if the process takes a while then the event structure will take a while to respond.
    Thanks for your input!

    AKA_TG wrote:
     Adding to that I believe Preview Queue element to read the data and Lossy  enqueue to transfer the I/O output, especially if the I/O device responds slowly. This should keep your event structure polling along very nicely during I/O calls to the other structure.
    I actually prefer to use an User Event to send the data to the main event structure and/or whoever else needs it.  I am not a fan of the lossy enqueue (loss of data).  At that point, I might as well just use a Notifier and/or global variable.

  • How to do state machine using events .

    Hi all.
    i like to create a state machine using events methos .
    i have 4 functions 1,2,3,4. (event based functios) (seperate sub vis)
    1.i will trigger the 1 function.
    then end of the first function should trigger the next function.
    like state machine .
    how to create this method in labview .. i tried value signaling its still not working . what i want.
    Solved!
    Go to Solution.

    JGar wrote:
    Wouldn't it make sense to have the entire state machine within one event case?  When you trigger the event case the state machine then executes like a normal state machine.
    DO NOT DO THAT!!!!!!  Long parts of code do NOT belong inside of an event case.
    The Event Structure should be in its own state and the state machine should to to that state every once in awhile to check for user events.
    Alternatively, you could put just the state case structure inside of the Timeout event case.  Something like this: http://www.notatamelion.com/2015/03/02/building-a-proper-labview-state-machine-design-pattern-pt-2/
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Need help with basic user events in Queued state machine example

    I have written a little queued state machine example to try to teach myself about creating and using user events.  The objective of the machine is to periodically choose a number (I'm doing it now with a control instead of a random number generator for troubleshooting), and compare that number with the number I have set in a control.  When they match, I want to cause an event to fire so I can do something about having found a match.  The examples in the LV Help file references show the events within the event structure, but I want to reach out of a state and cause an event ....
    Can someone point me in the right direction here?
    Thanks
    Hummer1
    Solved!
    Go to Solution.
    Attachments:
    User Event Generator Example01 snip.png ‏102 KB

    Yep....That was it...I had tried to do that but got fouled up with the variant definition...so defined the user event using a boolian and did the same in the case structure where I wanted to create the event and it worked great...
    Thanks.
    Here is the final version...not bulletproof, but does have a queued state machine using a user event to cause an event to fire.
    Hope you find it useful.
    Hummer1
    Attachments:
    User Event Generator Example01.vi ‏45 KB
    Operating States Enum Example01.ctl ‏5 KB

  • New LabHSM Toolkit - Agile development of complex event-driven maintainable LabVIEW applications with active objects / actors based on a universal Hierarchical State Machine / statechart template.

    Dear Fellow LabVIEW programmers:
    Most of the systems you deal with are reactive. It means that their
    primary function is constant interaction with their environment by
    sending and receiving events. But most likely, they can have something
    happening inside them too, even when they are not processing messages
    received from outside. So, such systems have to continuosly react to
    external and internal stimuli. Right? Moreover, most likely, they
    consist of subsystems that are reactive too and, in turn, can have
    their own "life", to an extent independent from other parts (with
    which they still communicate, of course). Reactive (event-driven)
    systems are more naturally modeled with active objects. So, why then
    should we try to model and code them with GOOP and its passive
    ("dead"!) objects?
    "Flat" State Machines have been known for decades to have severe
    limitations. It's been more than 20 years since Dr. Harel invented
    Hierarchical State Machines (statecharts) to fight those limitations.
    Then why does NI still tout the same old good Moore FSM as the
    ultimate tool for event-driven programming in LabVIEW in its $995
    State Diagram KIt?
    The LabHSM toolkit we are happy to present, makes it possible to
    easily create and then maintain complex event-driven applications in
    LabVIEW as a collection of HSM-driven active object VIs using a higher
    level of abstraction and agile software development methodologies.
    These active object VIs are created based on a universal Hierarchical
    State Machine ( HSM or statechart ) template. So. all your code looks
    similar regardless of its functionality!
    We all love just jump to code, right? However, to be good boys, we
    need to do design first. Then implement it in code. If the logic is
    modified we need to redo the design first and then redo the code. When
    using LabHSM where behavior information is abstracted into a separate
    HSM data file editable with a supplied editor, there is no need for
    coding separate from design any more. The modified behavior becomes
    code automatically as soon as the HSM file is saved. Design is code!
    The implementation basically follows Dr. Samek's Quantum Programming
    paradigm. (see http://www.quantum-leaps.com). However, as already
    mentioned, LabHSM stores the behavior information in a file separate
    from the code itself. It also adds state dependent priorities to
    events, a separate queue for public events/messages, and, of course,
    some LabVIEW specific code like capturing front panel user events and
    putting them into the private Events queue. Communication and
    instantiation functions are also rather specific for LabVIEW.
    It is available for UNLIMITED PERIOD trial. Please visit
    http://www.labhsm.com for details and download. The site also contains
    references which you may want to check to learn more about
    hierarchical state machines and active object computing.
    Since this is our debut we will appreciate any comments and
    suggestions. Our contact information is available on our site, of
    course.
    Have a G'day!

    Symtx is currently hiring the following position. Please contact me if interested.
    Amy Cable
    Symtx, HR
    [email protected]
    Symtx, the leading supplier of functional test equipment, hires the brightest & most talented engineering professionals to design & manufacture complex custom electronic systems for advanced technology leaders in the defense, aerospace, communications, medical, transportation & semiconductor industries. Symtx’ challenging & dynamic work environment seeks to fill openings with highly qualified electronic engineering design professionals.The ideal candidate will be responsible for defining the requirements, software design and code development, and integration of test control software for custom functional test systems. Candidate should be familiar with data acquisition concepts, instrument control, complex test, measurement and calibration algorithm development and definition and implementation of control interfaces to hardware. Prefer familiarity with instrument control via GPIB, VXI, MXI, RS-232 desirable. Requires BS/MSEE and 3 -7+ yrs of experience in one or several of the following test applications in a Windows NT/2000/XP environment using Labwindows CVI, TestStand, Labview, Visual Basic, C++ and knowledge of RF systems is a plus. Job responsibilities will include software design, development, integration, team leadership, and interfacing with customers( includes PDR’s & CDR’s).

  • Other events interfere with abort for state machine started by an event

    In the attached VI there is a state machine that is triggered by a boolean “start” change event.  There is also a boolean “stop” that stop the state machine, a numeric “voltage” that has an event handler and a boolean “exit” that has an event handler.
    The stop button works as expected unless if the voltage value is changed before the stop button is pressed.  I was thinking this might be because there is an event for the voltage value change but there is also an event for the exit button value change and the problem does not occur if the exit button is pressed before stop.
    If anyone could explain the reason I am only running into the problem with the voltage value change and/or how to properly implement the stop/abort function I would appreciate it!
    Thanks,
    Dave (LabVIEW 7.1)

    Well that certainly solves the problem I was having!  The case in a while in a case in a while reminds me of the 10-level deep if statements I used to end up when starting C programming.  I guess the inner case/while are required for the state machine and the outer while is required for the Producer / Consumer.  I always find myself thinking in terms of "if/then" statements and the case/comparison took the place of that. 
    Regardless, problem solved.  If anyone has tips on how to make it (attached) look better, please post them!
    Lynn, I wasn't quite sure about your instructions on passing the exit and stop commands through the queue.  I went with the idea of keeping the long-running loop separate.  I know I still have a bit more to work out such as use of exit button while state machine is running, and the stop button only works in between state machine iterations.
    Message Edited by davey31415 on 11-27-2006 07:04 PM
    Attachments:
    PowerfoldMeasStat.vi ‏158 KB

Maybe you are looking for

  • Creation of item from High Volumn Repair of Depot Repair(Custom Region)

    hi, Take the first job for the current repair order Query: Select WIP_ENTITY_ID from CSD_REPAIR_JOB_XREF Where REPAIR_LINE_ID = < Current repair line_id> Order By CREATION_DATE Asc Take the entered component part number and search in the WIP job mate

  • Nokia PC Suite

    Can anyone remember which version of the Data Suite actually saved your sent texts via the Messaging suite? Problem: Nokia 3110 Classic connects to the PC Suite and seds texts via the Message Centre but the sent messages are not being saved. Help is

  • Event Structure Question

    Hopefully I can explain this okay.... I'm using an event structure to control several features in my program and all have worked great.  All of the events in my program are handled via boolean buttons with value changed option.  I have a numeric cont

  • Language Installation of Sri lanka language Sinhalese, Sinhala

    Dear Gurus, We have requirement to perform Language installation for below three languages. 1) Bahasa , Indonesia 2) Sinhalese, Sri Lanka 3) Vietnamese, Viet Nam I am able to find separate Language CD for "Vietnamese" but i am unable to find CDs for

  • Where can I download JDK 1.1.8?

    Guys, do you know anywhere on sun's website where the 1.1.8 JDK can be found? It appears to have disappeared from http://java.sun.com/products/archive/ (Note: I need the JDK and NOT the JRE, since I need to verify that some code compiles and the jre