02-07-2015 09:09 PM - edited 02-07-2015 09:10 PM
I want to be able to read the items from a tab delimited file and if the selection on the first text ring is found in the spreadsheet, the second text ring will be filled with the items shown in the second column. I managed to do this, but I'm having a bit of a problem, because the items change, but are not added to the list. What I mean is that only 2 items are displayed and the rest are not added. I also wish that if no items are found, the list would stop populating over again.
Can someone please take a look at my VI, and help me fix this problem?
Thanks.
Solved! Go to Solution.
02-07-2015 10:08 PM - edited 02-07-2015 10:08 PM
Try to avoid coding in timeout case. I have disabled the code in timeout case, and when the 1st ring value changes, I am using a "for" loop to find all possible matches, and insert those in the 2nd ring.
02-10-2015 10:29 AM
That's exactly what I was looking for.
Is it possible to retrieve the prices for a certain item?
What I was thinking was to enter a new column in the database, with the prices, so that when you select a certain item in the database in the text ring 2, the price for that item in the new column will be retrieved. This is something like the vlookup in excel.
Please tell me if this is possible and if you could show me how, I would be really greatful.
Thanks.
02-10-2015 11:05 AM
Yes, it is possible. Currently we are getting all possible matches with a "for" loop. Instead, if we just search and stop at the 1st match, and retrive the corresponding value, it would be what you are looking for. Try it, and let me know if you are facing any trouble.
02-10-2015 02:49 PM
What I'm looking for is a way to do exactly what it is being done right now, so that the for loop looks for every value, so that the second text ring gets filled, but if I select an item from the second text ring, I want to be able to grab the items price from the spreadsheet.
If you could please tell me how to do this, I would really appreciate it.
Thanks.
02-10-2015 02:55 PM
By the way, your spreadsheet requires only 3 columns
DVDs Maxell 5 DVDs TDK 6 DVDs Sony 8 DVDs Aiwa 9 Mouse Akai 6 Mouse Genius 7 Mouse OEM 9 Mouse Cimetech 8 Printers Canon 4 Printers Panasonic 6 Printers HP 3 Power Supplies Aerocool 10 Power Supplies Antec 6 Power Supplies Bgears 4 Power Supplies Coolermax 9
02-10-2015 03:01 PM
I currently just have 3 columns, but if I added a 4th column with the prices, how would I retrieve the price from the item selected in the 2nd text ring?
02-10-2015 08:18 PM - edited 02-10-2015 08:19 PM
Add an event for 2nd text ring value change in event structure. In this event, search the file for the item in the 2nd text ring, and retrieve its corresponding value(price) and display.
02-19-2015 02:50 PM
http://digital.ni.com/public.nsf/allkb/FB0409491FA
The following snippet reads the first column in a CSV file, and populate a Ring control with the elements of the first column:
Let me know if this helps, greetings.