07-07-2009 05:14 PM
Can any one pls pls pls help me out. Iam in need of a labview code which has a excel sheet consists of 3 columns 1) S.No 2) Channel_Names 3) Value.
If a string is entered as a input and that string should be compared with the Names under Channel_ Names column in the excel sheet and if the string entered matches with any of the string under the Channel_names column then it should pass two output's
1) The value of that string
2) S.No
For example if Iam entering the i/p as "Current" then it should search the strings under Channel_Names tab and if row 8 as the "Current" string with a value of 25 amps then it should return two o/p's one as 25 and the second one as 8.
If the entered string is not matched with any of the strings under Channel_Names coulmn it should return an output as zero.
Thank You
Shanth.
07-07-2009 05:43 PM - edited 07-07-2009 05:44 PM
Do you actually have an Excel worksheet? If so, then you need to use ActiveX to read the Excel data. You could make life easier on yourself by saving the data as a delimeted text file. Then you could simply use the Read From Spreadsheet File VI to read in the file. Attached is a basic Read Excel VI that I usually post from time to time whenever this question comes up (which is about once a month), and I happen to see it.
As for the searching bit, that's just a simple Search 1D Array. You'll need to use Index Array to get the column to use for searching, as well as pulling off the data, but that's fairly straightforward.
07-07-2009 07:09 PM
Smercurio thanks for your reply. Can you pls insert the string comparison code in the Vi you gave me Iam really new to this Labview enviornment. And my application actually makes use of Excel work sheet.
Thank you,
Shanth.