04-21-2011 12:59 PM
I am still new to programming with labview and I am trying to configure some options on my VI. I have created an open loop response system with the NI USB 6008 DAQ...
Here are the troubles im having:
-I need to export my waveform graph data into excel when the user decides the data acquired is good (with out the right clicking option)
-also i need to create a button to clear the chart data(with out right clicking on the waveform)
-My waveform graph keeps changing to large values as shown below: I set it the x values to show only 0 to 531 then when i start the VI it goes to really large value
Can someone help guide me....
-
04-22-2011 09:39 AM
I would suggest using a command button to save your data using the write to spreadsheet file vi. A good way to do this would be wiring the command button to a true/false case statement inside the main program loop so that the program continually checks the button's status while it waits to decide if you want to gather more data or save it.
As for your time base on the graph, make sure that you know what sort of data you're carrying into the graph, you might need to edit the time stamp that it is sending. That looks like you might be reporting seconds from the start of the year 1904.
04-24-2011 08:13 PM
So i have tried doing it that way and only records data when I turned on the command button. Its not something I want to have. I need to have a button to export the data on the waveform graph to an excel sheet when the user decides he/she has good data.
04-25-2011 04:09 PM
Just curious as to which behavior you are actually looking for. Imagine you were taking 100 seconds worth of data and the data becomes "good" 40 seconds in. Do you want to take the first 40 seconds in that case, the last 60 seconds, or somewhere between the two?
Also do you want to have a chart or a graph for this? I made an example of how to clear a graph with a button if that helps. If you are using charts I would probably use property nodes.
If you use a graph you should not see that behavior with the large x-scale values.
04-26-2011 07:40 AM
Your current program structure is not sufficient for what you are trying to do. One of the great strengths of LabVIEW is that it allows you to have multiple things going on at once. In your case, this is creating and taking data and managing user requests. Depending on how you do this, you may want up to four loops, but start with two - one for the user interface and one for the data acquisition and creation.
In the user interface loop, drop an event structure (read up on event structures and look at the examples in the help). Create buttons for the actions you want. Use the event structure to create the actions when you press the button. In your case, these are fairly simple actions (e.g. write contents of graph to file).
In the data acquisition/creation loop, put your current DAQ code.
You may want to read up on producer/consumer architectures and state machines. Both are useful in your situation.
I know this is a lot of information to take in at once, but the result will be worth the effort. While you can do this with a single loop, it will be frustrating to get it to work and difficult to maintain. It is far easier in the long run to do it better the first time.
Let us know if you need more help.
04-26-2011 04:50 PM
Thanks for the input but i am not surewhich property node is connected to the true false statement to have a blank graph??...also the data I am have recorded is all the points on the waveform graph....
04-27-2011 07:57 AM
If you are using a Waveform Chart, use the History Data property. If using a Waveform Graph, use the Value property (or the terminal!). In either case, write an empty waveform to clear, read it to get all the data. There is not a simple boolean method to clear the graphs. However, there are methods to export the data to Excel or the windows clipboard.