Storage of data in a State Machine

Hello

I am building an optical measurement of fluorescense set-up and plan to control using LabView.
I need to scan a range of wavelengths and to each acquire a measure. I just realized the best way is to do it with a state machine, which will travel two States (first Set wavelength, second Aquire) until the final page is reached.

I would draw wavelength acquired data vs (X vs Y, two tables I guess) that the analysis is performed.

And after several iterations, when the analysis is complete, I want to save all the data to the file (for example, only two columns, one of the wavelengths, the second the acquired data).

Therefore, for each iteration of the scan, I need store the length of current wave and its correspondents. This information will also have to pass between the States, as I want the plot to be real-time (during scanning).

As a novice of LabView, I'm not sure what is the best way to do it (shift registers? AE? queues?) and I would appreciate any assistance.

Thank you!

Shift registers is the most simple and suggested way.

Just be a little careful to connect across all States, otherwise you'll ditch the data to halfway.

/Y

Tags: NI Software

Similar Questions

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

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


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

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

  • 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

  • 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

  • Timing of a State Machine in the States

    Hi LabView community.

    I'm running a state machine (attached) in which I want to measure the duration that the VI is running in several States. The VI is used to take spectra of power of various samples. My scheduled execution goes like this: the user selects on the front panel, how many times they would like to see the data taken. After pressing start on the front panel, a timer starts. When the machine is in State of 'Waiting', I would like to have the VI wait the amount of time the user has selected the amount of time that has elapsed since the user pressed start. So, for example, if the user wanted a spectrum taken every 15 minutes and the time since the departure was 13 minutes, I would like the program to wait for 2 minutes, then repeat.

    If someone could help me with this, it would be much appreciated!

    Thank you in advance.

    You just need to save in a shift register either time has begun the activity.  Or the sum of the amount of time that has already elapsed.

    PS: You used a large number of local variables and none of your terminals.  Good number of these local variables should also be so shift registers.

  • Playing audio from inside of a state machine without stopping execution

    I created a state machine that acquires and analyzes the input signal and the state transitions based on triggers found in the breast of this signal.  In a particular State, I need to read a pre-recorded file (right now I'm just using a file .wav for testing purposes).  I understand that because of data flow model of the state machine hangs up during playback status until playback is complete, but I need to find a way around that.  Of course, whenever the machine hangs may not continue the acquisition and analysis of the signal.  How to start playback from the state machine without stopping its execution?

    Do you use the his release screws? If you do, try this. On the 'Play Sound file VI' set timeout = 0

  • State machine

    Hello

    I get a code for a test setup using the model of State machine project.

    "Standby mode", I would like to show some sort of device face: I want to continually read data and update several indicators, until any key is pressed (triggering of the structure of the event in mode ' sleep').

    However, as I want to "lock when you press on" for fixing buttons (Boolean controls), I can not all their share values. I don't want to "switch when you press on, as is a two UI bad (in my opinion) and caused some disorder (once back to the idle state, cannot press any other button)."

    I would greatly appreciate guidance on how this can be done. A picture of what I want to do, to better illustrate my intention is attached.

    Thank you!

    cl0ck wrote:

    However I'm initializing in the first loop, I need to start with data acquisition off and be able to activate any (in the second loop) from the first.

    I tried 'Wait on Notification' wiring to a case structure, and put the data acquisition in the case of 'true', but for continuous playback, I always send notifications, which I am not in my real program.

    Have your notification send a REAL for the start, data acquisition and a FALSE for when to stop.  When you get the value TRUE, you can set the timeout of your wait on Notification to how fast you want to make your purchase and assign - 1 (wait forever) when you are ordered to stop.  You can simply store this time-out in a shift register.  So then you get data if you got a notification TRUE OR if you have a timeout.

  • Calendar of State machine

    Hi family OR. I have two questions. How can I make the transition in order for the state machine attached more quickly. Also, I would like to know how to set my timing. The time indicated on my wait function is off when I actually run the VI.

    Place your DAQ initialization in your initialization state.  Right now it initializes each iteration of the loop.  This is not necessary and wasting time.  Use a shift register to pass the reference of the DAQ tasks.  Do you need to write in the acquisition of data in all States?  At present he writes anything to the State.  Move the writing of data to the States if necessary.  This will speed up your code too.

    Why do you say that your calendar function waiting is off?  How far?  You know that your actual time for the waiting cycle is more than just the waiting time.  It includes other operations outside the structure of the case.  Movement of data acquisition will be the more accurate wait.

  • event and state machine

    Hello

    I have a problem when I want to set up an event in my state machine.

    The state machine is reading communication series through different States 10 +.

    The problem came when I tried to add an event inside the State number 10. In the number of State 9 code seems to work only partially (an option button is not possible to change the value on).

    It seems almost that it is frozen but when I select the code I can see it works well (option button isn't).

    It is strange that when I remove the event in condition 10 all is well again? The event code is not yet performed yet because it is in the frame after!

    Any thoughts?

    I'm under LabView 2013 on a Windows 7 PC.

    I'm trying to figure out which of the two cases is the one who seems to hang if the name would be better than a number.

    When using am event structure you don't we want to use a local variable.  In fact, you should only use local variables on rare occasions that they break the flow of data.  The event structure is fine for the entry.  The problem is the way you treat things after that the button is pressed.  Again, I think you have to look at a design model of producer/consumer with a machine of the State in queue.

    The best way to have a writing occur only after a button must have the code for writing in a case that is active when the button is true and is simply empty, when it has the value false.

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

Maybe you are looking for

  • 15 - r074TU: laptop does not connect to the router

    Day sum... .my laptop (model No. 15r074TU) with window 8.1 does not connect to the router that is D-link I uninstalled my driver reinstalled again, but it didn't work... even if I formatted my laptop, reconfigure the router and... done with all possi

  • where is the complete status bar?

    I'm on version 7.0.1 and the status bar on the bottom will only appear when he does something, and even then he abbreviates certain links if they are longer than the status bar. It is not terribly useful when programming. I don't know that allows you

  • Time output USB-6009

    Hello guys,. I am trying to create a simple VI to generate two outputs analog square with USB-6009. Each output supplies a LED and it is necessary that single LED shines at the time - so when Out0 is active, Out1 is zero and the other way around. To

  • wireless network connection to publicnetworks automatically continues and won't let me not uncheck the box

    I continue to uncheck the box automatically connect and it occurs again, I can't delete the channels in the list.

  • Using APEX_APPLICATION_TEMP_FILES in the DB package

    Hi allI have a problem using the new view of Apex APEX_APPLICATION_TEMP_FILES inside the database.My procedure will always return no results, using the old vision-WWV_FLOW_FILES Apex 4.2 a similar procedure has functioned well.When you set the enviro