LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find average time taken by the data?

I am using a Thorlabs power meter to measure power. I use LabVIEW in order to control it.

Now the question is how can  I find out the average time taken by the data. for example, it measures 4.145 E-5 at 0 sec, 4.148 E-5 at 0.055 sec, 4.141 E-5 at 0.061 sec, and so on. Here, the time interval between the 1st data point is 0.0055, and the second data point is 0.01 sec. 

now I need the average time interval to say 1 sec so that power also should be average. suppose, I need data of 0, 1s,  2s, and so on and the power should also be on average.  

I have attached my code as well as the data.

 

 

 

 

 

 

 

 

 

 

Screenshot (40).png

 

 

 

 

 

 

 

 

 

Screenshot (39).png

0 Kudos
Message 1 of 42
(1,898 Views)

Average time per point would be (final time - start time)/number of data points

0 Kudos
Message 2 of 42
(1,882 Views)

Dear RavensFan,

I am sorry. I didn't get you. Could you please explain this to me further? 

0 Kudos
Message 3 of 42
(1,869 Views)

Hi prabesh,

 


@prabesh99 wrote:

I have attached my code as well as the data.


No, you did not attach any code or data.

All we got are some images showing only portions of the code/data…

 

Why did you tag your message with all those names?

 


@prabesh99 wrote:

Now the question is how can  I find out the average time taken by the data. for example, it measures 4.145 E-5 at 0 sec, 4.148 E-5 at 0.055 sec, 4.141 E-5 at 0.061 sec, and so on. Here, the time interval between the 1st data point is 0.0055, and the second data point is 0.01 sec. 

now I need the average time interval to say 1 sec so that power also should be average. suppose, I need data of 0, 1s,  2s, and so on and the power should also be on average.


Please provide example data and also provide an expected result for those example data!

Best regards,
GerdW


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

I have attached my code below. I cannot attach my data so I attached the pic of my data. I hope you will understand. Let me clear it, as you can see the time interval and measured power in right side of column in the attached picture. Now, I need the averge time interval of 1 sec and the power should also be average taken by this average time interval. 

 

 

thank you

0 Kudos
Message 5 of 42
(1,834 Views)

I am sorry. I forget to attach the pic. 

I have attached my code below. I cannot attach my data so I attached the pic of my data. I hope you will understand. Let me clear it, as you can see the time interval and measured power in the right side of the column in the attached picture.  

Now, I need the average time interval of 1 sec and the power should also be average taken by this average time interval. 

 

thank you

 

 

 

Screenshot (41).png 

 

 

0 Kudos
Message 6 of 42
(1,832 Views)

Hi prabesh,

 


@prabesh99 wrote:

I cannot attach my data so I attached the pic of my data.


Why can't you attach the data file? Use ZIP…

 


@prabesh99 wrote:

Now, I need the average time interval of 1 sec and the power should also be average taken by this average time interval. 


Collect the data in an array. When 1s has elapsed you calculate the mean of the array and start over with an empty array…

Best regards,
GerdW


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

hi

how can I get the average value every 10 data?

0 Kudos
Message 8 of 42
(1,770 Views)

I am using LabVIEW to measure the power of light. I can plot the power vs time. Now I want to get the average value of every 10 data in a waveform chart and save it. 

0 Kudos
Message 9 of 42
(1,796 Views)

Hi prabesh,

 

collect 10 samples, average them. Collect next 10 samples, …

 

What have you tried?

Where are you stuck?

Why do you need to ask the same question in two threads?

Why don't you attach your VI?

Best regards,
GerdW


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