LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calcular promedios de array (de variables) en base a dias, meses y año

Solved!
Go to solution

Me asignaron la actividad que se muestra en la imagen, pero no sé cómo separar los datos en base a los días, meses y años como se indica en los incisos B) C) para promediar como se solicita ya que tengo todos los datos juntos, el primer inciso lo logré pero los siguientes dos no los comprendo. si pudieran instruirme se los agradecería 

 

MiqueasGod_1-1761203296445.png

 

Download All
0 Kudos
Message 1 of 7
(219 Views)

Mejor escríbelo en inglés.

0 Kudos
Message 2 of 7
(211 Views)

Hi Miqueas,

 


@MiqueasGod wrote:

I was assigned the activity shown in the image, but I don't know how to separate the data based on days, months, and years as indicated in sections B) and C) to average as requested since I have all the data together. I managed to do the first section, but I don't understand the next two. If you could instruct me, I would appreciate it.


First at all: to read a CSV file you don't need any RGT functions.

Use the simple plain ReadSpreadsheetFile function instead!

 

To filter the data by years/month/day you just need to check the data of the first 3 columns.

Use an autoindexing loop to get each row and use a conditional output tunnel to output that row based on your filter condition.

See how far you get!

 

Please ask for specific questions: we will not solve your homework for you! Show some effort and we will help you…

Best regards,
GerdW


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

Hello GerdW,Thank you for your response and explanation! Following your suggestion, I plan to try using a For Loop with auto-indexing to process each row of my CSV file.

Although I’m not quite sure how because I haven’t seen many examples.I wasn’t asking for the complete solution, just a clarification on how to logically separate the data in LabVIEW. Thanks again for your guidance!Best regards,Miqueas

0 Kudos
Message 4 of 7
(142 Views)
Solution
Accepted by topic author MiqueasGod

hi Miqueas,

 


@MiqueasGod wrote:

Although I’m not quite sure how because I haven’t seen many examples.I wasn’t asking for the complete solution, just a clarification on how to logically separate the data in LabVIEW. 


Like this:

Be careful with comparing float values, usually you should not compare for equality. In this case it will work because the date values are integer data…

Best regards,
GerdW


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

Hi Miqueas,

 

suggestion:

I would create a "filter" subVI with 3 inputs:

  • timestamp of the current data row, mode from all date/time entries
  • timestamp_start
  • timestamp_end

This subVI would output TRUE when the current timestamp is within the 2  limit timestamps.

Now you can very easily filter for

  • whole years (from 1. January 0:00 to 31. December 23:59)
  • specific days (from 22. October 0:00 to 22. October 23:59)
  • even for hours (22.10. 13:45 to 22.10. 14:44).

You just need to create the correct limit timestamps for the InRange check…

Best regards,
GerdW


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

Thank you, GerdW. I have managed to separate each month I need from the database using the filter. I did it twelve times since I needed each one of those data sets in order to then filter the days by month and finally average the variables for each day. Now I have an idea of how I could do the rest. Once again, thank you very much and have a great day.

0 Kudos
Message 7 of 7
(115 Views)