creation of structures: state machine with controls

Hello, I wonder if someone can help me with something. I have a sequence, followed by the event structure / while loop.

someone can help me. I want to create a STATE MACHINE.

Here's a basic outline of the current structure, I. and this is what I want it to be. I wonder if its possible and how.

I'm using labview 7.0.

Thank you

This is what I want?

I looked at your Executive VI.  I don't have an easy way to save in LV 7 now so I'll try to describe in words how I would approach this mess.

I think it can be done with two loops, a structure of the event, a case structure and not global or local variables.  In fact, there is probably some small business structures and lines inside some of the case, but nothing like as layers of ~ 12 nesting, you're struggling now.

Look at the design model of producer/consumer (events) as a starting point.

The loop of producer (event loop) will have the structure of the event.  It will be a case for each control that requires immediate action.  Those that I could identify: get telemetry, side, open Journal printing, abandon, press tank Mode (?) Temp tank (?), Scan, Stop, wait, Step (?) unique, continue and Execute. Most of the buttons must be set on the mechanical action of locking and placed terminals in the case of the event appropriate. So no local population is necessary to reset them.  Those with (?) have no event.  You can have a case of timeout to display Date and time, eliminating which (painful to my eyes) loop.  I don't know about the other stuff in the case of a timeout, but most likely, it is up to the other loop.  If the room 1, 2,... buttons change during trips, they may also need event.  Inside of each event is exactly one element: the Enqueue function.  Create an enum command and make it a typedef. Enqueue this enum value. The queue will be read in the loop of consumer where all the action happens.

The consumer is your state machine. It has a Dequeue function to get a new order for the structure of the event.  It has several shift registers to transfer data from one case to the other.  These removes your global and local variables.  I'd shift for each of the following registers: the State (typedef enum), cluster of error, temperature (table), pressure (table), results (table), Stat results (table grapes) and a big cluster Indicators_Flags (typedef).  The cluster Indicators_Flags everything that is in the cluster you initialize in the black image sequence (and then never reuse) would have more all indicators except the berries in Maj separate records as well as all your globals and no status indicator, you might need.

The structure of matter is the heart of the state machine.  All shift registers through it.  It will be the case for what the program does.  Everything in this black initialization setting in about 15 cases of Init.  The while loop to the right of the boot image goes away, but the case inside to become some of the cases of the state machine.  Chassis temperature cycling code goes into 1-3 cases. Mode code pump and read the pressure of your case of timeout event are 1-3 cases.  Code of telemetry: 2 cases.  Print the Page before: 1 case.  Excel code.  Abandonment of code.  Temperature and pressure cycling code of main program: 5-20 cases.  Graphics, record in file: more cases.  Break: 1-2 cases.

I would like to make a list on paper anyway, you think that you may need and allows to create a typedef enum to control cases.  By making a typedef, it is easy to change without running all over the code looking for the constant in all cases of change.  Enum names will appear on the structure of matter as strings.  Create the loop, shift registers and the structure of the case.  Moving is part of both the original thread can duplicate the case until you have a case for each value in the enumeration of the State.  (Do not use the case of the mark for each value option because it will empty cases that you will then need to wire through.)

Then copy code from various places in your existing code in the case in the new VI.  Try to avoid copying inhabitants that it will create new controls.  Name bundle to get data in and out of the big bend cluster registry and use ungroup by name.  This provides a free documentation of the data used.

Check in a month when you have other problems. This will not be a quick fix.  But it will be useful to have a program that works and is easy to manage.

Lynn

Tags: NI Software

Similar Questions

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

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

  • Plan for the creation of new virtual machine with 3 TB data drive

    We have an old server, we need to virtualize, and one thing that we need is a lot more storage. We have approximately 3.25 TB of available for this machine (250 GB for the OS and 3 to for the data drives), but I'm going in circles trying to find the best approach for this server. It is not possible to separate the data between several players because of the way the files are indexed. I have created a virtual machine with 2 TB of disk space (for the readers of OS and data) and added 1.25 TB of disk space I want to add on the data reader, but it does not seem possible to add 1.25 TB without destroying the data on the first disk of 2 TB. What is the best approach? Create a single disc for my virtual machine that is 250 GB and then add in two separate disks of 1.5 TB for storage and combine them within Windows?

    Thanks for your suggestions.

    Hello

    Unfortunately, the maximum size of virtual disk to a virtual computer is 2 TB - 512 bytes. In you case it should create two or three separate virtual disks and combine them (disks RAID 0 or concatenate). Another way (IMHO besser way) is to create several virtual drives and mount using NTFS mount points.

    An example:

    C:\Data is a folder on one of the virtual disks. Create a second virtual disks and create the C:\Data\Data2 folder. Rather than assign a drive letter for the newly created disk, you can mount it in the Database2 folder. This gives you the ability to move the largest files on separate virtual drives without lose you the structure of folders.

    Kind regards

    Patrick

  • State Machine with queues

    Probably a stupid question, but if I'm not asking that I not just guess.

    I have a well-organized State Machine and I am in the final stage - data record. The saved data might be pretty long (a good 15-20 seconds) due to the latency on our LAN and I think that the best way to address this would be to use queues. I was wondering what things I need to look out for or is it as simple as pass the data to the consumer?

    I would need just two pieces (a field ID and its actual data - two string values) of data for each record that could be transmitted through a 2D array.

    Sounds like a normal of the producer/consumer for me.

  • State machine with polling loop

    I asked a similar question before, but I realized that I was being unclear, so I ask my question again in a more concise and clear format.

    Two loops:

    -1 loop: run a state machine to produce data (a table 2d)

    ((- 2nd loop: 1) survey the user regarding who rank in the 2d array (past 1st form loop) to display and 2) display the line on GUI

    I don't want to use the question mark on my 2nd loop.  I try to use the queue, but I don't think that is my request too much, since I was to pass data and query the user input.  In the end, I thought that it would be for the best if I just create a functioal (FV) variable to display the data and pass data of loop 1 loop 2 loop 2 based on the user input received through surveys in loop 2 (Yes, mark!).  Is there a better way?  What do you think?

    Take a look at this example.

  • State machine with the help of event

    Hello everyone,

    I have a question on how to achieve the "Timeout". In the diagram below, you can see 2 different situation:

    1. in the 1st case, I used the state machine, it starts in State 1, that contains a case of event. From there, it will first be determined, if the input value has changed in 10 seconds, if it didn't, the state machine will go to State 2, if it is changed, will also be determined, if the value equal to 3, if so, input the distributor of State will in State 3, if not, go back to the State 1. (this VI I've done it before, you can take a look at the attachment).

    2. my question is in the 2nd case. He also started the State 1. Here, the input value can also be changed (once or several times) or not. If the value has not changed within 10 s, or even if it's been changed many times within 10 seconds, but it was never equal to 3, the state machine will go to State 2. only when the value of the entry within 10 seconds equal to 3, he can jump to State 3.

    This problem, I do not know how to solve, everyone has no idea or improve methods?

    Thank you very much!!

    My bad, dint tested before posting (in addition to kills confidence)...!

    Let me know, if it works this time...!

  • URGENT! After installing 6 Fusion and creation of new virtual machine with Windows 7, I get a message "VMware Fusion cannot enter the unit". WHAT SHOULD DO?

    After purchase, installation and activation Fusion 6 with the license key, I had a library of VMS showing 2 Boot Camp partitions. It's strange that I only have 1.
    I tried to activate them but received a message that it is out of date in 2 cases. (see annex 1)

    I started a new virtual machine with a Windows 7 installation disc directly on my HD. I have provided a way to do this and followed the instructions of Fusion to the screen.

    Apparently, everything went well and after several restarts, the installation appears to be over (see annex 2) I tried to open and run the installed Windows 7. I had however a window with the following message:

    "Pending the unit.

    "VMware Fusion cannot enter the unit. Please wait until the unit starts automatically, or interact with the virtual machine below. ' (see annex 3)

    Here Windows 7 seems to start but after a while with the home screen and of the Øresund finishing this window closed and open a new window called library Virtual Machine on the left showing the partitions of Bootcamp and the Virtual Machine Windows 7 x 64 and in the middle gray a representation of what is supposed to be the Windows 7 desktop. (see Exhibit 4). When I opened the settings button a window with different setting options pops up. This mark means to me that Windows is installed but the final opening isn't the case

    When you quit Vmware Fusion indeed Windows seems to be close (see part 5)

    What is going on? What has gone wrong? What should I do? I don't know how to solve the problem.

    I should f.i. remove the virtual machine from Windows 7 and is free automatically made partition on my HD as the reboot with the Windows installation disc? or y at - it another way to enter the UNIT?

    Help, please!

    Thanks in advance

    Your virtual machine is running. It is in the unit - which each windows gets its own window of Mac - and you have no application Windows running, there is no visible windows. You can start a Windows application in the start of Fusion menu in the menu bar at the top right, or turn on the Windows task bar on the view menu and start applications from there. Or use the view menu to switch to the Single mode or full-screen, which puts all of your Windows desktop in a window separate from Mac.

    You do not have two partitions to Boot Camp on your Mac, you have two virtual machines named "Boot Camp partition".

    The message about it being unable to enter the unit arrives while the merger is pending for the tools begin to run, because the tool is necessary for the unit.

  • creation of multpile vitual machines with a hard file.

    In fact I am facing problems create multiple virtual machines with the hard file.

    I downloaded the file hard on the data store and created a virtual machine with this file and create another virtual machine with the same file. Is this possible or do I have to download the file again and create the virtual machine. ??

    Thank you.

    You would use this option to export a whole VM, and then import it later.

    Therefore, you must create a basic VM with whom. VMDK attached to it and then export it. You can then import several times with a new name and customize as needed from there.

  • State machine with analog output

    I have a vi designed to generate an analogue signal to an actuator and now I just want to add in some calendar items. My intention with the attached vi was to provide signal 1 for a certain period of time, then switch to report 2. I'll add a little time to wait between the two afterwards.

    What's not here? I have not changed the DAQ assistant or any material. I watched this while loop, shift register, structure combo deal on another thread. Signal graph displays correctly the signal, but no signal comes out of data acquisition. I'm sure its something simple, I'm not the best to use labview with elegance.

    Thank you

    I'm not even sure you need calendar screws in there.  You are generating a data value of 1 second and then say data acquisition for output data.  Who takes a second to do.  Therefore, the DAQ Assistant takes over your second time.  Therefore, simply switch your boolean.

  • Scalability state machine

    I am sure, there is a simple way to do it, but so far, I have not been able to find. I want to create a state machine, where I am not sure if I will need other States on the line and have had the problem of having to modify selectors and others, according to the new States. I thought of an idea I read somewhere on the storage of the constant in a sub - VI then it auto upgraded in all instances, but can't seem to wrap my head around it. In practical terms, what I would like is:

    -Creation of a state machine with n States I am sure I need now law (business architecture)

    -States for the selector says storage somewhere I can update only once and see which is reflected in all of the VI

    -In the future, if I want to add more States, add to the database 'master' only once and without having to update the former selectors

    White papers or threads, I miss the guys?

    States are generally defined by an Enum.

    Just 'Type defines' the Enum. When values are added, it will update all instances.

    (Right-click-> Type def. do in later versions of LabVIEW.

    Just be sure to save the new Type FED.)

    Steve

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

  • State machine running in the mess

    I'm under Labview 2014 with a card USB-6212.  My card/code is used to control a stepper motor and a linear actuator with a built-in potentiometer.  I created a state machine to control the sequence of events and synchronization between the two engines.  What is the general flow of the program. (The program ultimately will save the data, but this feature is not yet written.)

    (1) Init

    (2) take data

    (3) take out the cylinder according to the desired distance.

    (4) increments the position of the actuator to the next desired position.

    (5) repeat steps 2 through 4 until the next desired position is greater than a maximum distance.

    (6) actuator back to the starting position.

    (7) raise the stage with engine step by step an increment.

    (8) repeat 2 to 7, up to a maximum height

    (9) returns the height of the platform to zero.

    I have three main problems with my state machine.

    Problem 1) the counter mentioned in step 4 (found on the case of the ACTUATOR OUT/RECORD DATA in the program) does not invariably increment.  Most of the time, he eventually incrementation of twice the distance that she is supposed to.  I can watch the indicator on the façade increment twice while the linear actuator moves only once.

    Problem 2) program runs correctly in the sequence or consistantly.  Step 7 usually occurs prior to step 6

    Problem 3) program rowed a lot and freezes before it finishes.

    I have worked on this all day and could really use some help.

    Thanks in advance.


  • 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

  • MacBook Pro heats up during charging

    Hi guys,. So I'm planning to buy a Macbook Pro 15 mid-2012 ", but when I went to see the macbook, I noticed the connector magsafe and the upper left part of the macbook gets pretty heated during loading (even with the computer at idle, but on screen)

  • Satellite A200: DVD/CD player does not work

    Excuse meI bought toshiba A200.After two weeks my DVD/CD drive does not work.So I deleted the a±ts driver and then I do not want to install the driver.Please help about this.

  • Qosmio F750-03W - face recognition does not start and the video freezes

    I apologize for my English. NVIDIA 3D test shots of program wheel. Face recognition does not start.If the activator of the image that 3D is disturbed and I do not see the image in 3D. If I try the Games 3D compatible (Left4Dead) active 3D 1080 p, but

  • questions of FIFO sbRIO 9636

    Hello world I'm new to the part during a real-time/embedded Labview and I'm just starting to play with the RIO evaluation kit. I stumbled upon a phenomenon that I do not understand... So maybe it's a stupid thing, so I apologize in advance. I have cr

  • Start the problem - Exception Processing Message c0000013 parameters 75b6bf7c 4 75b6bf7c 75b6bf7c

    Boot PC I started getting the error message next - Exception Processing Message c0000013 parameters 75b6bf7c 4 75b6bf7c 75b6bf7c - anyone know how to get rid of this?