LabVIEW

cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

How to find average time taken by the data?

The averaging is fine, it is the Elapsed Time Express VI is the problem.  It is the wrong tool.  It is used only once and is in parallel to the the multiple iterations of the For Loop.

 

Look at the other functions on the timing palette.  You want to get the current time before the For Loop starts and the current time after the For Loop ends.  Subtract the values to get the time that has elapsed within the For Loop.

0 Kudos
Message 21 of 42
(1,440 Views)

Hi GerdW, I have attached the LabVIEW file of your desired version.

thank you

0 Kudos
Message 22 of 42
(1,430 Views)

I have attached my VI below. I try to use this method to find out the average data point but I don't get the average data point. What's wrong with this view. Could you please suggest to me the best idea to get the average data point of power as well as the time?

Thank you.

0 Kudos
Message 23 of 42
(1,414 Views)

Hi prabesh,

 


@prabesh99 wrote:

I try to use this method to find out the average data point but I don't get the average data point. What's wrong with this view.


Your "method" is basically this part of your code:

What does that code do?

 

  • The FOR loop iterates "n" times.
  • In this FOR loop the value of "Power" is added to a shift register: this basically is the same as replacing the whole FOR loop with a simple multiplication node!
  • The value of "Sum_power" is nƗPower.
  • Then you divide "Sum_power" by "n" to get "mean_power":

 

mean_power = Sum_power / n = (nƗPower)/n = Power
=>
mean_power = Power

 

Is this what you want to achieve? Probably not.

But that is what you programmed - and what your VI is doing!

(Btw. doing simple stuff in a very complicated way is called "Rube-Goldberg"! :D)

 

You need to collect the last "n" samples of "Power" - as I have shown you (11 days!) before…

Best regards,
GerdW


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

Dear GerdW,

Thank you for your prompt reply. I have some questions. I would like to ask you.

`

1. I Use shift register to add power. As power varies with respect to time. So, I think I will get the total sum of power. If the power is constant throughout time then I will get the same power. But I am curious to ask you that power is changing with respect to time. If I add variable power I should get a different power. But I am getting the same power.

 

2. The VI that was sent by you is not working. 

 

Thank you for your attention.

 

0 Kudos
Message 25 of 42
(1,401 Views)

Hi prabesh,

 


@prabesh99 wrote:

2. The VI that was sent by you is not working. 


Yes, there was a bug in the example. You could have found that bug on your own in the last days…

 


@prabesh99 wrote:

But I am curious to ask you that power is changing with respect to time. If I add variable power I should get a different power. But I am getting the same power.


I have explained why you get the "same power" instead of a "different power"…

(The way you wrote this question it is really hard to understand.)

Best regards,
GerdW


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

Dear Gerdw,

 

Thank you for your reply. I did what you said to do, but I got the repetition data as shown below. I do not know why I got this. I am really working hard to figure it out, and now I am tired of working in LabVIEW. Could you please help me to solve this problem? I would be really grateful if you can help me.

Thank you in advance

 

 

 

Screenshot (57).png

0 Kudos
Message 27 of 42
(1,350 Views)

Please attach your VI for LV2017…

Best regards,
GerdW


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

Dear GerdW,

Thank you for your prompt reply. I have attached LV2017.

 

0 Kudos
Message 29 of 42
(1,339 Views)

Dear GerdW,

I am a beginner. During one month, I learned a lot from LabVIEW.  However, the average data point is a hurdle for me. I learned many things from you. I hope the average data point will also solve.

 

0 Kudos
Message 30 of 42
(1,335 Views)