01-16-2026 10:17 AM
Hello all, sorry for my messy VI I am extremely new to LabView. Currently, my VI reads capacitance, rounds it to the nearest tenth in nano farad, formats that number into a string, reads a csv, looks for a match, and if there is a match provides the index of that string. My struggle is that using a csv limits me to guessing what the capacitance will be. I want the VI to read the string, check if there is already an index with that value in an array, if there is to output that index, and if there isn't to add that value to a new index and output the index. It would also be nice if it organizes it from least to greatest. Any guidance or help is heavily appreciated.
I am using LabView 2019, and interfacing with a hp 4192A.
01-16-2026 10:24 AM
@StateMachineGuy wrote:
It would also be nice if it organizes it from least to greatest. Any guidance or help is heavily appreciated.
Look into using a Map or a Set, depending on what you are trying to do with the data. A Map is a lookup to get another value out while a Set is a list of non-repeating values.
01-16-2026 10:27 AM
Thanks for your reply, I will look into both. As far as the data, I have random capacitors mixed up and want to sort them into bins.
01-16-2026 10:33 AM
Since you want a key (=number) and a value (=index), you should use a map. What are "bins" in this context.
01-16-2026 10:37 AM
Hi thanks for the reply. The "bins" are physical containers that the capacitors will go in after being measured. So, I take a measurement, round it, and then store that measurement in an index (Ex. 3) and that index will correlate to the correct numbered bin (Ex. 3). So, for example, any capacitor with a value of 17.5 nano farad will always be stored in the same bin.
01-16-2026 10:38 AM
Also, everyone sorry I thought I already attached the VI.
01-16-2026 10:51 AM
So is bin=index?
@StateMachineGuy wrote:
Also, everyone sorry I thought I already attached the VI.
You need to start with a few basic tutorials, because your VI makes absolutely no sense in terms of dataflow.
01-16-2026 11:03 AM
Yes bin=index.
- I understand that I need to learn more on what the best practice is, but unfortunately, I have been given a short time limit for this.
- As for now my best solution would be to replace the outside while loop with a sequence structure until I have more time to learn.
- The csv file is for testing, ideally the VI would save the measurements to compare with others to see what bin it would be placed in/if a bin would need to be created for that measurement.
- Sorry for my misunderstanding but how is cancelling and stopping the program different?
- I attached the subVIs sorry about that.
- The front panel is a mess because it is currently only used for testing purposes. The random indicators are what I was using to debug.
- Do you have a good example of a state machine similar to my situation in labview?
Thank you for your reply and feedback
01-16-2026 01:19 PM - edited 01-16-2026 11:40 PM
@StateMachineGuy wrote:
- Sorry for my misunderstanding but how is cancelling and stopping the program different?
I was talking about stopping the first two greedy* loops with a dialog each. Even if the user decides to not even continue, there is no choice but to go forward.
Your csv file seems to be a single column, so why do you read it as 2D array?