From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture the data within the given range of maximum and minimum values ? from csv files


My requirement,

 

1. Here, the user will provide the range like maximum and minimum values, based on this range, the VI should capture the data within the given range. ( from CSV file as attached )

2. Then VI should calcluate the average value for captured data and export it to excel.

 

This is my requirement can anyone help me on this.

 

Many thanks in advance
rc_cks

0 Kudos
Message 1 of 6
(3,247 Views)

 

Where is your VI ?

 

We are not here to do your work for you. Make an attempt first then we can help with advice.

0 Kudos
Message 2 of 6
(3,240 Views)

Hi,

 

Thanks for remnding me. I forgt to attach the VI, 

 

Here I am attaching the VI, what I tried. 

 

From attached CSV file, I have to find an average value for columns B,C,D,E,F,G,H,I and AJ, AK. ( data range will be defined  by user ), focused only on these columns

 

Here, the scope is to calculate an average value for given data range by user as MAX and MIN data.  

 

FYI:  I tried manually for two instance i.e column H & I.  As per H column one steady state values from  7500 to 10500 and similarly in I column 7875 to 10050. So, I gave these as a limit to capture and calculate the average value. But unfortunaltely, requirement has been modified as per below requirements.

 

More Info on requirement: 

 

--> The user will define the range of data by giving some MAXIMUM and MINIMUM values(for above mentioned columns induvidually), then VI should capture          that data range and it has to caculate the average value for that range of data. This is the task I have to complete. 

 

--> I am stuck in creating a logic for data capturing for given range of MAX and MIN value from user, 

     Can anyone help me on this. 

 

If my explanation is not clear, Please let me know.  

 

 

Many thanks, help mw

rc

Download All
0 Kudos
Message 3 of 6
(3,204 Views)

Takeout user defined column from 2D array (which you’re getting from csv) and pass it to For Loop.

And check every value with user defined limits (you can use “In Range and Coerce”).

Take out the resulted data & do the average.

Munna
0 Kudos
Message 4 of 6
(3,186 Views)

Thanks for giving me an idea.  I have never used Range and Coerce before. I will try this approach.

 

Thanks,

rc_cks

0 Kudos
Message 5 of 6
(3,146 Views)

I also recently learned of the conditional for loop. So you can wire the "In Range" output to a conditional terminal and then the indexed array output will only have the values you want. No case structure needed!

0 Kudos
Message 6 of 6
(3,132 Views)