LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I filter through a data set based on user inputs

Solved!
Go to solution

Hello everyone,

I am trying to filter through a data set, acquiring only the files that meet the users conditions.

I am asking the user to input three different values, one for a start frequency another for a end frequency and also a value for power handling.

The way that I am filtering through this data set right now is by utilizing a function called the match regular expression function as well as the scan from string function to break up the filename as well as take away the numeric data, then compare that data to the users inputs.

These values that meet the conditional statment will then be passed to a results ring for a user to go through.

Right now I fill there isn't much functionality in this method the user has to be very careful in how he or she saves the files so my program can work properly.

I am ataching a picture of that portion of the program.

Thanks for the help.

0 Kudos
Message 1 of 8
(3,501 Views)

So are you currently storing the three user parameters in the file name?  If so, the method you're using is just fine.  Though instead of asking users to specify these filenames manually, you could programmatically generate the file names based on the parameters used when the data is originally acquired and saved to disk.

 

If you want to remove the need for adding parameter values to the file name, maybe you could add the parameter values to the beginning of each file, then filter baed on reading that data.

Cody A.
0 Kudos
Message 2 of 8
(3,376 Views)

I'm not an expert on this, but I believe that the TDMS file structure allows you to "parameterize" your files by criteria such as you describe, allowing you to run routines that will show you the various choices and allow you to select (in a natural way) the files you want, create reports based on those files, combine the data in various ways, etc.  Check out NI's TDMS White Paper and see if this would be helpful.

 

Bob Schor

0 Kudos
Message 3 of 8
(3,368 Views)

Yes so currently I am storing the user parameters in the filename. Which looks something like this, Antennas_1000MHZ_180000MHZ_50Watts, I think I'm going to have to stick with making  the user enter those parameters manually, I am trying to build a dataset of a whole buntch of s-parameters for equipment utilizing a Vector network analyzer, and the frequencies at which the equipment opperates isn't what is actually being recorded.

I also didn't understand the second statement you made, would you mind ellaborating, I will try doing anything if it wil increase the functinality as far as naming convensions are concerned.

 

 

 

 
0 Kudos
Message 4 of 8
(3,349 Views)
Solution
Accepted by topic author ztjackson

I think my second statement was to check out an NI White Paper on TDMS.  Did you notice the color?  It was a clickable link.  If you read the material there, it should clear up any confusion in the earlier part of my post.

 

I have a colleague who, like you, encodes parameters of the study in the (very long) string of the file name.  I always yell at him about this, as it requires him to (as you are contemplating doing) build routines to (a) parse the names (to recover the information hidden in them), (b) organize the data in some form of "LabVIEW Database", and then (c) figure out how (in LabVIEW) to write "queries" against this Database.  Plus the filenames aren't particularly easy for a human to read, are exceedingly long, and invite further mischief (have you thought about putting your files in folders that are similarly "file-information-coded"?  Gets even more messy faster).

 

You might think "Oh, it's too late to make a change, I've already got all this data", but what good is it if you can't easily analyze it, group it, sort it, etc.?

 

Bob Schor

0 Kudos
Message 5 of 8
(3,313 Views)
You might want to consider using an actual database to store everything in one place with properly linked tables. Numerous, separate files are just harder to maintain, in my opinion.
0 Kudos
Message 6 of 8
(3,280 Views)
Yes, what Sir Dennis said. Plus using file names to store important parametric data is very bad policy, and for a whole lot of reasons. In a database the problem is solved by the query you use to extract the data.

And if you have someone who needs access to the data, a database that is network-enabled solves that problem too. Even Excel can automatically access data in a database. Or you could export the data as a file for the one guy who needs it as a file.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 8
(3,260 Views)

Thanks for the info, I'll have to take a look at the information you posted, it seems to me though using a database software would be the way to go.

The only unfortunate thing is I am a summer intern, and there are some requirements and constraints that my program must meet, my superiors are more worried solving the challenge set by those guidlines instead of actual usability. I ran the using a database idea by them, i'm not all to familiar with databases myself, and they said no,followed by we could have had you use other methods that would make the program easier and more effective but they are looking for me to take away something more from the experience. Whatever that means "sarcastic voice"

0 Kudos
Message 8 of 8
(3,144 Views)