04-23-2012 05:31 AM
Hi
i've been working on this for a while now and i'm a bit stuck.
I've got an array which i save using write to speadsheet file. I have a list of data i can keep adding too.
I am trying to load up the data so i can retest failed areas and resave them over the top of the old data but i only want to load the serial number data required.
I'm struggling with the index of the serial number (12345/ 02 for example) i'm looking for.I don't actually think i can use the technique i'm trying to use but i am not sure how to do it.
I've included a screen shot and my text data so you can see what i'm trying to do.
I hope someone can help me.
BR
04-23-2012 07:58 AM
First, you are not dealing with Excel workbooks. You are dealing with text files. If you specifically want to deal with Excel workbooks then you need to use ActiveX. You can program this yourself, or use the Report Generation Toolkit. A user-written toolkit is available in the Excel thread.
Since you are not dealing with Excel workbooks, naming the files with an extensions of .xls is misleading.
Now, what exactly are you searching for? The example you posted does not have the text "12345/ 02". What I see is a column with "12345", some spaces, and then what appears to be incrementing value, "1", "2". It appears that the second part has been formatted to have fixed width of 3 spaces, presumably so that the value can go up to 999. Thus, are you effectively trying to find this text in the second "column"?
Be aware that since you are dealing with text files you cannot simply replace an arbitrary section. You have to read the whole contents into LabVIEW as an array, replace specific array elements, and then write it out again. You could overwrite directly IF the length of text you write out matches exactly the length of text you are replacing. So, for example, I could set the file pointer to the position of the text "55.53", and then write out the text "55.64" because the lengths are the same. If I were to write out "55.4" then it would, but the rest of the text would remain as is. Thus, I'd end up with "55.43", since I had only replaced 3 bytes.
04-23-2012 08:27 AM
Thank you for explaining it so concisely.
It does not really have to be excel workbooks as long as i can minipulate the data as i've explained. I have played with activeX but i'm abit out of my depth. I will look at the link you've included.
The amount of decimal places should be the same, although i have noticed that sometimes i save results as 54.3 instead of 54.30. I need to correct this or i will have issue as you say.
You are right about the column, it actually reads "12345/ 2". I want to search for this and load it up. The thing is, i do not want to necessarily over write colmns "I" onwards. If they are left blank will they stay as they are or will they become blank? Or if i put new values in my front panel i'd like them to be over written.
My first concern is loading up the data required, not the whole database into my array and being able to overwrite the data as required.
Can you give me some pointers please?
Thanks again.
04-24-2012 05:12 AM
Hi,
i've gone through the attached examples and i can now find the reference of the cell which is the beginning of my data set.
I'm trying to load the data into the array (which is on my front panel). Once i have done this i know i can edit it as i can already edit live data during the test.
Can some one please give me some pointers on how to load it into the front panel? I'm really struggling with this section and appreciate the help.
Thanks.
04-24-2012 05:31 AM - edited 04-24-2012 05:32 AM
Hi!
Please read my post here and the attached PDF in that post. Then check out this thread to see the toolkit in action. It's very easy to accomplish what you want, regarding Excel, with this kit.
04-24-2012 06:23 AM
Hi
thanks for the help. I've intalled the excel library but it wont allow me to use them on the block diagram.
I'm using version 2009?
BR
04-24-2012 07:13 AM
So, you get the Excel palette in you block diagram? Like this:
But you're not able to use them? I think it got something to do with that the file I linked together with the PDF in that post you read, is a copy of the folder in my LabVIEW folder, which is LabVIEW 2011.
Attached is the library itself. Maybe it needs to be coverted first. Try to open it and see if you can place some of the files in your block diagram.
04-24-2012 07:22 AM
Hi
no, exactly the same. Won't let me drag accross onto my diagram.
Can this be converted? It looks very useful to me!
04-24-2012 07:43 AM
I'm having trouble converting it. I see that some of the files have 9,0 as source and some of them have 11,0. So it seems I have converted some of them files by accident. Check if someboyd can convert it for you in this board😃 I have never done it before so not sure how to do fast. i only know how to convert single VI's..
04-24-2012 11:08 AM - edited 04-24-2012 11:13 AM
Hi
i'm trying to get my search function to work but its just not happening.
I've attached a pic. What i want it to do is search the file, find the index and then show the lines of data depending on what MCPC fibre number is set to. IE. if its sent to four, it shows 4 lines of data corresponsing to the serial number.
Problem is idont think its finding the number correctly. I've put some visual helps in (index indicators) and it seems it scans the whole file and then just shows the first line of data.
Can some one give me a clue to what is wrong?
The txt files needs to be renamed lvm.
Thanks.