10-22-2012 03:30 AM
Hello everyone.. I have made a waveform graph to measure pressure with my DAQ NI-9237. The problem is the time value in the x-axis shown on the picture below. It only shows the measurements from 0 to 1, but i need from 0 to 4 seconds.
Thanks in advance
Oesen
10-22-2012 03:42 AM
Hi Oesen,
The graph just plots the latest sample buffer acquired, based on the sampling rate. If you're reading 1000 samples at 1kHz, you'll have a 1 second window on your graph.
Thus, if your acquisition is supposed to last 4 seconds and you want to plot it all, you can just set the appropriate sampling settings (4000 sample @ 1kHz ?) or just use a Waveform chart instead of a graph so that the data is concatenated.
Hope this helps,
Regards,
Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.
10-23-2012 05:08 AM
Thanks for the reply
How do i define my frequency ?
10-23-2012 06:05 AM
It seems that you are passing only the measurement values (Y) to the graph. So the graph does not know anything about the timing information.
You have to check if you can retrieve the data from the device using a WAVEFORM, which includes the data points (Y) as well as timing information (t0 and delta t, which is the inverse to the sample frequency).
If you cannot retrieve the data as a waveform, you might want to check modifying the scaling factor for the X-axis. In your case, you'd expect a factor of '4'. Beware: Configuring this statically in the graph could lead to questions like yours when using a different sampling rate. So it is possible clever to set this factor by a property node...
Norbert
10-23-2012 08:00 AM
The graph updates very late and gives the final screenshot value of the data, but i need af graph which updates very fast and shows the data continuously.
10-23-2012 09:38 AM
The update rate is dependent on how many samples you request and how often you request them. Please post your code. It's impossible to say how you can improve it without actually seeing what you have done.
10-24-2012 02:16 AM
Hi Oesen.
A Waveform Graph accepts arrays of data and plots all the data at once, whereas a Waveform Chart remembers and displays a certain number of points by storing them in a buffer. It sounds like you want to use a Waveform Chart.
Have a look at these KnowledgeBases:
What Is the Difference Between Graphs and Charts in LabVIEW?
http://digital.ni.com/public.nsf/allkb/95FEE9F5B252507E862562BA00007657
What Does the Waveform Chart History Mean?
http://digital.ni.com/public.nsf/allkb/6685B295992F6F338625718C00606500?OpenDocument
As Dennis_Knutson says, you can post your code, and we will be able to help to futher.
Have a great day.
10-24-2012 12:59 PM
I have used a waveform chart instead with better results.
The chart is running too fast. I use the relative time, and it goes up to one minute (1:00) after few seconds. How do i change that ?.
I think it must be the ratio between the sample rate and number of samples ?
I have uploded my VI
Thanks in advance
Oesen
10-24-2012 01:42 PM
Hi Oesen.
It's because you convert your data to a double, which does not contain any information about the time. Instead, simply delete the 'Convert from Dynamic Data' and wire in the dynamic data directly to the chart. The Waveform Chart supports this datatype as well.
Another solution is to keep the 'Convert from Dynamic Data', but instead of converting the data to doubles, you convert to a waveform. You do this by dobbel-clicking on the function and select 'Single Waveform' in the list. I personally think this is the best solution, since you are now able to work with your data in a way the dynamic datatype won't allow you. Try and wire the waveform to 'Get Waveform Components' and see how data is stored.
You can read more about the waveform datatype here:
Using the Waveform Data Type in LabVIEW
http://digital.ni.com/public.nsf/allkb/B965F316364DE17B862572DF00363B10
I hope this information is helpful.
10-24-2012 01:47 PM
The chart is updating exactly once a second because your number of samples and the sample rate is the same. It's simple arithmetic. Divide Number of Samples by Samples/Sec to get the acquisition time.
If you want to display real time on the x axis, then get rid of the Convert From Dynamic Data function. You've thrown away all timing information by using that.