LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle multiple user inputs

I'm currently writing a LabVIEW program to replace an excel spreadsheet for data collection. It's a log with multiple user inputs like around 20 or so different inputs, ranging from strings to doubles. I will be using combo list boxes for selecting repetitive data (think which person does what activity, there's a finite amount of users.)

 

How would I handle this in a queued message handler? 

 

When the user presses the save button I want it to collect all of the data on the screen (all the inputs) and write them into a csv file or maybe even a tdms file. Would all of the inputs stay in the MHL case structure for the "Save" button? seems like it would be messy just because of the number of inputs.

Also, I would want to put them into the data cluster control so I could separate the collection of the data to the actual writing of the data to the file in different cases. 

I'm thinking QMH because eventually, I want to automate some of the data collection processes such as temp & humidity and more. 

I'm also thinking maybe QMH is overcomplicating it, and I should use the JKI state machine instead. 

 

Any help/advice on what to do is greatly appreciated. If I wasn't clear on something please let me know.

 

Thank you. 

0 Kudos
Message 1 of 8
(2,100 Views)

It's hard to envision what you are describing.  If you could provide us with at least a skeleton version of what you are trying to do, it would help immensely.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 8
(2,058 Views)

Here is an image from when I built it before but using a state machine. Since I no longer have access to that machine and I need to start over I wanted to reassess the best design to use.  

0 Kudos
Message 3 of 8
(2,041 Views)

Hi russ,

 


@russ_comer wrote:

Would all of the inputs stay in the MHL case structure for the "Save" button? seems like it would be messy just because of the number of inputs.

Also, I would want to put them into the data cluster control so I could separate the collection of the data to the actual writing of the data to the file in different cases. 


This "messiness" would greatly reduce when you would use a (typedefined) cluster to hold all those user inputs: just one wire now holds all values. You can create a subVI formatting the cluster data into the required delimited text format…

 

Btw. you need to apply the "%,;" format code only once in your format string!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(2,013 Views)

Are these users all using the same system? Or is it across a network? Have you considered some sort of Publisher/Subscriber model to sharing data?

It's hard to really understand what you are trying to do. You seem to be asking for help on a particular solution (that might or might not be the best). Can you spend a few more sentence describing the overall application from user(s) perspective?

0 Kudos
Message 5 of 8
(2,009 Views)

Based on what you claim you want to do, you are making things too complicated.  Since it sounds like all you need is a simple dialog window to allow the user to input values, you really just need an Event Structure inside of a While Loop.  You can react to any values changing (ex: to update combobox values, saving the data).  You probably just need to keep an index and array of shots in shift registers to handle going to "previous shots".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 8
(1,984 Views)

I'm sorry I didn't clarify. It is a single system (laptop) that really anyone can use. There won't be any accounts for people to log into. 

This is a log, so it is tracking shots fired in a ballistics facility. Each shot that is recorded has a designated "gunner" and test director.

The reason they are in a combo box because there is only a finite amount of people who are allowed to fulfill those roles.

So making it a list that someone is selected from rather than having to type in a name, that also makes things a little more streamlined for the person filling out the log.  

 

0 Kudos
Message 7 of 8
(1,978 Views)

Put all of the controls into a cluster. Re-order the controls in the cluster in the order you want to record them (order of controls in cluster can be independent of locations on front panel, so you can still maintain groupings and order on there). On save button press (use event handler), use property nodes to get reference to Controls[] in cluster. Then use a For Loop to iterate through each of the elements in Controls[] in the cluster and get the value and add it to a 1D string array. Append 1D string array to the existing log file (2D array, .csv/.txt file).

I would save all of your data in a comma- or tab-delimited file like .csv or .txt. That preserves the ability for them to easily be read by anyone, and import them easily into Excel. No need for TDMS in this application.

 

0 Kudos
Message 8 of 8
(1,955 Views)