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

@desireddy wrote:

I made the following code based on your suggestion. Correct me if I am wrong.

 


code

 

That's not "code" just an image.

 

  • If you would add a "+1" after [i], you could check for "=0" on the remainder. This is more scalable, because you only need to change a single diagram constant if needs change in the future.
  • You only need one "60" diagram constant (see above)
  • Instead of the "numeric", just show the digital display of the chart. (half the number of terminals!)
  • Some indicators have the wrong representation
  • etc.

@desireddy wrote:

How to store the time (real clock time) along with the stored average value.?


You are currently not "storing" anything (whatever that means). Do you want to store in a shift register? stream to a file?

 

 

0 Kudos
Message 11 of 30
(1,383 Views)

Thank you, I was able to plot time on x axis now.

My next question is.....How to add a second sensor reading to the above said plot. When I tried to connect another data to the build waveform, The wave form char is not displaying the two curve. It is only displaying one plot.

0 Kudos
Message 12 of 30
(1,380 Views)

You are overwriting your first Y array with the 2nd Y array.

 

You need to create 2 waveforms.  Then use Build Array to turn them into an Array of waveforms to send to the chart.

0 Kudos
Message 13 of 30
(1,376 Views)

Sir, I am getting something like this(attached). Not as expected

0 Kudos
Message 14 of 30
(1,370 Views)

We cannot help if you keep attaching pictures instead of the actual VI. You currently have a single plot with two points.

 

Attach your VI and we will fix it! We won't waste our time trying to recreate your VI from scratch using a truncated picture as a guide..

0 Kudos
Message 15 of 30
(1,363 Views)

@desireddy wrote:  How to add a second sensor reading to the above said plot?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 16 of 30
(1,380 Views)

Again, your sampling rate is fixed at 1/minute (in your latest image. No way to tell what's in the other case, though), and the samples are spaced equally in time. There is no need for the gimmicky "sporadic waveform", just set t0 (from get time in seconds) and dt (60seconds) when the program starts and just bundle the two values for the chart and set the x-axis time format for absolute time.

 

Here's an alternative to Tim's code above. It scales better if you later decide to add more traces, for example.(Still I don't think you need any of this!!!)

 

TwoSporadicTraces.png

 

0 Kudos
Message 17 of 30
(1,374 Views)

Thank you sir,

 

If one of my signal is in temperature (degree C) and other signal is in heat flux( Watts/sq.meter) , How to plot both of them in single waveform chart. with degree C scale on left Y axis and Watt/sq.meter scale on right side Y axis with time on x axis common for both

0 Kudos
Message 18 of 30
(1,346 Views)

right-click the y axis and select "duplicate scale" and "swap sides". Name scales as desired.

Now go to the plot legend and select the desired Y scale for the plot that should use the other scale.

Message 19 of 30
(1,342 Views)

Hi desireddy,

 

1. create an additional Y axis in the chart

2. swap the side for this additional axis

3. edit the axis labels to reflect your signal names

4. assign your two plots to their axis

All this is done using a chart and its context menu…

Best regards,
GerdW


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