LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using DAQ assistant to graph voltage vs time

Solved!
Go to solution
 I am fairly new to all of Labview and programming terms and everything related. I have been reading tutorials and everything trying to figure things out. One thing I am having trouble with is the DAQ assistant. Now, if I wanted to place the DAQ assistant on the block diagram of labview and I set everything up so that voltage will be going into the DAQ device, how would I set up my block diagram so that I can obtain a graph of voltage vs time in which data doesnt start recording until the voltage reaches a certain voltage that I will be inputing and changing, such as 30 or 40 volts. The data will also stop recording when the voltage reaches the same number. I also want to be able to multiply the voltage number that comes out by a number that I can change myself before it is graphed versus time. Example, say I want the voltage to start being recorded when it reaches 40 volts. Now, when the voltage comes out of the DAQ assistant lets say it is at a certain moment reading 10 volts and the number I want to multiply by is 5. So, I want to be able to multiply the voltage by 5 and then since it will be 50, it would start graphing that number versus time.
0 Kudos
Message 1 of 11
(4,280 Views)
Solution
Accepted by topic author vwsj

You would need to have a boolean that checks if the (amplified) voltage is greater than N.

If so, it would send that value to a graph, if not, the voltage would not get graphed.

 

Here is an example: (do not try to copy this code exactly, because it is not using a signal, but rather some integer number that is being created) 

 

 

Message Edited by Cory K on 12-22-2008 04:11 PM
Cory K
Message 2 of 11
(4,270 Views)
So to incorporate the signal, I would just replace the integer (in your case voltage) with the DAQ assistant icon correct? And this would graph the voltage vs time?
0 Kudos
Message 3 of 11
(4,267 Views)

vwsj wrote:
So to incorporate the signal, I would just replace the integer (in your case voltage) with the DAQ assistant icon correct? 
Correct
 

vwsj wrote:
And this would graph the voltage vs time?

 

 Yes, by default it graphs the given value vs time.

 

Message Edited by Cory K on 12-22-2008 06:11 PM
Cory K
Message 4 of 11
(4,251 Views)
Thanks for all your help:smileywink:
0 Kudos
Message 5 of 11
(4,231 Views)
Oh, one last question regarding this. If I wanted to graph voltage vs time would I just add the build table icon to it or is there something else I would have to use?
0 Kudos
Message 6 of 11
(4,225 Views)

That makes no sense. You want to graph something and then you mention using a build table function. Do you really mean that you want to do both or do you want to display the data in a table and not a graph?

 

Your oriiginal post has another confusing statement where you say you want to start graphing when a threshold is reached and then stop graphing when the same threshold is reached. In other words, you don't ever want to graph?

0 Kudos
Message 7 of 11
(4,222 Views)

I meant to say if I wanted my data to be graphed and also to be displayed in a table. It was a typo in my question. So yes I want to do both.

 

i want to graph. im going to be doing an experiment in which the pressure will start at 0 and increase and reach a pressure i input where it will start recording that data and it's going to keep increasing until it reaches the maximum pressure in which it will start to decline again and reach that number i input and stop recording

0 Kudos
Message 8 of 11
(4,219 Views)

Hi vwsj,

 

I added some steps to Cory K's code that allow you display the history of values written to a chart.  The way it is currently written will clear the string indicator each time the VI is run.  If you want it to continue logging for every run, without automatically clearing the values, simply delete the empty string constant that is wired to the initialize of the Feedback Node.

 

Since you mentioned you are new to LabVIEW and programming:  As a side note to your original question, I want to point out Cory K's use of the Wait (ms) VI.  Some sort of timing VI is a very good idea in all while loops in your code because it prevents your code from hogging all of your computer's processor time.  You may be interested in Differences Between Wait (ms) and Wait Until Next ms Multiple.

 

 

0 Kudos
Message 9 of 11
(4,175 Views)
So let's say I have everything set up as to where I am shooting a gun and the voltage transfers and once it reaches a given number it starts to record all the voltage values versus time on a graph until it reaches that same given number so it stops recording. Will the revision you made to Cory Ks code give me a table of all the data that was collected? If I want to be able to save the graph and table that was created after I shot the gun once and then I want the data to clear when I fire the gun again, would I be able to just attach the build table icon to the waveform chart or do I need to do it the way you did?
0 Kudos
Message 10 of 11
(4,163 Views)