04-28-2010 01:05 PM
Thanks Ray, well it did actually find the string of the B126460 license plate, and getting its index, but if i use anyone of the other license plates in the file it is not giving me anything so maybe it is only reading the last line of the file? But logically if we trace your program it should scan for any license plate so i dont know where the problem lies.
So i thank you again and if we can find a solution for this problem it would be great.
I also tried a different approach on an excel file but it only returned me a row of data containing garbage values and not what the cells contain.
Thanks
Amin
04-29-2010 06:39 AM - edited 04-29-2010 06:41 AM
amt1981 wrote:Thanks Ray, well it did actually find the string of the B126460 license plate, and getting its index, but if i use anyone of the other license plates in the file it is not giving me anything so maybe it is only reading the last line of the file? But logically if we trace your program it should scan for any license plate so i dont know where the problem lies.
So i thank you again and if we can find a solution for this problem it would be great.
I also tried a different approach on an excel file but it only returned me a row of data containing garbage values and not what the cells contain.
Thanks
Amin
It's not as simple as:
1) you just need a conditional terminal in the FOR loops to stop them is it? That's my usual reason for getting the last line instead of the one I want.
2) (other option) you need to transpose the array.
Disclaimer: I haven't run the code or tried to, Ray is normally pretty good, but even to good guys slip up occassionally. (If Ray's missed something, in the immortal words of South Park "Blame Canada" )
James
04-29-2010 08:37 AM - edited 04-29-2010 08:38 AM
I didn't have LV2009 at this PC so I rewrote the same thing in LV8.5.
It appears to work well. I'm not sure what you are seeing.
Here is the block diagram and I attach the VI.
04-29-2010 08:44 AM - edited 04-29-2010 08:45 AM
James W wrote:Disclaimer: I haven't run the code or tried to, Ray is normally pretty good, but even to good guys slip up occassionally. (If Ray's missed something, in the immortal words of South Park "Blame Canada"
)
Thanks James,
We all slip up.. 😉
But this one can't be blamed on Crazy Cannucks.. 😄
Here are the results from running a search for the 3 license plate numbers. It worked fine each time.
04-29-2010 10:39 AM
Thanks Ray it is working pretty fine now. You really helped me. Your VI is working pretty well for all the License Plate i am extracting.
If i may ask you for another help it would be appreciated.
I am including with this message an excel library that it is provided on one of the forums, now i tried it, and it is extracting data from my excel file but it is giving me all the data found under the License Plates column, so if possible maybe you can help me search for my specific string of characters from within the array which contains all the License Plates that i already wrote in my excel file. I also attached the excel file i am using.
Thank you again for helping me.
Best Regards
Amin
04-29-2010 05:05 PM
The library that you provided is the regular Excel functions.
Did you attempt to write some code? If you look at some of the examples in the forum, I seem to remember posting something similar to what you are looking for.
Start top implement a solution and I will help you along the way.
04-30-2010 07:12 AM
Ok,
I may have temporily lost the thread of this discussion at the moment but I will keep an eye on it to see if I can help.
2 Questions before I go quiet:
1) Can I just confirm that the VI worked in the 8.5 implementation, but not in the 2009 implementation - same BD? (Why?)
2) Ray, Do I see fuzzy wires in the FOR loop for the string input on your 8.5 implementation? - Is this "constant folding" turned on on your PC?
Ray - I wasn't seeking to blame the "Cannuks", I was blaming the scenery for distracting you from your desk!
James
04-30-2010 10:05 AM
Hey Guys,
first i really wanna thank you for your help and ray for the vi examples you provided me, even though i didnt use them but they gave lots of insight to know where to put my thinking and solve my problem.
Now i have one final favor to ask of you, i attached a vi which my excel sheet for the license plate i extract and then for most it finds it, and then i made another search from within this excel file in order to extract some data concerning the car owner, what i am facing is that some times even though the license plates are found in the database, my program seems not to read the license plate and issues me an error message, and/or it finds the license and then at the index where the string was found it can't seem to extract data, or sometimes for a specific string it just extract few data not all i require.
So please if you could find me where the problem is i would really appreciate it.
I suspect that maybe because the Read Excel.vi that i used is openning and closing my excel sheet many times that it is causing my program not to work properly as it should.
Thanks again
Amin
04-30-2010 10:23 AM - edited 04-30-2010 10:23 AM
James W wrote:Ok,
I may have temporily lost the thread of this discussion at the moment but I will keep an eye on it to see if I can help.
2 Questions before I go quiet:
1) Can I just confirm that the VI worked in the 8.5 implementation, but not in the 2009 implementation - same BD? (Why?)
2) Ray, Do I see fuzzy wires in the FOR loop for the string input on your 8.5 implementation? - Is this "constant folding" turned on on your PC?
Ray - I wasn't seeking to blame the "Cannuks", I was blaming the scenery for distracting you from your desk!
James
Answers:
1) The original snippet had a bug. I was distracted by the scenery and the brain went AWOL. I should have wired to the index of the For Loop, not where it was found in the array.
I though I posted the improved snippet. In case I didn't it is below.
2) Yes.. I have constant folding turned on in LV8.5.
If I was working downtown Montreal, I would be very much distracted and totally useless to write any program.. 😉 😛 LOL!
04-30-2010 10:26 AM
amt1981 wrote:
first i really wanna thank you for your help and ray for the vi examples you provided me
Glad to help
amt1981 wrote:what i am facing is that some times even though the license plates are found in the database, my program seems not to read the license plate and issues me an error message, and/or it finds the license and then at the index where the string was found it can't seem to extract data, or sometimes for a specific string it just extract few data not all i require.
I won't have time to look at it before lunch, but will look at it this afternoon.