I am on CodeSys 3.5.16.
In the CodeSys login dialog the password field is always masked with three asterisks
So I came up with my own password field as visu object, which I reference to in the login dialog.
This is how the visu object looks like:
The OnDialogCLosed-Event triggers the following ST-Code:
THIS^.str_IOPassword := THIS^.str_Password;
THIS^.str_MaskedPassword := '';
FOR THIS^.index := 0 TO LEN(THIS^.str_Password)-1 DO
THIS^.str_MaskedPassword := CONCAT(THIS^.str_MaskedPassword, '*');
THIS^.str_Password := '';
It basically works.
The only problem is, that str_MaskedPassword contains asterisks in the number of characters of the last entered password.
The referenced variabl, which is passed to the LoginMgmt is emptied upon clicking OK or CANCEL.
How can I set the value of the str_MaskedPassword everytime the Login-Dialog is opened?
Alright, while writing the above post I came up with the trivial solution myself, which I just successfully tested:
Simply change the str_MaskedPassword variable to be InOut and handle it the same way like the unmasked str_IOPassword InOut variable...
You can also use the function in the VisuDialogs library called VisuDlg_GetPasswordString to convert a string to asterisks. In your "Text Field" you would set the "Text Variable" to VisuDlg_GetPasswordString(stOrg:= str_Password)
Log in to post a comment.