LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loading test specifications

I'm looking for a "slick" way to load test specifications from a text file (tab delimited) or excel spreadsheet. The basic VI here is a final test station where the operator selects a part number (as in a ring), then hits test. The NI Hardware gathers the test data and compares it to the specifications associated with the part number selected.

I have a solution that was created some time ago, but it seems sort of clumsy, and I was wondering of there are any elegant solutions out there. Basicaly anytime the operator uses the drop down combo box to select another part number, the test spec cluster should be updated.

I've searched though the examples and can't find anything that quite matches. Has anyone out there done something like this before.


~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 1 of 14
(3,610 Views)
The way that I do it (probably not the best) is to have all your specs in a file both high and low in a tab delimited test file . Read the file in and compare the the different array functions to find the proper high/ low for the test and then compare the test limits to the actual data using the greater than or less than vi's. You could do something similar.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 14
(3,604 Views)
Hey Joe,

Yes, that's right, that is what I want to do. I was just wonsdering if there was an elegant way to read the tab deliminted text file into the program based on the operator selecting a part number from a drop down list. I do have a solution, but it seems a little clumsy. I'll try make a library of the applicable files so you can see what I mean.

The text file is set up as a single row per part number. Column 1 is the part number, colums 2 through... contain the specs. Each part number is on separate row.

It just seems like there should be a more direct way to get this data in than parsing strings, etc.
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 3 of 14
(3,593 Views)

There should not be any string parsing, This is how to set it up if you know what the part # is already and what the specs should be.

1. Create the file as you have already done.

2. Create some type of interface for the part #. (I would suggest and enum or test ring as this will give you a number for the representation of the part).

3. On the BD read the entire file in (file should not be that large)

4. use the interface created in #2 to select which row (using index array) This will get you on the correct row for the part you want to test.

5. use the other array functions to get you to the specific limits for each test then compare.

If you need further assistance please post an example of your file and I will try to help you.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 14
(3,587 Views)
Joe,

I've taken the applicable VI's from the main program and placed them in a stand alone vi so I can analyse how they work and where it can be improved upon. I'd like to post a .llb with the vi's I'm talking about in it. There are about 5 small vi's. The rest of it is standard LV vi's (I'm using 7.1 right now).

I don't seem to be able to select a configuration in Save With Options that doesn't  stick all of the LV vi's in as well.

Am I missing something there? I suppose I can manually delete them.
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 14
(3,566 Views)
OK,

I've attached the library (deleted all of the standard LV vi's).

I've alos attached a file called indata.txt. This is required when searching for the spec file. Put it somewhere you can find before you run the main VI. The main VI is called readtemp.

I made this vi by culling the various bits and pieces from the test stations main program, so that it is stand alone. Maybe its just me, but it appears to be a lot of programming for what ot does, which is:

1) Create a defaults.ini file in the executing directory, if one doesn't already exist.
2) Prompt for the the location of the indata.txt file, if it doesn't have it in the defaults.ini file
3) Allow the user to change to another indata.txt file, or select another error file directory
4) Read the indata.txt file whenever the ering is manipulated, to update the cluster spec.

I don't know, maybe this is just the way it has to be.


~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
Download All
0 Kudos
Message 6 of 14
(3,566 Views)

Paul,

Since your VI was missing a subVI and since it included a lot of code unrelated to your question, I went ahead and rewrote it to show you how I would approach the concept you were asking about (note that I deleted all extraneous front panel elements and code). In order to read your tab-delimited spreadsheet file (which includes strings), I had to modify the Read From Spreadsheet File.vi from the palettes to return strings instead of numbers, which I did by changing just a few small elements. I have attached this modified subVI as well. I didn't have time to comment the code, but I would consider it to be fairly "elegant." Please let me know if you have any questions!

Kind Regards,

Message Edited by AESulzer on 03-01-2006 05:32 PM

E. Sulzer
Applications Engineer
National Instruments
Download All
0 Kudos
Message 7 of 14
(3,548 Views)
E,

Thanks so much. I knew there was a more concise way to get to the data. And you answered my follow-up question, how to use an event structure so the program woudn't keep polling the text file.  I'll spend some time reverse engineering this so I can impliment the concept.


Thanks again.

Paul
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 8 of 14
(3,540 Views)
Thank you for helping E.
 
Sorry I could not get back to you paul.  E has a good example, although his example puts the wrong data into the ring you should be able to modify it for your needs then compare your data for a pass/fail analysis.
 
sorry I could not help more.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 9 of 14
(3,530 Views)
Joe,

E's solution appears to load the correct data, but the Decimal String to Number Conversion seems to truncate to an integer regardless of what I connect to default.

???
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 10 of 14
(3,514 Views)