02-05-2020 11:11 AM
When you've exhausted all the possible reasons why it isn't working, the only thing left is the impossible.
Hi,
First, I am not looking for a LabView answer. I don't use LabView and don't understand all that visual stuff. 😊
I have no problems erasing text boxes. But I'm using the password instrument and that requires the box to be an text string, not a text box. ResetTextBox() doesn't work because it's not a text box. I've tried SetCtrlVal() and SetCtrlAttribute() but I can't get either to put a string into the text string box.
I have a suspicion that I'm doing something stupid. But you know how it is, you look at something for so long that the stupidness isn't apparent.
Anyone have an idea?
Thanks,
Dave
Solved! Go to Solution.
02-05-2020 02:10 PM
You want to use the functions in the PasswordControl instrument, specifically PasswordCtrl_SetAttribute().
02-05-2020 03:18 PM
Thanks Ian. I had to find the pwctrl.h file first to see what other functions there are. There aren't any.
So I implemented PasswordCtrl_SetAttribute(mainHandle, MAIN_RPWD, ATTR_CTRL_VAL, rpwd);
Where rpwd is the string I want. Still didn't work. And I've tried writing the field with the SetCtrlVal() and SetCtrlAttr() functions before converting to password, and the password attr function after converting the control to password. Nothing works.
Thanks again,
Dave
02-06-2020 01:11 AM
If you are using the password control instrument you should already have all that's needed at hand. FYI the instrument is located in <CVI folder>\toolslib\custctrl: di you loaded the instrument from there? Did you actually loaded the instrument? If so, you should see it listed in Instrument menu in the IDE; clicking on it the Select Function Panel dialog should open where you can find all available functions listed, including PasswordCtrl_SetAttribute
02-06-2020 11:05 AM
Hi Robert,
Thanks, that is the answer!
First, I could find no documentation on pwctrl. I did find the windows opened when you double click the instrument, but I had no clue how to use them. But after your comments, I browsed around and found that getting a password control attribute value is ATTR_PASSWORD_VAL, NOT ATTR_CTRL_VAL. So that was my error.
Thanks again,
Dave
02-06-2020 12:45 PM
Dave, I recommend the Find Function Panel feature (<Ctrl><Shift> P). Assuming the .fp is loaded in your solution, simply putting "password" in that feature will list all your choices.
02-06-2020 12:53 PM
Thanks Ian. Now that I know that's there...
Dave