11-18-2012 01:45 PM - edited 11-18-2012 01:46 PM
Just started on labview and would like to get started on a simple project. Here's the process flow I'd imagined.
1. Enter numeric control
2. Press OK
2. Scans a spreadsheet file and locates the row for that numeric value
3. Outputs colunms 2 as a numeric indicator nad colunm 3 as a string indicator
11-18-2012 03:48 PM
What have you got so far?
11-18-2012 05:16 PM
I think I just completed it however would like to know if there is cleaner/easier way of writing this.
Thanks,
11-18-2012 07:35 PM
There are several things I would suggest.
1. Remove the 1-iteration For loop. It does nothing.
2. Only read the file one time. With your small file it is not a big issue but if your file was ~100 MB your approach would crash with out of memory errors. Second, the information is all there so why not just process it?
3. Since you do not do anything with most of the data, just convert what you need.
A. Change the "Numeric 3" control to a string control and use Match Pattern to find the matching string in the string array.
B. Only convert Lever Block to a numeric data type if you are going to do some math. If all you will be doing is to display it, leave it as a string.
C. Only do the conversions and update the displays if a math is found. Users have been known to type things incorrectly.
4. Make the data type of the controls and indicators match the data. Numeric 3 and Lever Block should be I32, not DBL.
Note that I saved the data from the file in controls with "Make Current Value Default" so I did not need to read the file each time during development.
Lynn