LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use of the circular buffer for the calculation of the average of a current

Solved!
Go to solution

Thank you.

 

Next question. :-  If I am saving a signal data at 9.30 am, I want to create a additional time signal in hours, like if time is 9.30 am, I want a number 9.5 hrs, if time is 10.00 am, I want to generate a number 10 hrs... and save it along with my signal. Is there a way to do it?

0 Kudos
Message 21 of 30
(1,237 Views)

Hi desireddy,

 

Is there a way to do it?

Yes, sure there is a way: LabVIEW is a programming language!

 

Create your "additional time signal" just the way you need it (hint: GetDateTimeInSeconds, maybe combined with SecondsToDateTime), then save this "time signal" along with your other signals…

 

Where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 22 of 30
(1,233 Views)

Thank you. Hours problem is solved.

How to make x axis as one signal and y axis as other signal in waveform chart.?

0 Kudos
Message 23 of 30
(1,219 Views)

Hi desireddy,

 

when you want to plot "y vs x" you need to use a XY graph instead of a plain chart…

(Alternatives: When the x data is evenly spaced you could fiddle with the x axis properties of the chart. When the waveform data uses evenly spaced x data you could enable timestamp display at the x axis of the chart. When the x data of your signals is not evenly spaced you could put each sample into its own waveform cluster and still use timestamp display of the chart's x axis.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 24 of 30
(1,216 Views)

Sir, XY graph is plotting only one point and when next signal comes, its showing only one point again..It is not accumulating the signal points, where as in waveform chart all the previous data points are also displayed

0 Kudos
Message 25 of 30
(1,206 Views)

Hi desireddy,

 

XY graph is plotting only one point

A graph is plotting exactly those data that YOU wired to the graph. When you wire just one point, then you will get just one point…

 

LabVIEW comes with a huge library of example VIs. There are example VIs explaining the differences between charts and graphs!

It is not accumulating the signal points, where as in waveform chart all the previous data points are also displayed

That's one difference between charts and graphs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 26 of 30
(1,201 Views)

Sir, Like we have waveform char and waveform graph., Do we have xy char also? (xy graph is there and I can see it). I want XY chart, not xy graph.

0 Kudos
Message 27 of 30
(1,198 Views)

Hi desireddy,

 

there is no "XY chart" front panel element.

 

I repeat: When you want to plot "y vs x" data you should use the XY graph.

(Or try to use any of the alternatives mentioned before.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 28 of 30
(1,196 Views)

On your front panel, go to the Graph palette and drop the one called Ex XY Graph.  This drops an XY Graph along with an Express VI that takes the individual XY points and builds them into arrays that it feeds to the XY Graph every iteration.  Effectively it turns the XY Graph in an XY "Chart".

0 Kudos
Message 29 of 30
(1,176 Views)

I've attached a circular data buffer which accumulates a single value into a USR. It pre-allocates memory in the 'Reset' mode and uses 'replace array subset' which is more efficient.

It features an 'init/reset' state where the buffer size is pre-allocated. Then a process state where the element is inserted into the buffer in sequence.

 

NOTE: The buffer using floats is initialized with Nan - so statistics and plotting don't occur for null values. But you can initialize the buffer as you wish - modify the code.Circular Buffer Init Diagram.png

 

Circular Buffer Process Diagram.png

 

0 Kudos
Message 30 of 30
(781 Views)