04-11-2016 02:24 PM
I've run into a wall. I'm trying to use the array with the Technician names that were searched and duplicates removed. I want to use these Names and search the Pass/Fail array and count up each Technician's Pass/Fails and display them appropriately next to their names. Co-worker tried explaining OpenG, said it would be easier. Not quite sure how to set up this step. I've got the idea in my head, just can't seem to put it out on the Block Diagram. Still new to Labview and understanding what it can do.
So It will be something like the below example:
Techname Pass Fails
Joe 5 2
Mary 15 0
Susan 12 8
....
etc.
04-11-2016 03:03 PM - edited 04-11-2016 03:06 PM
Variant Attributes would be useful here. No need to even sort the names since the variant attributes does it all for you.
04-11-2016 04:29 PM
You haven't specified where the information is stored (If it says so in the VI file, I apologize since i can't view 2015 files). If it comes from a relational database (SQL, mySQL, etc), my suggestion would be to normalize your database further so that the username is associated with an ID# rather than a string. Numbers are easier to work with. Same goes with Pass/Fail. Save that as a bit rather than a string. Then your solution become much less CPU intensive and can even be done by the SQL engine itself.
04-12-2016 01:44 PM
Wow, I didn't know variants can do so much. I've got another task assigned to me with the same VI. I need to add a Quantity Received per tech.
I tried adding a case statement (pictured below) into the first for loop that searches an auto indexed array of tech names and against itself to count each tech and how many they received, then added that number to the variant data from the Add into another Add and back into the set variant attribute value. What am I missing? I may be doing it completely wrong, I've never really worked with Variants before.
Would I have to initialize the value elsewhere? Or can I add it to the Pass/Fail cluster?
Attached both peices of Info. VI and Data for Received. I may be overthinking this code.
04-12-2016 02:27 PM
Add another value to the data cluster. Add another loop immediately after the first FOR loop and and update the Units Recieved using the Variant Attributes.
04-13-2016 01:49 PM
What am I doing wrong? Added QTY received on 2nd loop and errors out when running with "Data type of variant is not compatible." I can see why, but when I add a 3rd to the original cluster, the output wire errors out and isn't compatible with the boolean sink for addition (2 cluster/3 cluster). The information I need is from a different txt file. Will that cause a problem?
04-13-2016 03:35 PM - edited 04-13-2016 03:36 PM
All of your data clusters need to be the same. They should all have the Passed, Failed, and Qty Recieved in them.