Jump to content

Calculate average and Max from csv file


Recommended Posts

Hii VI folks,

I have to ask two Questions.

1. I am frusty.gif to fetch the values from csv file and want to calculate the average, max and min.

2. Lets say i have 100 readings in csv file and i want to calculate Max, min and average from 10-90readings. the reason behind this, i want to skip (0-10 and 90-100 readings) the constant values from beginning and at the end.

Thanks

-Hasan Karkra

Link to comment

Read the values into an array (sounds like a 1D array) then use the array subset feature to get an array which has an offset of 10 but getting the rest. Then get a subset of that which has offset of 0 but length is array size minus 10. This will give you an array of 80 values. Perform operations on these 80. There is a maximum and minimum array function, and I think average as well.

Link to comment

If you post what you have so far we could help a little better. If reading your CSV is the issue, post an example of the CSV as well.

I want to create a VI which fetches the information from .csv file and at the end GUI comes up with Avg, Man and Min values. This is my short term goal or project. I am beginner in VI. So, by following this fact am tiring to do this task step by step.

  • Fetch information from CSV file.
  • By using array function, calculate the required parameters.
  • Output pops up in GUI.

My approach is this. Sorry to say, i don't have VI file to upload.

Link to comment

  • Fetch information from CSV file.
  • By using array function, calculate the required parameters.
  • Output pops up in GUI.

You seem to have broken down what you need well. Have you looked through the pallet at what primatives and VIs are present? Looking through the File and Array palletes should make what you need to do obvious.

I expect you're going to get limited help until you've shown you've tried to do something especially as this sounds like a homework assignment.

Tim

Link to comment

post-18502-0-75886300-1291311776_thumb.jThanks for your group support. Here is the working VI.

This doesn't look like it should work since you have a race condition on your Max Index(es). You really should use wires instead of the value property node. On another side note: locals are better than property nodes for getting/setting a value from a control/indicator, but a wire is best.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.