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.

Similar Messages

  • 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 implement state machine architecture

    Earlier in this forum, i had taken help in improving the subparts of my main vi, now i had developed a main vi,it is working correctly without any error, but i had used sequence architecture in that and as everyone says we should use state machine instead of sequence architecture, i am posting my vi please help how to implement state machine architecture in this, and actually in my vi, i am having 5 tabs( presently i have developed only 2 tabs) 1. patient info, 2.naadi acquisition, 3.nostril temp., 4.vision acquisition, 5.other info. presently with tab control i am using case structure so that only only particular page runs at particular time, i want to know how can i improve this code to work more efficiently.
    Attachments:
    intelligent diagnostic bench.lvproj ‏68 KB

    i am sorry, i thought that vi's are by default attched with project files,i am attaching the main vi and all other associated subvi's also. 
    Attachments:
    Final Diagnostic Project.vi ‏375 KB
    createfolder(SubVI).vi ‏65 KB
    checkstring(SubVI).vi ‏11 KB

  • How to start and stop video acquisitio​n in a state machine

    hello,
    I'm a neuroscience student and here's what I'm trying to do: 1) trigger a GigE camera (200fps), 2) start video acquisition, 3) trigger a light that will stay on for x miliseconds, 4) trigger a valve that will blow an air puff, 5) stop the tone and the valve simultaneously and 5) stop the video acquisition 1second after 4). For that, my VI is a state machine, with a state for each trigger (ex, 1 state for trigger camera, 1 state for trigger light, ect) plus a state to "stop" and a state "time to wait". Everything was working except the video acquisition - the program would trigger the camera but only acquire one frame, because it wasn't running in a while loop and this is my first question: for a video acquisition is it always necessary to have a while loop?
    I assumed the answer was yes, so I built a "consumer" loop for the camera. Putting a queue in the state "trigger camera" in the producer loop, I was then able to start the video acquisition but now the problem is to stop it in the right time. I have another queue in the "stop" state in the producer loop, but it isn't able to start the "stop" state in the consumer loop, I think that may be because the consumer loop gets "stuck" in the while loop.
    I hope you can help me, the VI is attached. Thanks!
    Solved!
    Go to Solution.
    Attachments:
    trigger_cam.jpg ‏345 KB
    trigger_stop.jpg ‏354 KB
    Conditioning MS vi 2010.zip ‏68 KB

    Hi Gak,
    Thanks for the suggestions. I still didn't got it to work though. I moved the stop command to inside the while loop like you said but it didn't work. The problem seems to be in the communication between the producer/consumer loops. When I run the VI in highlight, the queue message "trigger camera" leaves the producer and arrives at the consumer loop in the appropriate time, starting the "trigger camera" state of the case structure. However, the message "stop" doesn't seem to be sent by the producer loop, so the consumer doesn't receive a signal to start the "stop" state of the case structure. Can you think of anything I should change in the producer loop so that the second state (stop) is added to the queue?
    About the functional global, I read about it, it seems that either that or a local variable could work, but I don't quite know how to implement it in my state machine, since the stop of the first while loop isn't activated in the "stop" state but in the "shutdown" state. It works more or less like this: after 10 loops of triggering and stopping the camera, light and valve (so after acquiring 10 movies), it goes for shutdown. Can you show me what you had in mind with the functional variable?
    Attachments:
    Untitled.jpg ‏286 KB

  • How to REpublish Custom Task Forms (InfoPath) to SharePoint 2010 State Machine Workflows

    I am new to SharePoint. Sorry if answer to my question is obvious.
    I've create Custom Task Form in InfoPath and publish it (File/Publish/Network Location [Form Template Path and filename='MYPROJECT/Forms/ApprovalForm.xsn'; Form template name='ApprovalForm'], in the next window I've cleared Public URL according to the articlehttp://www.codeproject.com/Articles/195348/SharePoint-2010-State-Machine-Workflows-with-Custo).
    After it I've added module Forms, and added ApprovalForm.xsn from the existing items.
    My xml files: Elements.xml
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Workflow
    Name="Order New Server"
    Description="My SharePoint Workflow"
    Id="482cbc86-b717-4981-a49a-3cf4c89e9399"
    CodeBesideClass="Myproj.OrderNewServer.OrderNewServer"
    CodeBesideAssembly="$assemblyname$"
    TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160">
    <Categories/>
    <AssociationData><Data></Data></AssociationData>
    <MetaData>
    <AssociationCategories>List</AssociationCategories>
    <Task2_FormURN>urn:schemas-microsoft-com:office:infopath:ApprovalForm:-myXSD-2012-03-09T14-11-55</Task2_FormURN>
    <StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
    </MetaData>
    </Workflow>
    </Elements>
    Feature.Template.xml:
    <?xml version="1.0" encoding="utf-8" ?>
    <Feature xmlns="http://schemas.microsoft.com/sharepoint/" ReceiverAssembly="Microsoft.Office.Workflow.Feature, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Receiverlass="Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver">
    <Properties>
    <Property Key="GloballyAvailable" Value="true" />
    <Property Key="RegisterForms" Value="Forms\*.xsn"/>
    </Properties>
    </Feature>
    My form work fine, but when I make changes and republish it, it doesn't update (I see old form). What I tryed:
    IISReset
    Clear all cookies and cache in IE
    Retract solution, restart VS2010, reboot computer.
    Change assembly number, guid.
    I have no ideas, what can I try for republish my form with changes.
    Thank you in advance for any suggestions.
    PS: sorry for my writing. English is not my native language.
    PPS: when I save new Form to new location and add it to the project, it works.

    I've found how can I republish changes. But it seems more like crutch than solution, but it works:
    After republishing InfoPath form, I delete file from project (DEL on ApprovalForm.xsn in Solution explorer) and after it add it again. (Add/Existing Item). And then redeploy! Hurray!
    Is there any way to redeploy a Task Form directly on the server without importing it in Visual Studio again? I am using some data connections in my task form which are different for different environments (staging, dev. etc.). Seems like I've to create a separate
    Workflow WSP file for each envrionment. Any comments?

  • How to run a particular test from a set of CodedUI tests?

    Hi,
    I have designed custom framework from which we can decide which test case needs to be run or not. When I mark a test case as Yes (which means this testcase needs to be execute), how can i execute only those test case alone from Visual Studio?
    Here, I have created the test scripts for all the above test cases in a single CodedUI test file and i need to execute the TC_0003 as i marked the Run as Yes only for TC_003 in the framework. Can you please help me to do the same?
    Thanks  in Advance
    Selvaraj C
    Selvaraj

    Hi Selvaraj,
    >> I have designed custom framework from which we can decide which test case needs to be run or not. When I mark a test case as Yes (which means this testcase needs to be execute), how can i execute only those test case alone from Visual Studio?
    Do you mean you want to execute the special test? As far as I know, Ruby provides a framework in its standard library for setting up, organizing, and running test called Test::Unit. Test::Unit provides the function that running single tests. The link below
    shows the details:
    # Ruby Programming/Unit testing
    http://en.wikibooks.org/wiki/Ruby_Programming/Unit_testing
    I am not sure what do you mean by “custom framework”, do you want to design custom framework? In my option, it seems to be much complex. The steps below might be useful to you:
    1. Store the tests in a csv file, and query the test which need to execute from the csv file, for this, you could turn to the link:
    https://social.msdn.microsoft.com/Forums/en-US/9664862a-4302-4754-a915-2beceff364d5/how-to-stop-sequential-execution-of-data-driven-method-in-coded-ui
    2. Get the test name, and execute the test from the command-line. The link below shows the details about the command-line:
    # MSTest.exe Command-Line Options
    https://msdn.microsoft.com/en-us/library/ms182489(VS.100).aspx
    3. Write a script to run the command-line
    If I misunderstood you, please feel free to let me know.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Need help - how to run this particular method in the main method?

    Hi all,
    I have a problem with methods that involves objects such as:
    public static Animal get(String choice) { ... } How do we return the "Animal" type object? I understand codes that return an int or a String but when it comes to objects, I'm totally lost.
    For example this code:
    import java.util.Scanner;
    interface Animal {
        void soundOff();
    class Elephant implements Animal {
        public void soundOff() {
            System.out.println("Trumpet");
    class Lion implements Animal {
        public void soundOff() {
            System.out.println("Roar");
    class TestAnimal {
        public static void main(String[] args) {
            TestAnimal ta = new TestAnimal();
            ta.get(); // error
            // doing Animal a = new Animal() is horrible... :(                   
        public static Animal get(String choice) {
            Scanner myScanner = new Scanner(System.in);
            choice = myScanner.nextLine();
            if (choice.equalsIgnoreCase("meat eater")) {
                return new Lion();
            } else {
                return new Elephant();
    }Out of desperation, I tried "Animal a = new Animal() ", and it was disastrous because an interface cannot be instantiated. :-S And I have no idea what else to put in my main method to get the code running. Need some help please.
    Thank you.

    Hi paulcw,
    Thank you. I've modified my code but it still doesn't print "roar" or "trumpet". When it returns a Lion or an Elephant, wouldn't the soundOff() method get printed too?
    refactored:
    import java.util.Scanner;
    interface Animal {
        void soundOff();
    class Elephant implements Animal {
        public void soundOff() {
            System.out.println("Trumpet");
    class Lion implements Animal {
        public void soundOff() {
            System.out.println("Roar");
    class TestAnimal {
        public static void main(String[] args) {
            Animal a = get();
        public static Animal get() {
            Scanner myScanner = new Scanner(System.in);
            System.out.println("Meat eater or not?");
            String choice = myScanner.nextLine();
            if (choice.equalsIgnoreCase("meat eater")) {
                return new Lion();
            } else {
                return new Elephant();
    }The soundOff() method should override the soundOff(); method in the interface, right? So I'm thinking, it should print either "roar" or "trumpet" but it doesn't. hmm..

  • How to run a numeric case structure

    How can i control the numeric case structure using prompt user as my numeric input?
    Message Edited by unknown\ on 07-12-2005 10:25 AM
    Attachments:
    Case Structure.vi ‏478 KB

    Maybe you want something like in the attached code sketch?
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Case_StructureMOD.vi ‏79 KB

  • How to run a particular transaction called

    I want to run this transaction to post a closed period's material stock into PCA. I am using origin object 19 (for material stock).  Would really like to know from where I can get the material document numbers to key into this t-code. Any help would be appreicated
    Edited by: Rajesh Manohar on May 7, 2010 5:26 PM

    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.

  • How to run a particular JRE at run time

    Hi All,
    I have two different versions of Java installed in my system (JDK 1.5 & JDK 1.6). The path in environment variables is setted to jdk1.5. But after installation of jdk1.6 it is showing as jdk1.6. I want to test my code for these two different versions of java.
    Can anyone please help me how to set the java version at runtime to different JRE's.
    Thanks in Advance

    Explicitly call the absolute path of the JRE you want to use. Eg, instead of just using
    java MyClassuse
    C:\Program Files\Java\jre1.6\bin\java MyClass

  • How to run a particular file in aparticular program

    hi
    i m developing a desktop application in which i need to open another program like notepad which i can do by calling the exec function
    but i need to open a special file in the notepad directly when it starts
    is there any way to do so
    thanks

    Runtime.getRuntime().exec("notepad myfile");

  • How to run java application without having java environment in  a machine

    can i run java application without having java environment(JVM) in a machine.I mean i dont have installed j2se or jdk in my machine.And i have an j2ee application running on another host which is built in swings.I want to access that application in my machine
    can any one help regarding my problem

    If you only need to access the program from one machine and you are running a Unix-like operating system (e.g., Linux, Solaris), you can use the remote display capabilities of X11. In this case you have to choose the host where the app will be displayed when you start it:
    $ DISPLAY=<hostname>:0.0
    $ export DISPLAY
    $ java ...
    If you want to be able to display it on both machines at the same time, or if you are using windows, then try something like VNC (http;//www.realvnc.com). Or if you are running windows and your version supports it, you can use windows remote desktop.

  • How to run a .DLL(created in VB & VC++) in client machine through Java?

    Hi Guys,
    When i run the .DLL in the server machine through servlets, it opens a
    login screen created by .DLL.But I want to run the same .DLL (which inturn
    opens login screen) in the client machine in the distributed architecture.Let
    me know if u guys are having any suggestions at the earliest.
    Thanks in advance ,
    Venkat.

    Catch up some information on JNI, read the tutorial on
    http://java.sun.com/docs/books/tutorial/native1.1/concepts/index.html
    Very straight forward, you could make a decision and be on your way to achieve it within about an hour.
    Cheers and have a great year.

  • How to run a vi by referencing in event structure

    Hi
    I searched for an example in Event structure. I just modified that but i am getting error(error code :1 )message when i run the program.
    could anyone give suggestions why is it so.
    I have attached the example program and my modified program
    Thanks
    Attachments:
    Untitled 10.vi ‏18 KB
    Main Launcher.llb ‏65 KB
    A.vi ‏9 KB

    [Edit: Sorry just a minute late. Even not able to remove the attachments. Its throwing some exception error.]
    Sorry, your request failed. A notification has been sent to the development team to investigate.
    Exception ID: 3A98D61C
    Please click the Back button on your browser.
    Message Edited by mathan on 06-27-2008 06:34 AM
    Message Edited by mathan on 06-27-2008 06:38 AM
    Attachments:
    Untitled 10.zip ‏19 KB
    Main Launcher1.llb ‏30 KB

  • How can I establish an enum typedef for use with state machines and action engines?

    Hey all--
    I have an action engine with several instances.  Any time that I add a method to the engine, I have to modify all of the calling code to update the constant that determines the method being called.  There must be a smarter way to address this problem but my LV experience is insufficient to identify it.  Can any of you wiz-bangs tell me if it is possible to make a type def (I can do this) and use it with each instance of the action engine call so that changing any instance also updates the typedef?
    Thanks.

    Take your enumerator.  If it is not a control (ie constant), change it to a control.
    Under File Menu, select New > Custom Control.
    Move (or copy) your Enum Control to the Custom Control.  Change the Control to Strict Type Def (the selection to the right of the wrench).  Save it.
    (EDIT: ** OOps, the picture shows the wrong one.. sorry**)
    Copy that new Strict Type Def control to your code.
    See images below.
    OR.. If you're using LV8.x, and using a project, I would recomment that you do it from within your project explorer.  Simply insert a new "Control".  The rest of the steps are similar, except that you can insert it from your project. 
    R
    Message Edited by JoeLabView on 07-08-2008 06:47 PM
    Attachments:
    TypeDef.PNG ‏33 KB

Maybe you are looking for

  • CS5 Design Premium Installation Adobe Bridge problem

    When I try and install CS5 Design Premium it fails because it wants me to close Adobe Bridge (which is not open) and won't let me go any further. I tried uninstalling CS3 but it won't let me because it wants me to close Adobe Bridge. What Now?

  • Creating JScrollPane with vertical scroll only...

    Anyone got any idea how to use a JScrollPane to perform vertical scrolling only? The components should be stacked vertically, as wide as the scrollpane and as high as they need to be. Is it only possible by adding a ComponentListener to the JScrollPa

  • Can't import photos from Iphone to PC

    I was using Icloud until yesterday...suddenly the pics from the Iphone (photo streamer album) stopped to import to the PC (my picture)

  • Editing (Proofing) PDFs

    How do I mark edits that show deletions and additions during proofing, so that the original author can approve or reject changes?

  • Where to set extended XML handling in WESOUT while sending XML

    Hello Experts, Requirement : Add a Z field to a standard message type so that it can be sent to another system while XML . Transaction cod e: WESOUT is used for that. But as per the link : http://help.sap.com/saphelp_nw04/helpdata/en/73/3f5c3c3906b00