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.
Tags: NI Software
Similar Questions
-
DAQ product with +/-analog output 12V?
We are looking to update a manual test area.
We are looking for a product DAQ with analog outputs capable of +/-12V
We are not generating waveforms. Just using LabVIEW to a tension he set in the range of - 12V and + 12V.
OR anything with this ability he selling?
I found the NI PCI-6703 and would serve our needs except that it is +/-10V.
Good morning New York,
Consider the SMU-4322 or NI 9269. The SMU-4322 supports + / 16V by channel. The NI 9269 has 4 (+/-10V) channels that can be cascaded for isolated older tensions.
Kind regards
Izzy O.
Product Support Engineer
NI.com/support
-
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
-
Strange problem with analog output PCI 6251 and BNC-2110
I'm controlling current source of third parties using the connectors of analog output on my card PCI 6251 and BNC-2110.
The current source needs an input signal of 0.1V. I tested it using a battery, the potentiometer and the voltmeter, and by manually adjusting the voltage of power current works - current output with control voltage scales according to the specifications and is relatively stable.
The data acquisition card works too - when I connect a voltmeter to the AO0 AO1, the measured voltage corresponds to the target with great precision value.
But when I connect the current source of third AO0 AO1 data acquisition card, the measured output voltage drops and fluctuates. This applies to both channels of the AO.
I wonder what is the problem here. I suspect it could be a matter of the grounding - the current analog control of the source is an entry with two floating terminals differential. I tried to return the switches FS/GS on the BNC-2110, but that makes no difference.
Anyone knows similar behavior? Does anyone have any suggestions?
-
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
-
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...!
-
Problem with analog output card FPGA 7851R
Hi all
First of all, I am a beginner in FPGA programming.
In my application, I'm generating an analog voltage, for example 6V in a FPGA 7851R card is placed in 1033 PXI. I'm passing this tension to an another PXI with LabVIEW RT. Instead of getting a continuous 6V I'm getting some spikes with 6V. I enclose the screenshot of waveform which has obtained in PXI with RT the PXI card used is PXI-4462. I also enclose the code. Why am I getting this ears? Will there be another procedure to generate a continuous signal? Is there any problem with the acquisition?
Please help me
Thank you & best regards
Rajesh R. Nair
Thanks sumit.
Problem is solved!
-
What is the best way to Sync Output (TTL) digital with analog output?
I'm trying to generate analog signals that synchronize the rising edge of a digital signal (TTL). The ttl will be the trigger for the camera. The advice I have is USB-6343 X. In my project, I used a clock as a ttl so I can give frequency easily. Could someone tell me what is the best way to accomplish this task? My project seems to work, but I hope it has more neat way. Thanks in advance for any help!
Kind regards
Eric
Hi Econg,
They should be nanoseconds, if any, there is a trigger of material goes with a hardware clock.
-
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.
-
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
-
Reconciliation of analog output NI USB-6210
Using Labview, I am currently using an NI USB-6210 to produce a signal that a BOP of Kepco 50-2 M feeding programs. Unfortunately, this device NOR produced no analog voltage. Is it possible that I can use the digital output or against the unit OR to do something that approximates an analog output? I need a way to get the power output voltage has the supply to increase gradually in a predefined way. I only work with a couple of volts because of sensitive equipment, so accuracy is important.
I don't have access to the program at the moment so I don't know what version of Labview that I use, but I'll be able to check in a few hours.
Its probably not worth to use this device in a method not scheduled. Cheeper with analog outputs are available.
And don't forget the 4886 BIT card that can be purchased and hooked to your diet, there are even for using RS232 or GPIB device drivers to control the supply to
-
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
-
in firefox does not display of Southern tag Team Championship =""
in firefox does not display a Southern tag Team Championship = "" link or the photos but in chrome and other browser is displayed. " Why? Where a problem?
-
I would like to disable the back/forward buttons for all sites
My boss is crazy... lol... he wants me to remove the buttons back and forward across our browsers Firefox, to limit abusive personal internet usage. I don't have a solution to script. I am looking for a solution of parameters of Firefox. Thanks in ad
-
Course of time disconnected from the Internet
Course of time is a/c model with hard disk of 2 TB, clinging to the Netgear CM500 Modem and ISP is Cox Phoenix. Connected devices include 3 iPhones, iPad 1 Air, 1 Macbook Pro, an Xbox, Nintendo DS, Wii U, Apple TV 4gen, 3rd - party transmitter Airpla
-
How to recover Windows Journal?
I recently bought a laptop. It is pre-loaded with Vista Home Premium, and many other goodies including a program called Windows Journal. I've even more recently updated for Win 7 Home Premium. While remaining in Vista, my copy of Windows Journal (und
-
Email custom clear icon blackBerry smartphones
My e-mail messages icon (and) will not clear. It says I have 19 unread messages and the only thing in my email are 2 unread messages. I did the following: Deletion of all in my messages folder Turn off the phone Take out the battery E-mail extra to