Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/23/2010 in all areas

  1. Glad to hear it's not a homework. To add or delete users from the database, you will have to have a file which contains you credentials. Steps to implement: 1- Create a file that will contain the usernames, passwords (encrypted would be best...) and privileges. (You can "salt" your encryption If your file will be small, load its content on initialization and store it in the Cluster from easy access. If your file is to be deployed, create VIs to access the file throughout your program (call when needed). 2- Create a VI that will read the data from file and a VI that writes (or modifies) the data in file. 3- Add two states in the case structure for saving to file and reading from it. These states will be called when you have a logon (read) or add/delete user credentials (write). 4- Create two more states (add user / delete user) and associate the buttons for adding and deleting users in the Event structure to call these states when required. You will handle all the hiding/showing of controls in these states. These options will be revealed in the Login state if the user has logged in as an admin. If so, enqueue a new state to reveal the "Add user" and "Delete user" on the front panel. 5- In the Event structure (Idle state), associate the OK button from the delete or add users and call a sequence of states (using Queue VIs) to perform the necessary actions (Show/Hide stuff, read database, write to database, verification, etc.) Try this and upload your modified code if you need more help.
    1 point
  2. I could, but at this point I'm not convinced this isn't an homework ("he/she" is usually indicative of a generic written question) , so I'd like to see that you start to implement these functions. When I tried to answer your question, I couldn't find a simple way to help with your existing program. Any suggestions I would have made would have added more complexity and bug potentials, so I opted to show you a design that you could build on. I hope the design is not too advanced because that would defeat my purpose here. Ask yourself, what do I need to implement these two requisites? Are these just two more possible states to be added to my design? How can I add a state in my code?
    1 point
  3. Hello Papang, First, thanks for uploading your code. That helps understand what you want to do. I've reviewed it and it is hard to follow when you have many structures within structures. Try to avoid putting multiple event structures in the same loop: you might have deadlocks that are hard to debug. Also, the use of local variables to keep information between loops Instead of modifying your code, I thought I'd prepare a Login Demo project for you to look at. It's based on a queued state machine, for which you can find examples in LabVIEW's help or templates. I've put many comments in the code for helping you expand on this example. I hope you find that this demo is useful to decompose all your use cases and create a login VI with the desired functions. Try modifying this base code to achieve the list of specifications you have. If you still have questions, come back... ;-) Login demo.zip (LV 2009)
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.