LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling the timeframe for sampling waveform

Hi,

 

I am sampling data with the DAQ assistant and am outputting this to a waveform graph.  I can control the sampling rate and number of samples but seem to be having difficulty fulfilling a specific task.  I am sampling data from a cardiovascular pulse simulator and want my graph to display 10 cycles (i.e. 10 seconds) of data.  It seems like the sampling rate and number of samples that I choose dictates the number of samples output on the screen at any particular time.  Also, I have labeled the X-axis of my graph Time but realize that it isn't actually time.  Can anyone tell me what this axis is, it seems that this is the number of samples.  I realize this question may be a little vague and I was going to include a screenshot of what I am working with to help explain what I am trying to do but don't currently have the device.  Any input will be appreciated.  I will clarify things if you have any questions.

 

Thank You,

bsteinma

0 Kudos
Message 1 of 4
(2,736 Views)

The number of samples you request is obviously the number of samples that are graphed.Smiley Wink

 

The x axis number of samples or it is time if you are acquiring and plotting dynamic (ugh) or waveform data and use that information. Make sure Ignore Time Stamp is not checked.

 

If you want to display 10 seconds worth of data, a chart would probably be a better choice. A chart appends new data to old. A graph plots an array and each time you write a new array, the old data is deleted. The way around that with a graph is build a buffer of samples so that the array grows each time yuo do a new acquisition.

0 Kudos
Message 2 of 4
(2,733 Views)

More details about my problem:

 

I've got the sampling rate at 200 Hz, and am showing 2000 samples in my graph.  That should show me 10 seconds, but it doesn't.  It shows about 1.5 seconds of data.  It seems that if I increase the difference between the sampling rate and the number of samples, Labview errors out.   It says that some or all of the samples requested have not yet been acquired.

 

I tried using a chart instead of a graph, and it is having the same problems.  Except for the x axis values, I don't see any difference in the way that it displays the data.

0 Kudos
Message 3 of 4
(2,715 Views)

I don't think you have provided enough information. If you have a sample rate of 200 Hz, how many samples are you requesting? When you use a chart, what do you have the history length set for? This has to be large enough to display all 10 seconds and the default of 1024 is not.

The error is often due to the amount of processing you are doing in the acquisition loop. Reducing that or changing from continuous sampling mode may fix the error.

 

Why don't you just post the code you are running?

Message 4 of 4
(2,713 Views)