09-13-2017 05:11 PM
I am new to LabVIEW and creating a program to measure eight thermocouples simultaneously during a welding procedure. I am appending the data to a .csv file because we are running for multiple hours, and once the file size of an .xlsx gets too big, the sample rate slows down. However, this makes it more difficult to determine the exact time of certain temperatures, which we would like to know so we can denote certain processes (preheat, interpass, etc.).
My current goal is to create a button that will read the current value of the "Elapsed Time" indicator and write it down somewhere on the front panel, and subsequent presses continue to add to this list of saved times. The button will act like the "Lap" button on a stopwatch, saving timestamps when pressed.
Thank you,
Solved! Go to Solution.
09-13-2017 05:38 PM
In order to show multiple times, you'll need to change your elapsed time indicator to an array. You can store this array in a shift register. If you press record time, put your new time first so it is at the top of your array. You already have the while loop, you just need to add the shift registers, build array, and case structure.
Also, if you have time it would be good to look into some LabVIEW basics and design patterns. Many projects start out small, and then you add little features here and there and they become a nightmare to maintain. If you learn how to use State Machines and Producer / Consumer (events) patterns it will make your life much easier!
09-13-2017 11:19 PM
Thanks for the help!
I now am able to record the times into the array, but is there any way to get them to go into a list box instead? That way I could keep all of the points in a small, neat area with its own scroll bar, rather than guessing how many times I will need to record a time during a given session and making the array that large.
Thanks again!
09-14-2017 01:28 AM
Hi tyount,
is there any way to get them to go into a list box instead?
Yes, sure! That's what listboxes are used for!
Did you look at the example VIs coming with LabVIEW? They most often explain such things…
(I just verified: There are examples for listboxes!)
09-14-2017 08:40 AM - edited 09-14-2017 08:41 AM
@tyount19 wrote:
I now am able to record the times into the array, but is there any way to get them to go into a list box instead?
Listboxes are nothing more than a fancy way of displaying arrays. The datatype of a listbox is a 1D array of strings so you will need to convert your array of timestamps to an array of strings. Then look at the property nodes for the listbox, specifically the ItemNames property.
09-14-2017 09:06 AM
09-14-2017 09:22 AM
You are correct. That's what I get for responding before having my morning coffee.
09-14-2017 10:58 AM
@tyount19 wrote:
Thanks for the help!
I now am able to record the times into the array, but is there any way to get them to go into a list box instead? That way I could keep all of the points in a small, neat area with its own scroll bar, rather than guessing how many times I will need to record a time during a given session and making the array that large.
Thanks again!
Increase the array in the vertical direction, you can then use a vertical scroll bar. Notice how I never set the array size, I just keep appending elements to beginning of it, so you don't need to do any guessing.
If you're talking about the array indicator, it is no different than a listbox. A listbox has finite size. If you want, you can change the number of elements in the array using a property node, but the way I have shown you will put the most recent time at the top.
09-14-2017 11:17 AM
@Gregory wrote:
Increase the array in the vertical direction, you can then use a vertical scroll bar. Notice how I never set the array size, I just keep appending elements to beginning of it, so you don't need to do any guessing.
If you're talking about the array indicator, it is no different than a listbox. A listbox has finite size. If you want, you can change the number of elements in the array using a property node, but the way I have shown you will put the most recent time at the top.
Ahh, perfect! I had to decrease the array to a 1x1 and then re-expand it for the vertical scrollbar to become an option.
Thanks for your help and patience, I definitely have a lot of learning ahead of me!
09-14-2017 11:19 AM
Sure thing. For 1D arrays, if you are showing multiple elements in the vertical direction, you can right click >> visible items >> scroll bar, to show the vertical scroll bar. For some reason, if you're only showing 1 element you can only show the horizontal scroll bar...