ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
12-09-2015 01:55 PM
I am trying to create a VI that runs a series of tests, to improve the users experience I am wanting to make it as simple as clicking an Enum and selecting their name from a list to populate their information. If they are a new user I'd have a button available that opens a subVI allowing to populate their information, which then adds/ updates it to the list of users. I know this is a simple question, but not sure the best practice for doing this. On the front panel of my VI I would have a box similar to this asking for the users name, if their name isn't in the list then they can add their name to the list by clicking Add User and filling out the popup.
Clicking Add User would popup the following dialogue box.
Once a name is input to the box and ADD is clicked then it would return to the previous VI and then the user could select their name from the updated Enum.
Would it be best to just have a text file with all of the users information in it that is read in and updated?
Thanks,
Kellen
Solved! Go to Solution.
12-09-2015 02:23 PM
It depends on a lot of things. When I have users it is my preference to put it into a database. I find that users, which are several in the factory, get called over and over again, and it is nice to easily call it up. It is also nice to have a common point to maintain the list. But, if you just have a few users, that won't be used over and over again, a text file would work.
Rather than a full blown database you could also go with a datalog file or an xml file.
It could even be done with a binary file if you have any personal information.
If you have any personal information remember this is a different ball game. You have to secure that kind of data.
12-09-2015 02:29 PM
Is there a way to dynamically update the enum that is in the main VI once a user adds their name to the list of users?
Thanks,
Kellen
12-09-2015 02:35 PM
Rewrite all of them to the string[] array property node.
12-09-2015 02:35 PM
Sorry that is the strings[] array not the string[]array.
12-09-2015 02:52 PM
Is an ENUM what you really need? Enums don't output the name....they output a number associated with the name. I think a combobox may work better for this, depending on how you plan to use the information.
12-09-2015 02:56 PM
I agree that a comboBox would be better to use, and so i will use that. Now just tring to figure out how to read/write with datalogs to successfully return the list, thanks.
12-09-2015 10:40 PM
@PatrickLye wrote:
Rewrite all of them to the string[] array property node.
This not allowed for an enum.
12-09-2015 10:42 PM
@rkmadse wrote:
I agree that a comboBox would be better to use, and so i will use that. Now just tring to figure out how to read/write with datalogs to successfully return the list, thanks.
A ring control looks like an enum control but you can add items at runtime.
12-10-2015 09:08 AM
Oops, yep, that is a ring control I'm using...