Re: password protection on a control
Enrique, thank you for your response. I had tried both of these ideas, and both do work great. I wanted to get away from having a button they had to push though. Currently I am using the first option, however I still would like to figure out this mouse down? event stuff...but for now the way I have it works anyway. Thanks!
Re: password protection on a control
Ah, so you are saying leave the control enabled, allow them to change it but not have it take effect on the program, then trigger on teh value being changed, ask for a PW, if verified properly change the program value to what the user set it to? I will give that a try and report back. Thanks for the idea! (if i am understanding correctly)
Re: password protection on a control
Well the mouse down? event is not working very well for me. The events fire properly but my cursor is always a little hand icon, and will not allow me to press anything on the front panel, this includes my control. For now I just changed the event structure to a toggle switch and labeled it "Unlock for editing". This way they flip the switch, prompted for PW, if correct they get 10 seconds to edit the control value, then it locks the control and continues on. I would still rather have the mouse down? event work so if anyone has any ideas please post them.
Re: password protection on a control
Instead of using "mouse down" you can use the "value changed" to ask for a password and re-set the old value (provided by the event handler) in case the password is wrong. Just make sure that the non-approved changed value isn't being accessed while the "verification" is taking place. (Synchronous display?) Shane.
Re: password protection on a control
Be careful with the mouse down? event and the dialog message box. You can get really strange behavior if you postion the front panel so that the message box appears over the numeric control. What happens is that you mouse down, this fires the even, the dialog box appears, you mouse up (but this message is never sent to the control), you click ok, and the numeric control continues to increment.This behavior is outlined in the online help (open LabVIEW >> help >> VI, Funtion and How-to help) under Caveats and Recommendations when Using Events in LabVIEW .
Re: password protection on a control
Ryan can you send me the vi(s) your working with ?? [EMAIL PROTECTED] Dan
Re: password protection on a control
Dan, I have a slight glitch. When I click on the control it fires the event case, which is correct. On the mouse click I have it enabling a string control thing that I am using as an input field for the password. This works fine, as it enables it. The problem is the cursor is a little hand and will not allow me to click in the string box to enter the password. Any suggestions?
Re: password protection on a control
Dan, I am using Labview 7.0 Ok I did what you said and found the mouse down? function. I have never used an event structure before so bear with me, I will play around with it and try to get something together. If you could post/email me an example that would be great. Thanks again
Re: password protection on a control
Ryan well i am assuming you are using LV6.1 or higher i guess... anyhow: Structures --> Event Structure --> right click event structure , add event case, click on your control name and find the event... let me know what LV version you are using and i'll send you something Dan
Re: password protection on a control
Dan, how/where can I find the Mouse Down? thing?
Re: password protection on a control
Ryan set the enabled state of your control to disabled... then you can use an event structure to capture the Mouse Down? (the one with the red arrow)event for your control then fire your pwd VI from within that case, if the correct password is entered re-enable the control allow the edit then disable the control again... note: this will not fire an event if the control is tab to Dan