Helps the state machine

Hello everyine,.

I'm working on a state machine. I saw a few videos of the same thing and I need help.

I have attached the code below.

My problem is that I can not jump since the first case at the last.

After the execution of the first case I want LabVIEW to check fot the Boolean control attached to the function select. I used an operator oux during the operation. If the condition of "TERMINATE" is satisfied that I want him to be the last case of local variable is used to turn off the START light.

at the moment I can't go to the latter case. I want the code to keep control of the State, and whenever the user presses the button END the LED should turn off little matter the time of execution.

PL suggest ways to accomplish a task... am still a beginner

Concerning

Jalashwa

Hi Sindhurakshak,

You are welcome. I think that the problem still resides on the Structure of the event to the State "WBS". I can suggest the following (say that everything always ends by WBS what I understand of your current code):

Remove select it and create a new case event for Boolean switch «end». Location of the enum to cancel in this case, as shown below:

The above change means that if the value of "end" Boolean switch is changed (assuming that this will change to true), the case of the event will be held event 'end', which will then the enum value 'End' to the transition of change. Let's say that if the Boolean key 'end' has not changed (which means that has not been pressed), it should run the rest as shown below:

I'll leave the enum value 'WBS' in the time-out period, assuming you want the State to always run the "WBS" idle state, unless you press the key 'end' to trigger the transition "Terminate".

It may be useful

Warm greetings,

Lennard.C

Tags: NI Software

Similar Questions

  • For the State Machine logic makes me Mad, ideas?

    Hello

    I am a complete newbie to Labview and up to the help of kind people on the forum and tutorials tips, State where I implement a state machine.  However, I can't it behave using logic.

    What I try to do is to test the relay using an automated test procedure.

    The procedure takes the following measures:

    1. a card reader and transistor NI9472 DO turns the relay power via the power of the coil (needs of the variable time period). (It's OK)

    2. account of how can cycles the relay contacts worked, it will easily exceed 100,000 cycles. (It's OK)

    3. every 10 cycles (new variables), the contacts are held closed, load circuit "15A in the state machine" (the current relay is switching, which will be 15 a at 30V) is turned off.

    4. While the State of 15A is off, I need to switch to 'State of 1' and the 'State of the measure' , that it allows the measure to take.

    5. Finally, the "State measure and the"State of A 1"must be turned off and the"15A State switched back on .

    6. this process continues for another 10 cycles and repeats.

    I tried to do by using the States and the logical selection function for different States, where she part works, it does not seem to flow completely.  I'm I missing logic.

    Hoping someone may be able to help, thanks

    Andy

    I really didn't thing you want to be returning this Boolean value in all States.  You should probably also have a different evolution register for each line of output.  Then you simply adjust those that you need to.

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

  • Help with State Machine user Sequentail events

    I'm trying to create a program using the state machine which include events genreated user to jump between States. Also, I want the program to require a sequence of events to be genreted before entering in some States.

    For example:

    States: Init, idle, a-1, A-2, A-3, B - 1 and stop

    If a-1 State is selected, the user must enter the setting and select the condition A-2.
    The user cannot directly jump without having to access the mode a-1 to A - 2
    If the user selects the a-1 State, he should have the possibility of not input parameter and jump to another State as B-1 or Stop

    State A-3 can be entered automatically by State A-2.

    How to program the machine in order to do what I want? I've updated a sampling program. I'm not sure if I impleted the program properly. The user Panel hangs if I enter State a-1, and then press the Stop button. It does not allow me to leave the a-1 State and forces me to go to State A-2.

    A few other questions:

    -How to initialize all values of boleean to 0 during my Init State?

    -Why is a timeout value?

    Hey there, I developed example of Jacobson on a bit here to illustrate the case "Idle, how far to walk, ' your state machine diagram.

    Some keys on the front panel when you are in the bad condition will do nothing, as you can see, because I only check for buttons, I would like to respond to each State. For example, by pressing "Start on" the State of market won't do anything because this isn't a valid button, but pressing "Quit" will bring you to Idle. To implement the rest of the state machine, it is up to you!

  • Need help created the state machine which is based

    I need assistance with my labview program. My goal is to write a program that allows the user to activate a switch. When they do this, it will start a loop witch goes on a digital switch for 45 minutes and then 30 seconds and so on until the user did switch the switch off. The time doesn't have to be precise. I use the NI 9476 digital output card.

    I wrote the code to activate the on/off switch. I know add fuction in loop for 45 minutes a stop 30 seconds. I guess that the most effective method would be to use a state machine, but I struggle to understand.

    The program that I wrote so far without loops is attached.

    Thank you

    Barrett

    I couldn't open your vi because I do not have some of the Subvi.

    Nothing wrong with the first example posted, but I interpreted the specification a little differently.

    Edit: There was a small bug in the first zip file.

  • string does not update in the state machine

    Help

    I'm pulling my hair out on this one.

    I have a control over the channel I want to get the value that out of the front at a certain point in a type of State machine architecture, but the value contained in the string of LabVIEW not updated during the enforcement program for the purposes of the block diagram.

    I checked that the VI is not corrupted by creating this simple VI to illustrate what I'm doing. (otherwise empty)

    The length of the string, or the indicator related to the local variable, or updated a probe on a wire connected to the string if during 2 seconds after the start of the VI, something is typed in the control of the chain.

    LabVIEW 2009 version

    Windows 7 operating system

    This could be and OS related issue? -J' I normally use XP not Windows 7 with 2009 and I've never noticed this before.

    Any quick feedback this weekend would be greatly appreciated

    Thank you

    James

    Try setting the chain control to "update the value while typing". (right click...).

  • Problem adding values to a table with the state machine architecture

    Hello

    I currently have a problem that I have to build a program using state machine architecture and now I want to add a value in a table whenever you press a button, but I would like the table to add the new value, rather than deleting the last value. I can't seem to figure out how to make this work without using while loops and similar. It doesn't seem to work properly.

    It is in the case of measurement.

    The idea is I draw several lines then it records the length of the lines in a table and then I'll take one average this so I can convert pixels into real life SO units. But right now I can't seem to add the information in the table.

    There is a little screw Sub, but I think that they should not be important for this question please!

    What's the problem with just the table help build?

  • Elapsed time delay does that once in the state machine

    Hello.  I have problems using the delay to show the seconds remaining on an expectation not in a simple state machine.  I have a front panel countdown indicating the time remaining for the step.  I thought that the delay of elapsed time was the way to do.  The problem is the vi work correctly the first time.  But then after that the calendar does not seem to reset at the time I had put.  If I remove the delay and just stick a waiting time in the State, the vi is exhausted because I expect.  This is just to give the user an idea of the time remaining.  What I missing when using the passage of time, or it's just the wrong tool for the job?

    A small question, is that I would like to move the tasks, in this case the LED outside of the loop, so I don't have to repeat the code.  But when I tried moving them outside with only allow constants within the State, they do not work as I expected.  If you have tasks such as operating a set of Boolean values that you are used in several States, what is the the cleaner way to do it without repeating the code?

    Thanks for the help.

    See how it works for you.

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

  • How relabel case designated enum in the state machine

    Hello

    I have a state machine application in which typedef enum is used to refer to the names of the case.  Is there a faster way to rename one or more cases to match the typedef enum edited instead of having to rebuild each of them (the case structure loses all enum names if I try to edit in any way)?

    Thank you in advance,

    Oliver Barrett

    www.LinkedIn.com

    One thing to add, once your custom/constant in your block diagram control, if you decide to add a new case after case is added, you can simply go file > apply changes in the control to customize window and they will all up-to-date in your block diagram.

  • Tips to remember when using the state machine in queue

    I was able to work through the convert my architecture of State Machine for a BAU, thus eliminating the use of nodes of property/local variables to send data values to my machine of the State, but rather to send through queues.

    I would like some advice/tips on taking to serve perfectly. Especially, "is not to make" things with queues and how to effectively release a queue, etc.. What is the convention when using queues? Thank you!

    V


  • In the state machine loop counter

    Hi all

    I have a state machine, and one State in particular is very busy.  I want to State in a loop several times.  I thought about that, but I don't like them.  Let me know if you have a better idea.

    1 Add a registry to offset as a counter for the State.  The State will keep looping to himself, while decrementing the counter.  If the counter is reset, it will go to the next State.  If this isn't the case, it will keep the loop.  I don't like this, because I'll have to add a register to offset.  If I have a little more State requiring a different number of iteration, I'll have to add a counter for that State.  My main VI will be too shift registers.

    2. Add a loop around the code in my case for iteration.  I do not, because too many wires will be going in and out of the loop.  I don't want to do cluster either.

    Yik

    jyang72211 wrote:

    Node of a feedback by counter I need?

    Yik

    With precision.  See this example, each State 5 times before moving earrings.  Beats having 5 shift registers and all of these threads passing through other cases.

  • problem with the state machine

    Hello! I have a VI to monitor a storage tank. I tried to do by creating a simple state machine that changes the value(on/off) of some faucets based on 2 conditions:

    -When a certain temperature reaches a predetermined value AND its derivative is<0, the="" state="" must="" change="" from="" on="" to="">

    -When some time passes, the State should change from off to on.

    Unfortunately I can't get this working as it never changes state (by example, if I start with him always stay on 'on' and vice versa).

    Could you please tell me what I'm doing wrong? I enclose the screenshots of the 2 States.

    Thank you!

    Sounds like your shift which could not not be wired properly.

  • Race conditions manifested in the state machine in queue

    Hello

    I ' am developing a vi in which I use a design of producer-consumer model.
    the producer s enqueue States for the consumer. but at a certain point in execution of I want to enqueue the next state of the statemachine consumer, within the State of the consumer himself. This causes a problem?
    in other words I have given queue in the loop of consumer can also. so the man the next state of consumers will depend on the data in queue

    Thank you

    I make extensive use of Handleres of Message queue where the "producer" and the consumer enqueue for the same queue.

    A "Firinstance" of work today: here are two screenshots of a part of the same code

    The top loop controls the State of a semi autonomous process where data is collected.

    1. an event is detected, triggering the start of the measuring cycle
    2. Data are being gathered
    3. Another event tells the top loop that it's time to stop collecting data and "Analize" is sent to the end opposite to the consumer
    4. The buffer empty analize, formats the data and continues to the State of "Log".

    The thing to remember is to use a priority queue.  Enqueue to place free and flush properly, in front of end control.  See also 'A trip to Grandma's House'.

    It is a very powerful technique for applications where you want abstract on the 'what' and 'When' the how and just leave a "do".

    And Yes, if I had chosen a unrestricted data (string, var) rather than an enum type and built the lower loop as a child class, you have a "player".

  • Need help to stop stop button on my machine of the State system

    Hello

    Can someone help me understand please why my STOP can't stop the state machine, I want to stop the program, that the program is running... and it's sad to say, on my side, that, when I pressed the stop button it won't stop until the loop ends. and what I really want to stop it even the loop runs. I have attached here for your reference my vi...

    Thank you and best regards,

    syrpimp


Maybe you are looking for

  • How to recover my password for tbird?

    TBird asked me if I want to have a new email... I answered without... to use the existing. Now he wants meto type my password... have not entered any years that seems. How should I proceed?

  • Where the local mailbox on my computer?

    Here are the local mailboxes located on my computer? I am running Windows 8.1

  • Wireless guard disconnection on Satellite T110

    Hi, I just bought a T110. Everything works fine except the wireless, it keeps disconnecting.I've read on the Web from Toshiba site is made to save energy, so I changed the network adapter settings so that it will go to off when running on battery pow

  • Windows 7 drivers for serial port PCI compatible for ThinkCentre M57p (6088)

    The weekend I upgraded my Lenovo M57p (model 6088) to Windows 7 and encountered the problem in which the drivers for the following were not installed and could not be located... PCI Simple Communications controller PCI serial port The problem here is

  • RAID 5 on 6 Pro question

    I have problems with my Pro 6. I was never able to get my Raid 5 storage for make sense. Is less than the correct figure of total storage? I thought that must be read higher than 10 TB. Am I missing something?