State machine gets stuck (small problem)

Hello

I have a problem with the state machine, I have atteched dummy code that my problem can be considered. When I hit the exit button and the menu popup appears, the YES button works as it should, but when I type no., my program gets stuck. I tried initializing controls, but no effect

Thank you for your help.

I think it will be easier to use a case OPI event.

Jean-Marc

Tags: NI Software

Similar Questions

  • 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

  • problem of data flow in the case structures (using a state machine)

    Good day everyone.

    I'm having a problem with the flow of data between the structures of the case.

    I try to use an example of a state machine for this simple problem. but when I try to send data of a box structure to change the State of the code. It will change not in the desirable output, instead, it offers the possibility that the exit options emul.

    could someone please point what I'm doing wrong here. Any kind of help would be very appreciated.

    With a quick glance at your photos a question you have is that you use not data flow. You write your status updated in local variables value. Your State should pass through the case structures are a single wire. Playback of your order "Enum", happened in the register shift on the right side of your loop probably get running and reading before any processing occurs within the structure of your business. That's why you're reading the old value of the State and not the update. or have a classic case of a race condition in your code.

  • State stuck in a state machine

    Hi all

    I have problems with a stuck in one of the States State machine. It is supposed to run in a State of freshness for X number of seconds, then a hot state for is the number of seconds. This cooling-heating cycle repeats until the time elapsed since the performance of the machine = the time defined by the user.

    Now my machine is stuck in a cycle of cool-> thermal-> thermal-> thermal... etc until the timer runs out. Under inspection with highlight mode, it does not show an error (shows cool-heat-cold-heat cycle), however when used to run without it.

    Any help is greatly appreciated.

    See you soon

    Hello

    Maybe you coud do it like this:

    Elapsed time of reset through state transition.

    Concerning

    Andreas

  • PID state machine problem

    Hello.

    I have a problem with my design of State machine and I need help to know what to do.

    I m using a state machine six steps for HVAC test machines. Password-> Idle it down-> Run-> Acquire-> Report--> Shut. Run and acquire the States have PID controls in them (almost identical States) and very fast three-way-valves they´re for the desired control of the temperatures of the water mixture. I m running try to get static values for temperatures and I m satisfied with them, moving to acquire the State to get the data in the report. My problem is that when the race to acquire, PID control outputs from scratch and at that time there static temperatures have disappeared. Worst case is that the tested machine HVAC stops following liquids from bad weather and I start from the beginning.

    Is there a way to tell the PID.vi the release of starting a specific value? In this case, continue to the last value that they released in the State of enforcement?

    I know that scheluding of gain would do (machines would be not closed) but I Don t want to use it because the original problem would still be there.

    Arctic_Fox wrote:

    So PID vi:s remove from the state machine, placing them inside the while loop that surrounds the state machine and leaving all necessary writing DAQmx-functions inside the race and the States Acquire would make corrections on the positions of the valve only on those two States. Right?

    It is a good idea.  I leave the DAQmx functions outside the state machine as well.  If you need to write a fixed value for the outputs when the PID is not running, use the PID that you already have to determine the value to write (output PID or anything else) on/off switch.  In addition, I would make sure the reset of PID entry is true whenever the PID is not running.

  • Satellite M50 Pro: Problem with keyboard - key Crtl gets stuck

    Jin

    have a little problem with the keyboard, and I was wondering if there was something I could do...

    the problem is sometimes when I am typing the keyboard, it will get stuck at random with the Ctrl key is pressed. I did no successful diagnosis as to what could be the cause of this, so I hope I can get it fixed here.

    Thanks in advance,

    NovaKry

    Hello

    I can give you some suggestions. I think the key Ctrl mechanism fits because of the debris under the key cutting.
    It of possible to remove the cup from the keyboard. Check the place around the key and try to clean it up.

  • I have a Macbook pro (2011 model). It gets stuck on the start screen on to half way through commissioning. This happens whenever the mac turns on. The problem is solved when I reinstall Yosemite to boot to Recovery Mode disk utility.

    I have a Macbook pro (2011 model). It gets stuck on the start screen on to half way through commissioning. This happens whenever the mac turns on. The problem is solved when I reinstall Yosemite to boot to Recovery Mode disk utility. However, the next time you start, the startup process is blocked to halfway to new (on the screen with the toolbar and the status of apple). I want a more permanent solution to reinstall the operating system every time. Would appreciate someone's suggestions and thanks in advance.

    Replace your hard drive.

    You have a backup of trust? If not, buy a disc of exterrnal for that as well.

    The progress bar from the left end at the beginning of the commissioning indicates that your drive has been so damaged, it could not be mounted. Five minutes of progress bar is shown as it does the equivalent of disk utility (ERD [Directory]). If you have reinstalled several times and the problem is not fixed, your drive is in solid form.

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

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

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

  • my system will not defragment and it's brand new, it will be anylyze but gets stuck after 1% defrag everyone has this problem on windows 8?

    I get more obvious than that, and that windows 8 is really sucking except to play games and to have some fun. I can't get my system to defragment... and my mouse is very unstable as well. a wireless mouse and keyboard is also very delicate. It's an Acer E1-521-0851. Thanks for any help you can give me.

    Hi Barbara,

    I understand that you are facing the question with the defragmentation as it gets stuck at 1%, the mouse is also unstable. Let us perform the following troubleshooting steps and check if this is useful:

    Important note: Disconnect all external devices except the mouse and keyboard and then try to run the defragmentation.

    Method 1: Run SFC / Scannow.

    The sfc/scannow command. analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions.

    Scan the file system (CFS) auditor. Follow these steps:

    one) starts at the desktop view.

    (b) open the command prompt, right-click in the corner when the start window appears, select command prompt (admin).

    (c) type the following from the command sfc/scannow , and then press ENTER:

    Method 2: Run the command chkdsk and verify.

    Refer to the section " " "to repair a disk to perform the disk check""" in the following link:

    Improve performance by optimizing your hard drive

    http://Windows.Microsoft.com/en-us/Windows-8/improve-performance-optimizing-hard-drive

    Important: when running chkdsk on the drive hard if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data may be lost

    Method 3: Install the drivers for chipset of the manufacturer's Web site:

    http://us.Acer.com/AC/en/us/content/drivers

    Warning in the BIOS: BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk

    Hope the helps of information. If you need help with Windows, please answer. We will be happy to help you.

  • I have problems to download Adobe animate. It gets stuck at 51% progress in Extraction, but then nothing else happens.

    I have problems to download Adobe animate. It gets stuck at 51% progress in Extraction, but then nothing else happens.

    Empty your tmp (win) or the temp (mac) folder.

  • Problems with the implementation of State machine enemies spawn

    Hi guys,.

    I am developing my own 2D shoot-em - up and using a book called "The essential guide to Flash games" as reference to create my own state machine enemies spawn where the game keep enemies spawning (game will always until the player dies). I tried to trigger each enemy spawn that occur at the level of the game with a variable called 'chance '.

    With my current attempts, the game does not an enemy and does not other or not spawning all enemies at all. I was wondering everyone here has suggestions/advice for this question, I will have?

    Here is the sample code from the book that I used:


    public void Main()
    {
    Level = 1;
    score = 0;
    chance = 0;


    enemies = new Array();
    makeEnemies();

    }

    public function makeEnemies (): void {}
    var chance: Number = Math.floor (Math.random () * 100);
    var tempEnemy:MovieClip;
    If (< 2 + level of luck)
    tempEnemy = new EnemyImage()
    tempEnemy.y = 435;
    tempEnemy.x = Math.floor (Math.random () * 515)
    addChild (tempEnemy);
    Enemies.push (tempEnemy);
    }
    function checkCollisionWithEnemies(bullet:MovieClip)
    {
    If (enemy.meter.width < 1)
    {
    Enemy.Stop ();
    swapProperies (enemy, b);
    removeChild (enemy);
    enemy = null;
    level ++;
    }

    Occurring in the book lines:

    "var chance: Number = Math.floor (Math.random () * 100);"
    "If (< 2 + level of luck).

    should create + 2 enemies according to the level of the game, but no enemies to reproduce at all. I also tried a different method with "if (level > = 1)" but that creates a single enemy.

    Anyone have any suggestions of what I'm doing wrong? Any help would be greatly appreciated.

    Thank you

    Jonesy

    > is not new spawning enemies when the former enemies are killed

    You have nothing to create new enemies in the function "checkCollisionWithEnemies()".

    > three enemies are created in the beginning instead of one

    The for () loop based on makeEnemies() is configured to run 3 times (I I = 0, 1, 2)

  • Servo motor gets stuck in the loop

    My project is to control two motors from the pedals with LabVIEW in combination with UMI-7774 and PCI 7350.

    I use a traditional format of State Machine to simultaneously control two motors according to the absolute position mode.

    In one of the first States, both motors are wound manually by using the speed mode (to make a desired voltage).

    In a later State, the motors are wound to a position specified by the user when you press a foot switch. When you press the other pedal, they are then held in the previous "original" position

    After the first "Tension" indicate when the winding engine and the course due to the pedals is running, the program gets stuck in the State of wind.

    Although drivers are told to go to a specific position, they never move and that's why the program is unable to move to the next State.

    I've attached a screenshot of the winding State where the program is stuck (the engines are not mobile, so when the final position is to compare it with the desired position, the loop continues to go).

    Help, please.

    CAT

    I solved the problem.

    States "Wind engine left" and "Right wind engine" speed has been put back to zero. When the program moves toward States of wind/flow, the speed is always zero (the engines cannot move).

    I simply set the speed value desired in each of the States LBL/RBL (that allowed the engine to get to the position of desire).

    Thanks for all the help,

    Catherine

  • How to start and stop the video capture in a state machine

    Hello

    I am a student of neuroscience and this is what I try to do: 1) trigger a camera to GigE (200 FPS), 2) start the video capture, 3) triggers a light that stays on for x milliseconds, 4) trigger a valve that will blow an air puff, 5) stop the tone and the valve at the same time and 5) stop the video capture 1 second after 4). For this, my VI is a state machine, with a State for each trigger (ex, 1 State for trigger camera 1 State of light of trigger, ect) and a statement to "stop" and a "time-out State." Everything worked except the video acquisition - the program could trigger the camera but only acquire a frame, because it was not running in a while loop and this is my first question: for an acquisition video is it always necessary to have a while loop?
    I guess the answer is Yes, so I built a loop of 'consumer' for the camera. A queue of the pre-trial 'trigger camera' in the loop of producer, I was then able to start the video capture, but now the problem is to stop it at the right time. I have an another queue in the State of 'stop' in the loop of the producer, but is not able to start the State 'stop' in the loop of consumer, I think that maybe it's because the loop of consumer gets "stuck" in the whole loop.

    I hope you can help me, the VI is attached. Thank you!

    Hello

    First of all, in your loop producer: STATE 'Stop', you use the flushing line, then there is no need to use 'item queue at the opposite end. You can use the enqueue function.

    Secondly, you said "I moved the command stop inside the while loop as you said, but it did not work. But if you look closely, you moved "Enqueue function" inside the while loop. Instead you should use Dequeue function. Please, look at the picture I posted an orderly manner.

    And remove the circled (i.e. function. Enqueue function loop of consumption, where I wrote 'Why stop here').

    Try now.

Maybe you are looking for