07-30-2010 08:58 PM - edited 07-30-2010 09:05 PM
I guess I posted my question too soon. I''ve just found out that within the table I should expect random number of test procedure. Meaning "Sample A" is going to be tested 3X while "Sample Z" will be tested 5X" and so on,, so using "3" as a control to change the number of testing instead of constant will not work.. It's getting more confusing because it seems like I needed to know how many times the sample was tested and look to its results..
Again, thank you guys!!!
07-30-2010 09:36 PM
I guess if you can array of just the first column and remove the duplicates. Then use that to search the original array and see if a Fail ever shows up in the 2nd column.
It is safe to assume that if a sample doesn't have a failed test, that it must have passed? Or is there a possibility that a sample was scheduled for 5 tests, 4 of them ran and passed, but the 5th test never ran and thus has no entry in the array? Would that be passed, failed, or just incomplete?
07-30-2010 10:44 PM
Let say " Sample A" is done to its series of test (assuming 5 number of test), an operator will enter all the test results (pass/fail) all at ones so this particular sample is not be hanging for the final call.
There's a little mixed up on the informations I'm getting, I also found out that there are multiple part number being processed in each machine and that explains why number of test procedures are not uniform. I think one of the example on this thread will just do fine but I still have to do some work to sort the serial numbers to their respected part numbers OR I can just send a seperate SQL Query with their part numbers and work my way up though it may take up extra time because the test data I'm reading is so filed up...
Thanks!
07-31-2010 12:53 AM
Here's a simple example if the number of tests per sample is variable.
(Still, you would think we should have more informative output, e.g. listing the failed and passed samples).
07-31-2010 01:25 AM
altenbach wrote:(Still, you would think we should have more informative output, e.g. listing the failed and passed samples).
OK, here's an example for that. Please verify correct operation. 😉
(Still assumes that samples with the same name are adjacent in the input. If this is not true, we could sort first by the sample column).
07-31-2010 05:10 PM
Thank you all for helping me.
08-02-2010 11:15 AM
Actually, Jim posted a solution for varying number of tests back on page 2, using Open-G functions. Looks a little more elegant to me. Sorry Altenbach.
08-02-2010 02:50 PM
@tbob wrote:
Looks a little more elegant to me.
Well, I currently don't have the opeg stuff installed, so it will not work out-of-the-box on my rig. Assuming that tests for the same sample are adjacent, mine is much more efficient, because it touches each line exactly once and does things in place. No repeated array allocations for intermediary results!
(Not even considering what is happening inside the opeg tools, Jim's main diagram allocates 5 intermediary (possibly large) arrays (integer, boolean, string, etc.), often just to reduce them to a single value one step later. For large inputs, this can mean the difference between "runs fine" and "out of memory". It would be interesting to do a performance comparison as a function of input size).
This is a LabVIEW board, not an openG board, so I strongly believe we should not rely on external tools, modules, and toolkits. Besides, if we just used canned tools, we won't learn much. 😉 (Still, the openG tools are of course great! :D)
"Elegance" has many definitions. I would argue that my solution is quite elegant by some of them. 😉 If you would flatten all subVIs of Jim's code to the main diagram and see all the things it actually does to get the same job done, you'd be shocked! :o.
Personally, I prefer to keep things simple. Similarly, all I need in the kitchen is a big knife. Others might prefer a collection of specialized tools, from food processors to very specialized gadgets that only do one thing (garlic press, tomato slicer, etc.). While they make a specific process more convenient, there is associated cost, such as setup (=download and install the openg tools), cleanup and storage (=palette bloat). Just MHO. 😄
08-02-2010 05:50 PM
I'd NEVER use a garlic press. I PROMISE!!!
@altenbach wrote:
[...] Others might prefer a collection of specialized tools, from food processors to very specialized gadgets that only do one thing (garlic press, tomato slicer, etc.). [...]
08-03-2010 12:46 PM
I just tried the examples with the actual data I'm receiving from the our database but it seems to be counting incorrectly... All I did from the actual data is index the column I needed, build an array and transpose the array.
Note that the examples I've tried from this thread returns the same number of Passed/Failed samples. I'm thinking it's the array that I'm passing through...
Can you "please" check the attached vi and see what's wrong?
Thanks again...