Use state machine to fill cluster

Hi,
I am trying to create a state machine that runs two states, each state has two elements going to a Bundle function and into the cluster. I want the two elements from the first state to go through, then the second state should run and pass the final two elements. Currently I am only getting the data from the final state. I have an the vi attached.
Thanks,
Chris
Solved!
Go to Solution.
Attachments:
cluster state machine.vi ‏9 KB

You don't actually have a state machine.  What you have is a basic loop, and nothing about what happens in earlier iterations of the loop gets passed to later iterations.
You need to build the cluster within the loop itself and maintatin it in a shift register.  Use bundle by name to update the respective elements of the cluster in each frame of the case structure.
Attachments:
cluster%20state%20machine[1]_BD.png ‏16 KB

Similar Messages

  • Create Multiple tasks for Single Item in List using state machine workflow in sharepoint

    Hi,
    I want to create multiple create tasks for Single Item in List based on Assigned to column using state machine Workflow through visual studio
    Here Assigned to column allows multiple users. so i have to create task for every user based on column .
    I'm trying for this but i didn't got any solution
    Please provide solution for this.

    Hi,
    According to your post, my understanding is that you wanted to allow multiple users to approve.
    There are some articles about creating parallel tasks in state machine workflow, you can have a look at them.
    http://www.codeproject.com/Articles/477849/Create-Parallel-Task-in-State-Machine-Workflow-in
    http://msdn.microsoft.com/en-us/library/office/hh128697(v=office.14).aspx
    http://social.technet.microsoft.com/Forums/office/en-US/b16ee858-4360-479a-a686-4ee35b7be9db/sharepoint-2010-workflow-creating-multiple-tasks?forum=sharepointdevelopmentprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Recipe Management Using State Machines and DAQ Assistants

    I am writing LabVIEW code to control a conversion process for up to 4 devices on one apparatus.
    The operator will select from these 4 devices which ones will go through a conversion process. Therefore - they can select some or all of the devices to go through the process.  The process is the same for all 4 devices. The difference between the 4 are the digital outputs used for the conversion process.
    Clearly a state machine is applicable. However, I would like to "reuse" the process conversion code of the state machine by creating a separate recipe for each device and merely change the digital outputs (their physical location) for the device under conversion. Presently I have DAQ Assistants controlling digital ouputs for the conversion of one device. Is it possible to "reuse" the code by creating a recipe or a lookup table to reassign the DAQ Assistants to their proper physical location (the digital output lines) for the device under conversion?
    I could - copy and paste the code, go into the process and reassign every DAQ Assistant to the correct physical channel of each digital output for the other 3 devices. I was curious if there was a more efficient way.
    I see documentation online for recipes; however they are dated 2006. I thought there may be some updated examples.
    Using:
    LabVIEW 2011
    cDAQ-9188 chassis

    Hi MgDAQ,
    DAQ Assistant is a quick way to start acquiring data, however it's not the most efficient.
    Everything that DAQ Assistant does can be acompished with basic DAQ functions on the
    Measurement I/O -> NI-DAQmx pallete. For example, you can use DAQmx-Create Channel.vi and
    a Channel Constant to select the channel from which you want to acquire data.
    To get started with using the DAQmx functions you can browse through Hardware I/O examples in the Example Finder.
    Open up a new LabVIEW VI and then go to Help -> Find Examples -> Hardware Input and Output [folder] -> DAQmx -> Digital Measurements
    Now, as you probably know, copying and pasting code is inefficient and it's not a good programming practice. So what I would do is create the code for your conversion process and then simply change the channel constant to read the digital output you need.
    Mikhail
    RF Toolkits, Product Support Engineer
    National Instruments

  • How to use elapsed time function with state machine in Lab VIEW

    Hello
    I've been trying to use state machine with elapsed time function in order to sequentially start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I've attached the code, the problem is when I place the elapsed time function out of the while loop it doesn't work, on the other hand when I place it inside the loop it does work but it doesn't give the true  signal to move to the next state. 
    Could you please have a look to my code and help me to solve this issue.
    Regards 
    Rajab
    Solved!
    Go to Solution.
    Attachments:
    daq assistance thermocouple(sate machine raj).vi ‏436 KB

    Rajab84 wrote:
    Thanks apok for your help
    even with pressing start it keeps running on wait case 
    could you please explain the code for me, the use of Boolean crossing, increment , and equal functions 
    Best Regards 
    Rajab 
    OK..I modded the example to stop after 2 cycles. Also recommend taking the free online LabVIEW tutorials.
    run vi. case statement goes to "initialize", shift registers are initialized to their constants. goto "wait"
    "start"= false, stay in current state. If true, transition to "1 min" case
    reset elapsed timer with True from shift register(counter starts at zero)."time has elapsed"=false, stay in current state(1 min). If true, goto "5min" case
    reset elapsed timer with True from shift register of previous case(counter starts at zero)."time has elapsed"=false, stay in current state(5 min). If true, goto "1min" case. Also, bool crossing is looking for "true-false" from "5 min" compare function to add cycle count.
    Once cycle count reaches 2, stop while loop.... 
    Attachments:
    Untitled%202[1].vi ‏42 KB

  • Handling menu selection in multi states of states machine

    Hi everyone,
    My application uses states machine architecture, I have to handle menu selection in two different states and the 2nd of them has to be handled by the event case structure.
    The problem is that when I use event structure in the 1st state it is also handled later by the event case in the 2nd state and it is impossible to handle menu selection in the 1st state by the "Get Menu Selection" block because according to it's descripton if event structure is configured to handle the same menu as item as this block, LabVIEW ignores this function.
    I would be greatful for any clue.
    Greetings,
    Mariusz
    Solved!
    Go to Solution.

    Thanks for respond.
    Here's a code explaining the main idea.
    Attachments:
    Untitled 1.vi ‏9 KB
    Enum_States.ctl ‏5 KB

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

  • State Machine and producer consumer design patterns

    Hi!
    In my application I am using state machine(for top level VI) and producer consumer(for subVIs) design patterns throught out.
    If there is no activity on the front panel for 1min then the ideal state is invoked. Following are the situation of the ideal state:
    1. It checks for any hardware present on the network . If no hardware is found on the network within 1 min then the application and LabVIEW exits.
    2. While the ideal state checks for the hardware, and user clicks on any front panel button then it should exit the ideal state. The control
    should be in the respective button state.
    I am able to achive the point#1 mentioned above but could not get the point #2 to work. I am including the snap shot of
    the state machine(default case) and prouducer consumer(deafualt state).
    Each screen has the concept of the ideal state. The only additional step in the subVIs is that when the ideal state is reached and the time has expired then it will close the subVIfront panel.It will go to the exit state of the Main(top level) VI. Thus closing the application and quitting LabVIEW.
    Any ideas or suggestions. Will multithreading and notifiers help?
    TIA
    Rachana
    Attachments:
    Sanpshot_Of_Design.zip ‏75 KB

    Hi Rachana,
    I was thinking about using event structures wherein there would an event case that would handle any value change event for any of the buttons on the front panel. But before suggesting that, I would need to know more about the Ideal State subvi( more specifically, how is it checking for any hardware present on the network and where is the one minute wait coming from?).
    Please feel free to respond to this post with your questions/comments.
    Regards,
    Ankita A.

  • Replacing a state machine?

    I am fairly new to using state machines and am hoping there is a simple solution to this question. I have one state machine that is saved (ie StateMachine1.ctl). I created a new state machine (StateMachine2.ctl) and want to replace all instances of StateMachine1 with StateMachine2 in my VI. Is there a simple way of changing the state machine without losing all the linked instances?
    Thanks.
    LWolfe.
    Solved!
    Go to Solution.

    LWolfe wrote:
    I am fairly new to using state machines and am hoping there is a simple solution to this question. I have one state machine that is saved (ie StateMachine1.ctl). I created a new state machine (StateMachine2.ctl) and want to replace all instances of StateMachine1 with StateMachine2 in my VI. Is there a simple way of changing the state machine without losing all the linked instances?
    Thanks.
    LWolfe.
    Let's make sure we are using the correct terminolgy here.  It seems that what you are calling a "state machine" is really a custom control, probably typedef'd and because it was typedef'd, probably an enum.  I like to make mistakes like that, mistakenly calling something by the name of something else very closely associated with it. 
    So is your question really, "How do I replace one custom control with another?"
    In this case, it might be just easier to modify your first control and forget about using the second.  Assuming again that it is a typedef'd enum control, modifying the typedef'd enum that is already part of your state machine will ensure that the changes are propagated to all the other places.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • 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

  • Nested State machine - Loops continuous​ly

    Hello ,
    I implemented a program for first time using state machines and Enum (type def). 
    I have 2 state machines (nested) 
    I am not sure if the data flow between the Main state machine and the Sub state machine is correct. The program loops continuously ( this is a MOTOR PROGRAM) and I see that the motor keeps working continuously. It is supposed to run the mentioned Number of Steps once and then stop.
    Please have a look at my code and tell me where I could have gone wrong. 
    Thank you.
    Abhilash S Nair
    Research Assistant @ Photonic Devices and Systems lab
    [ LabView professional Development System - Version 11.0 - 32-bit ]
    LabView Gear:
    1. NI PXI-7951R & NI 5761
    2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021
    OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
    CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
    MEMORY - [ 16.0 GB RAM ]
    GPU - [ NVIDIA GeForce GT 530 ]
    Attachments:
    Motor-UNI_Directiona Dev 1.vi ‏49 KB
    Control 1.ctl ‏6 KB
    Control 2.ctl ‏6 KB

    Figured out ! Thank you. One of the ENUM was not defined to the correct state.
    Thank you. 
    Abhilash S Nair
    Research Assistant @ Photonic Devices and Systems lab
    [ LabView professional Development System - Version 11.0 - 32-bit ]
    LabView Gear:
    1. NI PXI-7951R & NI 5761
    2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021
    OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
    CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
    MEMORY - [ 16.0 GB RAM ]
    GPU - [ NVIDIA GeForce GT 530 ]

  • State Machine Cases revert to numbers

    I have implemented a case machine using a type def enum to select the cases. The enum is a set of strings identifying each state. Initially the string for each state is listed in the case.
    There is something that I occasionally do when modifying the enum which causes the case statement to display the index of the enum string. I am not able to revert back to the string display without completely rebuilding the case statement and cut and pasting my code from the old to new case statement.
    I haven't been able to determine how I cause this to happen. What is it that I do to make this happen, so I can stop causing it to change? How to I make the case statement display the string state names again?

    Brian,
    I am using state machines a lot, and have found this as well.
    There is a very good reason for it, and that is somewhat equivalent to coersion.
    The easy thing to do is: (this is what I do, now)
    Whenever you change the enum either by adding an item, changing the string representation of
    an item, or removing an item, (and maybe disable an item) you want to copy that enum first
    and make the change on the copy.
    Then copy the changed enum to a place beside each existing instance of the enum, eg the assignment of the
    enum to the shift register in each state. I also copy the string of the state name to someplace I can
    easily see it, usually just below the case identifier.
    (I usually go through all states at least twice if it is a fairly complex state machine)
    I then wire the new enum to the initial input of the shift register an delete the old enum.
    (At this point the case "names" become numbers .. the numeric index of the names in the original enum)
    Then I go through each state and change the wire from the old enum to the new one and delete the old one.
    When you get the last one changed, you will see the case identifier change back to the "names".
    Then go through all the states and check that the state names are correct. (that's why I copy the names)
    Then you can create your new case.
    This sounds like a lot of work, but doing this methodically saves headaches!
    Of course the alternative would be to design your state machine before implementing it.
    And never change it! Hah!!
    Dave Karon
    "Brian Wells" wrote in message news:[email protected]...
    > I have implemented a case machine using a type def enum to select the
    > cases. The enum is a set of strings identifying each state.
    > Initially the string for each state is listed in the case.
    > There is something that I occasionally do when modifying the enum
    > which causes the case statement to display the index of the enum
    > string. I am not able to revert back to the string display without
    > completely rebuilding the case statement and cut and pasting my code
    > from the old to new case statement.
    > I haven't been able to determine how I cause this to happen. What is
    > it that I do to make this happen, so I can stop causing it to change?
    > How to I make the case statement display the string state names again?

  • 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

  • Given up on State MAchines please help...

    hello everyone,
                         I have given up on state machine.. and trying to compile this simple program...
    I am unable to compile this code, and seriously at my wits end how to debug this code.. can anyone please suggest me what is wrong/???
    Now on LabVIEW 10.0 on Win7
    Attachments:
    Drill_Rig_v001.vi ‏152 KB

    Ray.R ... I am sorry... I had initially decided to perform this task using state machine... But then I quit...
    And hence, I thought of using simple case structures...
    This is what I want actually...
    I would like to create a VI in which the start condition is a cylinder at position A. Once the position is confirmed, there is a motor which should be turned ON via LV.
    Once the motor is ON, the cylinder should go to position B, once the cylinder is at position B, a counter should start... The cylinder has an attachment in the front which does a particular task
    and once the task is finished, the cylinder should go back to position A and the system should shut off...
    And in that process, I am totally confused and don't know what to do...
    http://forums.ni.com/t5/LabVIEW/how-to-have-a-while-loop-inside-a-case-structure/td-p/1241346/page/2
    this is the forum where I had been discussing about SM.... also posted my VI ter.. but posting it again here...
    Now on LabVIEW 10.0 on Win7
    Attachments:
    Soda Vending MAchine.vi ‏211 KB

  • Any penalty to using one big cluster in a state machine?

    I've been working on a lot of small/medium sized state machines lately, and I've gotten into a habit of putting most of my data (single values, arrays, strings, even LVOOP objects) in one cluster that I pass from state to state with a shift register.  I just unbundle the data I need in each state, work on it, and bundle it back in for the next state.  Part of me says that this is a bad idea - that I should separate the big cluster into a set of smaller clusters that group the data by logical categories.  Another part of me says that if I do it that way, I'm just creating needless clutter on my diagram.
    So my question is simply this - is there any significant performance penalty for using a single cluster rather than multiple clusters in this fashion?  I never run the whole cluster into subVIs, and I never split the main cluster wire, so it doesn't seem like there should be... but I've been wrong before!
    Thanks,
    Jason

    As Norbert mentioned, the answer to your Q is dependant on your data structure. Provided you can do all of your data manipulation "in-place" there should not be any issues. The more complex structures can still be handled "in-place" but you may have to use the in-place operations to achieve this effect. Depending how comfortable you are with those operators, they can complicate the appearence of our code.
    If you can'y do everything "in-plcae" and you have a Super-Cluster, then its time for me to Quote Rolf again when he wrote "Once all of you physical memory is filled up with a single cluster, your application is probably going to suck."
    So lest say you have cleared all of the above hurdles and still want to use a single SR that has all data for all states. I ask you to carefull examine where the app may go in the future and what type of animal it could turn into. if there is even a small chance that app may turn into something that non-computer users will use (requires robust app to prtect itself from dumb users) the single cluster approach is going to get in your way when the app gets big.
    1) If you have to add another field to the cluster, every function that uses that cluster should be re-tested. WE have an app in-house that was developed by our customer and we support. There is an 800+ step proceedure required to re-verify the app!
    2) AS more functionality is added you will add more states to your state machine. Personally, I cringe when I see the support developer have to choose from a list of 300 states when working with the Stae machine.
    3) You will have a hard time re-using code aside from cutting-n-pasting
    4) When you unbundle manipulate and replace, you are in danger of creating duplicate data which will impact performance.
    I never went through the formal IS training but my wife did and she has given me the short version to learn how to normalize a DB. There is actually a science to the process that results in only related items being grouped together and if you take to the full exdtreme of "fully Normalized DB", there absolutely no duplicates of data. For LV apps a Fully Normalized DB adds some overhead so I don't go that far.
    THe following will ignore using an Object Oriented approach and stick with old-school ideas.
    So after I analyze my data structures and group related items together and review who touches what when, THEN I try to wrap-up the data in Action Engines. More often than not, the action will replace some or most of the work done in some states. From your Q it sounds like your "read-mod-replace" constructs can be moved into AEs with little effort.
    Now for OOP
    I'm still learning OO system design but I have found myself "turning my apps inside out" with LVOOP. By this I mean rather than think that the data AND the function are inside the AE, the data is outside and acted on by what is inside the LVOOP methods. I have been amazed at the degree to which LVOOP can operate in-place, but I digress. There is some arguement/design pattern that says that if you have a function like a test that uses other classes, then you can create a class for the test and slam all of the required object into you need.
    Done rambling for now. As usual, if there is anyone out there that want to correct me any of the above, please do so!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How can I keep a state machine readable when using large amounts of in/outputs

    Hello, I am new to Labview,
    Read trough the fundamentals and the
    getting started and a lot of examples.
    What I want to do is use a standard
    state machine from the template, and add some stages, for example
    orange, apple, banana. At this point I can use numeric controls to
    put in the amount of oranges, apples, bananas there are. I can even
    use a led to tell the user which state of the state-machine is
    active.
    The thing is there will be more numeric
    controls and more leds and it would be nice if the code would still
    be readable when there are 20 inputs and 20 outputs.
    Questions
    (1) It would be nice if I could use the
    typedef to select the right state AND the corresponding numeric
    controls and leds out of a cluster or an array kind of structure to
    keep the number of wires low. Is this possible, how can I do this?
    (2) I tried to put the numeric controls
    into a cluster but that way I can't put the numeric control for the
    apples in the upper right corner and the numeric control for the
    oranges in the lower left down corner of the front panel.
    (3) An example would be really nice, I
    know that I saw some examples describing this problem but there are
    so many examples that after a few hours of searching I haven't found
    the right one yet.
    Thanks in advance for the effort.
    p.s. I will not use Labview to do
    calculations on fruit, I am only using this to make the question
    easier to understand.

    I can only start a proper answer but I might as well start with that.
    When I am developing State Machines I have to think about what data is used and manipulated in each state. I then have to think about where am i going to keep and manage the data. I list all of the fields that are "touched" in each state and what values are used together and which are independent form the others. After this phase of the analysis, I usually have some data structure defined (cluser array etc).
    Then I flipp from thinking about the state to thinking about the data (after all this is LabVIEW and the data-flow paradigm is critical). If I see data that is only used by the State machine and is used in many of the states, then the data structure get put in a shift-register for easy access in each state. This maybe enough of an answer for your fruity question.
    When i see data that is shared or only used in a handful of states then I concider putting the data in an Action Engine. Depending on how you design your AE, you can access each of the fruit totoal by name or increment etc as required.
    If your app demands many fileds that are all related (can't be broken into distinct data structures) then create a cluster that has all of your values that are used by the AE. Then create an Wrapper VI for each call of the AE but only put the associated fields on the FP of the wrapper and then bundle that value into the cluster and invoke the AE.
    Ben
    PS: Sorry about reverting to neBulus mode but this topic could take days to cover in detail.
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • SPD Workflow - Update a hidden/read only field

    Hi there, I have a list with a hidden/read only field (ie Status).  So the user cannot update this field using the form or datasheet ...etc. I have an SPD workflow that I was hoping would modify the value of the Status field.  But it appears as thoug

  • 3rd gen iPod touch. I just get a blank screen (after a few secs of the apple symbol) when it is switched on or when connected for charging. I know the connections are OK. Suggestions/help please

    3rd gen iPod touch. I just get a blank screen (after a few secs of the apple symbol) when it is switched on or when connected for charging. I know the connections are OK. Suggestions/help please

  • PS Authorization check

    Hello. We are trying to use the enhancement CNEX0002 to check the authorizations in PS. It works very well in transaction CJ20N, but we are having problems in transactions CN21 and CN22. The main problem is that in both transactions, the exit is not

  • Encore Trouble

    Hello all! I'm having some trouble with Adobe Encore cs6 currently. I've seen this problem posted around the forums, but not answered in the way I'm currently experiencing it.  Anyway, I've just recently finished editing an HD (1920x1080) project usi

  • Command Line SQR

    When running a PeopleSoft process from the process scheduler, you can find the process id and the process status at the process monitor. If you run an sqr from the command line (work bench), it does not show up in the process monitor. How do you find