parallel state machine

I'm building a vi that must operate a unit with two identical columns. Each column traverse cycle where the gas is loaded, heated, then served. The two cylinders are made the same pumps and what controls. I was wondering if I could create two state machines, one for each column and then use a functional variable for the communication between the two? parallel state machines do work ok?

Yes, only two independent loops, one for each column. You can use a third loop to the interaction of the user.

Tags: NI Software

Similar Questions

  • 2 parallel state machine

    I have 1 state machine controls a number of sensors of pressure and balances.

    The transducers of pressure and the balance is used to analyze soil samples

    I need an another State machine of the exact type as well as others. The only difference is that the new machine of the State must control another set of sensors of pressure and balances.

    2 state machines must run parallel, then I'll be able to analyze soil samples 2 at the same time.
    The State machines need not run at the same speed. It's alright that the computer of a State is ahead of the other.

    Is there a clever way in LabVIEW to get over this, or do I just copy the first state machine and change the id for sensors of pressure and balances?

    Reentrancy is the key here.  I recommend using prealloue reentrancy Clone for reasons of speed and memory management.  If you made an a high level VI which simply calls this State twice, machine in parallel.  Pass the ID to the state machine and you have two running.

  • Closure of a state machine in queue event with several parallel loops

    I am trying to find the best way to stop a program that consists of an architecture of State machine in line waiting for event with several parallel loops. Can anyone recommend the best way to achieve this in my attached VI? (To browse the forum, this seems to be a frequently asked question, but I have not found a solution that works for me.)

    I look forward to any comments on my as well code, if someone is willing to offer it.

    My program needs:

    If the user press the 'Stop' button, the program should prompt the user with "are you sure you want to stop the program?" and then return to a State of rest or move forward to stop the program. In addition if there is an error, the program should prompt the user to ' clear the error and continue, or stop the program. Then back to the idle state or move forward to stop the program.

    Architectural details:

    The program consists of 3 parallel loops: (1) a loop of event management that places different States of a queue of the State, (2) a State Machine that enters the State that is removed from the queue of the State and (3) a loop error/Shutdown, which deals with errors in the error queue management.

    During normal shutdown, where running handling loop in the case of event 'Program.Shutdown' and 'Shutdown' and the 'Idle' States are added to the queue of the State. In the state machine, the State of 'Stop' is invoked. Special "5000" error code is added to the queue of the error. In the loop of error handling and stopping, "5000" error triggered 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 State of 'Stop' and 'Program.Shutdown' event case with notification 'Go '. If the user decides to stop, the Notifier sends the notification "Stop". Loop and event management State Machine ends when they receive the notification "Stop".

    In case of error, the program behaves in the same way: If the user chooses to clear the error and continue, the program returns to the status "pending".

    HOWEVER - if the user chooses to stop the program, the program crashes. The author of the notification that is sent to stop the loop of events and State Machine management cannot be read because event Program.Shutdown and the stop State (which contain the function "Waiting to notify") are not active.

    I was able to activate the stop State by Queuing in the loop of error/Shutdown management. But I don't know how to activate the "Program.Shutdown" event by program and thus access the function "Waiting to notify" inside.

    I tried to put the function "Waiting to notify" outside the structure of the event, so the event-handling loop never ends. Placing timeouts on the "wait for declaring" and the structure of the event makes the programme of work, but I want to avoid using timeouts because I don't want to turn my event program into a program of polling stations. I would also avoid using variables or nodes property to stop loops, because that requires the creation of a control/indicator for something that the user does not need to interact with.

    Thank you!

    First of all, close the notifier outside loops with your queues.  Second, you must use a user event to send the message to the event structure loop so that it stop in the case of the stop on an error.

  • State Machine with PID control

    Hi, I currently have a problem with my state machine, I control two cylinders double effect in sequence that works very well. However, there is one point I need to increase the pressure in the cylinder and to maintain this pressure through the sequence of State machine, however when the state machine transitions to the next indicate the PID controller resets, how can I solve this problem? Everything in is also allowed to apply the pressure in the cylinder another (same node IO accessed).

    Thank you I joined my project in a WinZip file, then it will have to be extracted. The two main VI to watch is 'Park Brake FPGA VI New' and 'park brake host VI update 2 "(new)

    Thank you.

    Nevermind I solved the problem with a parallel loop.

  • State machine with acquisition different modes/loops

    Hi all

    I did a machine design to State (as described here) to organize three (mutually exclusive) process / States: idle, measurement of calibration and continuous measurement. Calibration must be performed before measurement, because the result of the calibration is used for measurement. The data entry is a camera that should run continuously, also in rest mode.

    The problem however is that this state of calibration and continuous measurement (should) have another method of data acquisition. The measure is continuous and the images are processed in real time. To calibrate a number N of images should be accumulated and treated (simply create a background image).

    In the state machine as I have now (see attached image), I have the acquisition of vision outside the state machine in order to have a live view at any time. The problem now is that the inner loop in the State of calibration (the loop that must accumulate the framework) accumulates of course that the first framework N times, it is not question for all new managers during this State.

    Of course, I could fix this with an if/else statement in the first calibration mode accumulate images (if I< n,="" accumulate="" frame="" in="" buffer="" and="" continue),="" but="" i="" am="" not="" convinced="" that="" having="" a="" lot="" of nested="" loops="" is="" the most="" elegant="" way="" to="" do="">

    This also got me thinking, is the state machine, as I built it here all the best way to manage these two processes/acquisition modes? Or are there better ways to do this?

    Contributions and comments are very much appreciated!

    Note: I know that loop as scheduled now in State calibration is wrong with shift registers. It was a test before I realized that the fault was in the interweaving of the state machine altogether.

    Please do not attach pictures, but rather post executable code, screws (easier) or as extracts from LabVIEW (which became the screw when you drag in a block diagram).  If you have more than three attachments, compress the folder and attach the ZIP file.

    I was once describing a system similar to yours, and one of my students, who was a computer science major, said "it's not a State Machine."  I had a similar situation to yours, where I had a procurement process which took time and a 'Stateful' routine that does different things with data (in your case, use it for calibration, waiting to 'Go', absorbent, etc.).

    I understood that it was correct.  I ' D 'opposite' model, with the Acquisition, always running and "driving", the calendar and make 'Appropriate Action' on each set of data, where the Action could (and did) vary according to other conditions.  So I renamed my state machine 'Action engine', and everyone was happy.

    So I won't bother looking at your code (a quick glance showed me that I have only would be frustrated by the limited view), but will give you a suggestion for an alternative architecture.

    You want to (ideally) two parallel loops.  A single loop simply acquires the data (images) at some rate.  For each Image, it signals the loop else it's time to 'Action' on the acquired data (to do this, use a queue or the notifier).  You want that engine of the Action to perform independently the Acquisition loop, just in case a particular Action takes, say, 1.2 times sample to complete - you don't want 'Miss' samples!.

    The loop of the engine of the Action is a unique, appropriate Action at the time, on the newly acquired data.  If you are in the 'State' calibration, the Action will be "add to the calibration.  When you have accumulated enough data to do calibration, set the following Action to (for example) 'wait to start the Signal.  When you receive the Signal to begin, take Action to "acquire, process and save data.  And so on.

    As it happens, I did my code exactly in this way, but it was the idea General - Acquisition was the 'King', he ran the clock and led the ' Machine/Action State engine' to 'do the right thing, appropriate to the time' with the data.  See if this type of model is appropriate in your situation.

    Bob Schor

  • Buttons does not return to the early state in the state machine.

    Hello

    I downloaded a program that is used to back up data. I used a machine to States with different States. State 1 is initialization, where it moves automatically select the State, which allows to select one of the remaining States to copy the data. The selection is made by command buttons. Once u pressed a button, it goes to that respective State and in this state when you press the backup, the backup of data occurs. Once the backup is located the program goes back to the selection state. So far, it works fine. The problem then. Once he returned to the selection state after that copy was made, then none of the buttons are working properly. Then when it goes back to select State and I tried to select a State, nothing happens, not even the stop button works. I don't know why this is happen. Please help me solve this problem. Thanking you in advance.

    You have many States where you have the event structures ("All data" "given more older that '" young data that ' 'Defined Data') (worse there are two of them in "Data set")

    Each of these event structures are for a "Backup" mouse event down.  A singularity is now why you use a mouse event down on a button.  This really should be a value change event.  But this is not the big problem.

    The big problem is that all of these structures events are set to lock the front until the end of the case of the event.  Well, when you click the mouse down on this button, all 4 of these structures tail event this event.  If you are luckly, one of the event will execute and process the event.  Others, that you will never run because the state machine will not get through these cases.)

    You have multiple structures of event you VI and certainly not buried in the event.

    Reading guard and recommendations when using events in LabVIEW

    Then fix your VI architecture.  You must limit the structures of the event or a separate parallel loop, or to a single case of your state machine that your code will frequently return to, without any other user interaction, in order to service the structure of the event.

  • State machine - unexpected synchronization problem

    Hello - as usual, a problem is solved another appears! I built a simple state machine to take a measure for a period defined by the user of the time (X) and pause/wait for a period defined by the user of the time (Y) before taking another measurement. It works perfectly well if X > Y, but for some reason when X

    Look closely. It does work in both cases.

    The problem is that it resets and counts your "wait time" as part of its "beat of the measure.  Then put 10 sec measurement, wait 9 sev and you will see that it measures only for 1 second after the first measurement.

    Release the auto on your timer, rather redefined and when I = 0.

  • Use the state machine to fill cluster

    Hello

    I am trying to create a state machine that is running two States, each State has two items up to a Bundle function and in the cluster. I want the two elements of the State first across, then the second State should run and pass the last two items. Currently, I get only the data of the final State. I have one the vi attached.

    Thank you

    Chris

    You don't actually have a state machine.  What you have is a simple loop, and nothing of what is happening in the previous iterations of the loop is spent in later iterations.

    You must create the cluster in the loop itself and maintatin into a shift register.  Use the bundle by name to update the respective elements of the cluster in each picture of the structure of the case.

  • Problem updating my state machine, using the emg signal

    Hello

    I have problems with my code. My entry is an EMG signal that I gather from three different electrodes using usb 6008. In the program, I divide the signals and display them in a chart that is unique. What I want now is to read the signal, and if a signal passes a threshold I want an LED lights. This must remain lit until there is another signal that passes the threshold.

    To put it simply: "large enough signal--> lamp on--> stay informed--> enough large signal--> lamp--> stay off the coast and then start again."

    I tried a few different approaches, but I decided using a state machine. Now, the problem is that when the signal to enter the state machine the program crashes. I think it's because the table that I use to convert the signals does not update when I get my state machine, so the signal stops to come. But how to get around this problem? It is even possible to code what I want?

    I have attached the code. All the tips are welcome, I have been struggling with this for some time now.

    Thank you

    jenmich

    The problem is internal while the loop is run until the stop condition is true, but he never does a new Boolean entry. So that it remains for always in the same State. Remove the inner loop and put the shift register on the outer loop instead.

    You must also use a daqmx configures the element, and then set the properties of daq. The read.vi can be set to read a number of samples of each iteration.

    Also: you can expand the table to index for several items of output. If you want that element number 0, 1, and 2, you have yet to wire the index entries

  • Save the data of State machine after each iteration, then write all the data at once

    I have trouble finding in the best way to manage data generated by my state machine. Here are the data that it will save:

    * When pressure is set, a set point is returned.

    * When the pressure is set, a reading is taken a multimeter.

    What would be the best way to do this? Would it not be better to store all the data in memory, and then write all the data at once? If so, what would be the best way to do this? I want to use the tool to generate report after have set all the pressures. I joined my current application. Thank you all!


  • Structure of the event in a state machine

    Hi all

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

    Thx for your time,

    Bert

    Edit: actually, I miss-clicked

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

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

  • How to wire state machine

    I am trying to learn how over the state machine.  I created this simple vi.  The intention is to take the entry, and if it is less than 5, then the value squared.  If it is greater than 5, then the value should be cut into cubes.  However, I only get squared values.  What is missing here?  For a value greater than 5, I get the value "2" appears in the output area square... whence the 2?

    NIquist beat me to the punch.  I made this moification an got tied up before I could post it for you.

    Unfortunately for you, these examples show only two States that do not help House by car at the point of a state machine.  You can have several States to treat your data or move you your application.

    I have developed your VI a little to show a few things.  There are essentially 3 separate running in the loop state machines.  The bottom is a simple example where to put your code based on what you need to do.  Then you determine what state your data tells you to go to the next, and you may have several States here, not only two.

  • Event structure/state machine

    Here's the scenario.

    I use the buttons controlled by the user in an event structure to control a state machine. Currently, I have a different State for each button. However, 4 or 5 of these buttons could ideally correspond to the State, which is what I would like to get... Each of these 4 or 5 buttons causes flow data and the results are stored in a table, but listened data are different for each button! Therefore, if each of those 4 or 5 buttons caused the same condition occur how I could decipher what button was pushed? Ideally, I would have 4 or 5 different paintings once all the buttons are out of the same State.

    Is there anyway that I can achieve this?

    Hi the shots.

    you have access to the refnum of the element inside the event. With the Ref, you can simply get the name or any other property of the control to distinguish them.

    Mike

  • State machine pink icons

    I just started studying advice Lab, I m trying to build a state machine to a tutorial to the free rhythm. My problem is that I Don t know how to get the icon in pink inside of the case state. I've attached a file

    Thank you

    In my view, that icon Pink is a local variable for an indicator of the chain.  It is probably an older version of labview, because the icon is different now.  Right click on the indicator, Create > local Variable.  Drag the icon on any on the block diagram.  Then right-click the local variable, Create > Constant for the constant string.  It's great that you are be studious.  Good luck with your learning.

  • How to transmit DATA between several state machines.

    Hi I'm doing a project that needs to acquire data from a simulated data file and display it on a graphical interface. Two of them are manufactured in a state machine. I wonder if it is a good way of communication of data between two state machines? It would be very appreciated if you can provide a few examples. Thank you very much.

    OK, there are plenty of ways to communicate, but who are these state machines in the same project? Same VI? All LabVIEW?

    I like functional global variables due to the functionality that can be included in the. If they are used wrongly, as most of the things with the coding, you will create the races and break your code.

    Work of local variable, but I try to clear them tsar when possible. If they are used wrongly, as most of the things with the coding, you will create the races and break your code.

    Queues are pretty popular to connect, but try to stay with fixed size data, if you think that the limits of memory could be a problem.

    If you speak through the eyes of network to published static Variables (do not use these unless you have a stable network) network, TCP/IP, UDP, or Web Services flow (you need experience in this field. It is not just together.

    LabVIEW is a good way to program, but this kind of key options.

Maybe you are looking for