Extraction of the data at the request of the race while loop
Hi all
Can anyone help please with the attached VI. Basically, I want to add another button and every time that you press this button, I want the data inside the loop to write once to the worksheet and not at any time before. I want continuely run the loop.
Please, try to help with a sample VI. I'm fairly new and have difficulty finding the right building blocks .
Best regards
Maiz
Use a button inside the loop. Put the code to save the data within a structure of matter inside the loop.
Tags: NI Software
Similar Questions
-
Control of the event: how to stop the race while loop within a structure of the event
Hello
I have some problems with control of a while loop inside a structure of the event (see annex VI).
I have 3 buttons (the "Start measurement, stop, exit the program"). When a measure is running, it should be possible to stop the measure by clicking on "Stop the measure", but it does not work.
Someone at - it an idea?
Thank you very much and best regards,
Michael
Hi Michael,
create a process parallel to your measurement. You can use the design model "producer/consumer with vents. You'll find it with «File-> new...» ».
Another possibility would be to remove the "lock frontpanel" sign, in the case of event start measurement.
Mike
-
I have a question about the order of execution. In the WHILE loop, I have two things to measure, period and tension using the DAQmx READ functions for voltage and the meter. In the end, I want to collect these data as points almost simultaneously as possible, as a pair and then send them together to another piece of code (not shown here) which them will result in some sort of command for an engine. It would be run, and then I want to perceive the tension and the period at a time later and do the same thing.
(1.) I'm a little confused on what the meter of the READ function is back because it's a table. What is a picture of? I thought that it was up to the value of the individual periods between rising edges. The output of the counter 1 DBL d's a table. How many elements in this table, and what determines the size of this table? Are the elements of the array the individual delays between the edges? How many values are stored in the array by executing? We take the AVERAGE of the last 15 items, but do not know if we are throwing some of the data or what. How to understand the composition of this painting? How can I change the composition of this painting? Is it possible to measure only one period at a time, for example the time between TWO edges?
2.) Will this WHILE loop execute as it gathers tension and a "period table ' (remains to be understood by me) by TIME running in a loop? In particular, we want that the value of the tension associated with the value of the AVERAGE of the period "array", so we can use two data items to create orders of next control every time that the two values are reported. The structure for the delivery of vi will be attached data in pairs like this? I understand that one of the READING functions run not before the other function of READING in the WHILE loop. I want that the period "means" and "strain (Volt) collected at the same pace. This vi will he?
Thank you
Dave
Hi David,
I suggest including the DAQmx Start Task function. If it does not start before the loop, it starts the loop and work very well, but it is not as fast and efficient. In the model of task status, task wiill go to run the checked each iteration of the loop and then back the time checked running when it restarts.
The status of the task model: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/
Kind regards
Jason D
Technical sales engineer
National Instruments
-
Can not on the button while loop
Hi all... hoping to get a few design tips as I am very, very new to LabVIEW. I got a project that someone else had started and I've encountered a problem that I don't know how to solve.
I'm using LabVIEW version 8.0.1 and I think my problem has to do with the help of DAQmx in a while loop. In "Working.vi" (including the Sub - VI 'Temp data to CSV.vi'), I copied - and stuck the while loop in a vacuum VI for testing. In this VI, with nothing else, it works - slowly, but it works.
In the real VI, I can see the data of temperature updated every 4 seconds, so I know that the program is not frozen or something like that. However, by pressing the button "Return to main Menu" does nothing - the image of the button does not show that it is to be depressed, regardless of how many times you click or click and hold the button. I've attached a screenshot of the while loop inside the real VI; I prefer not to fix the real VI (especially because it contains references to many of the Subvi, and it is not currently contained within a LAW degree).
I'm this coding the wrong way? I have the feeling that it might be caused by my settings DAQmx (continuous samples, 2 samples to read, 250 mHz). The very low rate would be the cause? Is there a better way to have readings of temperature taken every 4 seconds (approximately)?
You have your case of event the value "lock the front panel" until full? If so, then no other presses the button will be recognized until the ongoing case event complete.
It is never a good idea to have a code in an event business that takes a long time to run. It will make your UI seems to lag or even functional. Any time I see someone with a while loop inside a case of the event, I'm afraid. (By the way, I am also concerned all nodes comments hovering over the structure of your event? What are doing? Why some operate on the default data?)
In general, events should take is no longer running then what ordinary person could be expected until they feel like the user interface is delayed. Perhaps at the top of 1-2 seconds. You should look at a model of design of producer/consumer with events. The structure of your event should respond to UI events, then pass orders by a queue path to the part of your program that does the real work.
-
Write on the worksheet while loop problem
Hello dear Labviewers. I have a 'writing on spreadsheet"with a table 2D DBL connected on it, but the problem occurs inside the while loop. I want exactly those time six values in my excel document, but it restarts after every "two seconds" and I cannot get rid of this problem. I want exactly the same numbers in the Excel document as it is in the table.
I tried to move the two "write to the spreadsheet' boxes outside the while loop, but the Excel document does not display a single value in the table, when I do this. It shows that the two headers
My second problem is rounded off on the numbers. Even if I wrote "%.6f" in the part of the format, it gives me a single decimal value.
Thanks in advance
Orlando
Orlando says:
Thanks for the help Ravensfan
But the "worksheet to write" not a not an output port, then how can I do this?
I downloaded my VI
I never said anything about writing about a spreadsheet file with an output port.
See the attached VI for changes. It's only the new data of this iteration of the loop that will write it on the spreadsheet file VI, not made all of the table from all iterations. There is an entry of table 1 d to the spreadsheet file.
-
structure of the event + while loop
Hello, I am trying to understand how to unite two while loops in attached VI for half a day
The first loop creates a state machine solid which reacts on each key and runs one of the structure cases. (that part works very well)
The second loop, always generates the random number, but it stops the generation during the time where one of the structure cases events are executed. (this is the part ticky)
Any suggestions?
If you want your random number to stop so that the user triggered events are running, you should be able to simplify your design a lot.
It can be done with a loop using the case of timeout.
-
Stop the multiple while loops in the acquisition of Vision
Hi, I want to close multiple while loops with a STOP. I use the software for the Acquisition of the Vision for the recording of multiple cameras and I would like to finish this record from all cameras simultaneously. I don't know how to do this since I am knew to LABView. I would add my VI here and maybe someone can help me. Thank you!
A local variable should be sufficient for your application. Read the following article:
-
Help with the weight of the race while drawing objects
From today, every time I have to draw any object (square, ellipse, etc.), the weight of the race is VERY thick. I went to the dash Panel and it is set to 1 point, so I'm puzzled
as to why he was so thick drawing. What else can be the cause of this problem?
Here is an example of an ellipse. I just drew and have not changed at all. The plan should not be anywhere near what a default thickness:
Thanks in advance,
Andy
If that's what you see, you don't have step 2.
The tool of the artboard in the tools on the left of the document window Panel and looks like a Tic-Tac-Toe.
After choosing the artboard tool, the Panel popup control changes to display options for work plans.
In addition, if you are wondering what caused this: when you created the original work plan and that you have entered in dimensions, such as 8.5 by 11, you had your units the value of points or something else except thumbs (or what unit of measure you actually intended). The computer does not do what you want it to do. To do this, what you tell it to do.
Happy Artboarding! :-)
-
Extraction of the files while retaining the name of the page
I have hundreds of pages in my pdf document. Is there a way to extract the pages to single files without losing the page name? It always seems the name of the file by page number, when I extracted the pages.
Thank you
Rob
It can be done, but it takes using a script.
-
A result of sending the data to a while loop through another loop of TCP communication
Hi all
I have 2 screws
1 matching model (using the method of Grab) which is put inside a while loop. This VI works correctly and returns a string in a specific format (position and the angle of the object).
2 TCP server who always listens to a specific port, if it receives a correct command string, it sends the string above VI - 1 (position and angle).
The two 2 screws works if they are in separate VI. But I want to combine them into 1 single VI and I get the problem: Pattern matching doesn't work anymore (the video has only first frame then stops).
I tried to put the two while loop in parallel or put the TCP while loop inside while loop Pattern Matching. Nothing has worked.
Pls see my attached VI and the TCP module.
What is the solution for requirement?
Thank you all!
What I would do, is be your two screws at the same time. Given that you do not send the last result, store the result in a global variable. Your comparison models written VI the global variable of the results of each iteration of the loop and the TCP bed module global variable results when it receives the right to order and then send it.
-
Hello
I am trying to extract data from a time that my statements updated in what concerns the number of loop iteration. I tried to use the two local variables and travel records, but without success.
I also did the following example: http://www.ni.com/white-paper/7585/en and it works like a charm.
I've attached the PNG file with declaration of the local variable circled in red. Join a VI in the next respnose.
Thank you
No, the two while loops are stacked and not parallel, which means the outer loop cannot go to the next iteration until all code in this document, including the inside so that the loop is finished.
-
writing the file text in while loop
Here's my question about writing data to a file in a text while loop... better written as I can.
I have a case of Init where I have the user choose a path and a name. I go out the ref and then I gave, which are written to the file. The loop will take 40 000 pieces of data write to the file and return to the business of data get to collect another 40 000 data points. But when I open the file, I get only one as big as 430KB file. I'm not sure but can somone show me an example to analog data of a DAQ help, make a calculatoin on this subject, write to a file, and repeat that adding it in the same file at the end of previous data?
See the attachment for LV 8.0 versions
-
How to stop the While loop in the Structure of the event with the same button?
Hello
I have a problem. I want to use a single control to activate an event in a structure of the event and the same control to end a while loop in this case.
It is possible to use 2 controls to do this, but I need to be alone.
Thank you
You should NEVER place while loops inside the case of the event, and it is never necessary to do. Think about it: all you have to do is spin the code. You can easily use the outside while loop for everything. Simply place the code of the loop internal (without the inner loop) inside the case of delay and manipulate the time-out period between a pending finished and the infinite (-1), depending on the State of the Boolean value.
A very simple example (LV 8.0)
-
run a while loop in separate vi, minimize the window flashing
My apologies in advance for not including a VI; I cannot give it, cannot even provide screenshots.
I have a state machine base with a cluster of Boolean values that are analyzed in the 'default' State, the scan index = true determining the next State. All other States to return to the default state. The State of 'stop' stop the loop with a Boolean constant = True, located inside the structure case wired to the time entry conditional loop (all States have a Boolean constant False wired to it). Apart from the cases
statement, the wire connected to the conditional entry is connected to a Boolean indicator, ' Stop, in really. The time delay within the State of the machine while loop is currently set at 100 ms.
In addition to the 'State' shift register, the state machine has a "boolean" shift register. All States, except one, feeds the value passed the Boolean value through to the next State (i.e. wired directly from left to right the structure of the case). The exception is the State which inverts the Boolean value, with the output of the inverter transferred to the State following and also connected to a Boolean flag, 'Show the State', the
indicator outside the case statement but inside the while loop. All other States wire just the previous state of the Boolean value through the following State, unchanged.
In addition to the State of the machine while loop, I have a parallel while loop (scourge of the LV forums). All entered conditional loop is connected to a local variable to 'stop, really. " A True/False case in this while loop structure contains a Subvi in the case of True value. The Boolean value of entry to the case statement is connected to a local variable for 'Show status'. The Subvi, which is in the real case is to display the State of the
user.
The Subvi which provides status through its frontage runs a script in python via a 'comand prompt"vi. The necessary update to the python command send is ~ 1/second. Within the Sub - VI is a 1 second delay time after execution of the code.
It works but I'm doing some improvements with minimal impact on what I have.
Two cases of VI properties that relate to the conduct of the State Subvi (floating or default, modal does not at all):
1. with "Firm when previously closed" selected, the window switches VI (via the main switch VI) open and closed but when it is open there is the a second window flash that could cause seizures in some users.
2. with "closes when previously closed" deselected, the window remains open and it is difficult to tell the difference between the running state and is not running. In addition, the Subvi window will not be reduced for this option.
Is there a little invasive change, I have the code in force to stop a second flash described in #1 above and activate / deactivate the Subvi status window?
Thank you
Jeff
-
position in the property node is not updated in another while loop
Hello
I have a structure of the event in a while loop and I have a chart with 2 sliders on it. the chart is in the loop outside the structure of the event and it becomes a wave form when an event occurs.
in a separate loop, I have 2 cursors cursor position property. I subtracted to get their distance. but when I move the sliders on the chart which is in the first, while the loop doesnot change the values given by the property nodes in the second loop
is this something related to the structure of the event? don't needs real graphic to be updated all the time or is it ok if she becomes a waveform only on an event
can someone please help
Thanks in advance...
The value of the variable "Stop 2"is in memory still "True" so on that a second (and resulting) running that your upper loop always ends after the first run.
The display of "stop 2' LED is to be reset when you press the button"Get the waveform". making the False value.
So reset the variable button after finishing two loops or before starting the two while loops.
Tone
Maybe you are looking for
-
When I use the view source feature, the pane shows not only the HTML code, but it sticks in all Javascripts that are in an external file. In addition to this all dashes went making it virtually unreadable. I have this problem with each monosite, I tr
-
I have the Windows version I want to install on my lalptop on another computer, also, is there a way to get the product key from here.
-
Download Virtual Server 2005 or 2008 for a Windows Vista Home Premium x 64?
I am new to computers and I am not informed on a lot of what happens, I have a laptop Dell Inspiron 1545 and I want to download MS Virtual Server 2005 R2 or 2008 version, I downloaded the 2008 or thought I did, but I couldn't find it in the files he
-
Prevent a program from starting whenever I log on
When I go to my programs list in Windows Defender and highlight Dell Remote Access, the box disable is always grayed out. It won't let me choose to disable it start each time I connect.
-
Likewise, no need to be connected, the cursor is nervous and travelling all the time on the rise. XPSP3, Dell745 have you tried several optical mice, different surfaces/mouse mat, update the bios to 2.6.4 site Dell Web, updated the driver to A03 of t