LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot the samples collected after some seconds

Hello,

I am currently plotting the samples after collectign them with collector and specifying the number of samples int eh collector like '1500' or '2000'.

Can someone explain me of how to plot the samples in a graph after 'x' time inplace of specifying the number of samples collected I would like use seconds duration.

The vi plotting the samples collected with collector is attached.

Thanks.

0 Kudos
Message 1 of 5
(2,677 Views)
This is just simple arithmetic. Time for single acquisition is number of samples divided by samples per second. Since you know those, you can easily calculate the sample count for the collector.

Don't use express VIs if you want a more straight forward approach.
0 Kudos
Message 2 of 5
(2,656 Views)

There are properties for graphs that allow you to set an offset (starting count for the x axis) and a multiplier (how much the x axis value increments between samples.

 

Of course this will only work if the data is being sampled at a constant rate.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 5
(2,652 Views)

Hello,

The thing is that I am not able to get the same number of samples for evry second I verified this by running it a number of seconds with checkign each time the number fo iterations ( I think the microcotroller at the other end sending the sampling is not sampling at constant rate).

So,I want to plot the samples collected after every 'x' seocnds instead of plotttign them after collecting some 'x' samples.

The vi that I am getting samples from microcontroller is attached.

Thanks. 

0 Kudos
Message 4 of 5
(2,643 Views)

Ah, then you will have to use an XY graph. There is an example that shows all the various datatypes that work with an XY plot, the one I use most is a cluster consisting of an array of X values and an array of Y values.

 

How does the microcontroller work - is it constantly reading the inputs and you are fetching data from an onboard buffer (sort of like a DAQ board) or does it not read the inputs until you send the command?

 

If the later is the case, the issue is that there will always be variability because Windows (with all its varying latency) is timing the loop.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 5
(2,628 Views)