LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

active x to search cells


chirs73 wrote:

I got a lot of flack for that b/c the people I work with are lazy and want everything done for them.


Can we quote you on that? Smiley Very Happy

 

Presumably somewhere you're storing the last serial number that was used. In this case what you want to do is fairly simple. Have a text file with the list of serial numbers as a column. Use the Read From Spreadsheet File function to read the file as an array of strings. Search the array of strings using the Search 1D Array for the last serial number used (you may wish to ignore case sensitivity by converting all strings to lower or upper case). This gives you an index into the array. Then, you just need to increment the index in your loop (or whatever you're using) to run the test on the next serial number. This is really not difficult. 

0 Kudos
Message 21 of 36
(1,094 Views)

I have altered the code you showed to try and obtain the results I need. I can't get it to work properly. I have attached the code so you can see what I have done.

 

Thanks

Chirs

0 Kudos
Message 22 of 36
(1,077 Views)
I am not sure why but I cannot load your VI. Was it developed in windows or on linux. It says that it cannot be loaded in LV 8.6 because it has no block diagram or that it was compiled in a different OS.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 23 of 36
(1,074 Views)
0 Kudos
Message 24 of 36
(1,072 Views)

chirs73 wrote:

I have altered the code you showed to try and obtain the results I need. I can't get it to work properly.


Are you referring to the little snippet I showed? 'Cause I don't see it anywhere in your code, so I don't know what you implemented. 

0 Kudos
Message 25 of 36
(1,059 Views)
Here is what I have changed in my code. As I said before it is a little different from what you have posted.
0 Kudos
Message 26 of 36
(1,053 Views)

Ok to address the problem at hand: You are probably getting "junk" out of the read from spreadsheet VI. this is because Excel is a proprietary format and you must use Active X Excel functions to do this. If you would save your file as a .csv and change the delimeter to be (comma) or just make it a simple text file then it will work.

 

Second: Lets talk about code Architecture. Your code the way that you have it is very cumbersome and hard to read and is not upgradeable at all and will be very hard to manage to say the least. You should look at the examples of a Quequed state machine do a search here on the forums and you will find some examples. Also the event structure will be a big advantage to you.

 

Your outer most loop does nothing for you. It only runs once (since you have a false constant wired to the stop) and well guess what when you stop the second while loop you are stopping the program from running so get rid of the outer most loop.

 

you are also continuosly polling the test button to see if it has been pressed. this is where the event structure would benefit you.

 

your inner most while loop has two case structures in it that have the same case names, just combine the two case structures into one.

 

This should give you enough to think about for now.

Message Edited by Jhoskins on 11-11-2008 04:15 PM



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 27 of 36
(1,048 Views)

I have made some changes to my code. The reason for the outermost loop is to have the test constantly running....especially when I create the executable. I don't need to catch any flack from the people who will be using this. I'm making my tests as idiot proof as possible. I'm still working on the reading the serial number out of excel.

 

Chirs

0 Kudos
Message 28 of 36
(1,011 Views)
Ignore my comment about the vi stopping. I figured out a way to get it to remain running without the extra while loop.
0 Kudos
Message 29 of 36
(1,006 Views)

I knew you could figure it out. If you want it to quit like a normal windows program you can add an event called front panel close to the event structure and it will work. I will look more at your vi later when I get more time.

 

 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 30 of 36
(1,004 Views)