LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A question about Waveform graph

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

 

OesenUpdate.png

Best regards

Oesen
0 Kudos
Message 1 of 13
(3,992 Views)

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.

Message 2 of 13
(3,988 Views)

Thanks for the reply

 

How do i define my frequency ?

Best regards

Oesen
0 Kudos
Message 3 of 13
(3,958 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 13
(3,954 Views)

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.  

Best regards

Oesen
0 Kudos
Message 5 of 13
(3,933 Views)

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.

Message 6 of 13
(3,926 Views)

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.

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
Message 7 of 13
(3,908 Views)

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

 

Best regards

Oesen
0 Kudos
Message 8 of 13
(3,881 Views)

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.

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
Message 9 of 13
(3,875 Views)

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.

Message 10 of 13
(3,873 Views)