Mapp UserX: MpUserXLogin returns mpUSERX_ERR_USER_NOT_EXISTING (AS 4.12), and MpUserXMgrUI MpLink error

Hello everyone,

I am new to mapp UserX and I am trying to get a simple login working with MpUserXLogin. I have the problems below and would like help finding the cause.

Environment

  • Automation Studio 4.12.10.39, target 4PPC50.0702-10A (Power Panel)
  • Also tested in Automation Studio 6.7.0.187, target X20CP1685

Configuration

  • Config_1.mpuserxlogin is linked to gUserXLogin (declared as MpComIdentType in Global.var)
  • Config.mpuserx has the component name UserMgmtX, with the user Abin under Users
  • User.user contains the users Abin, Admin and anonym, with roles in Role.role
  • Password length is set to 5 in the UserX settings
  • File device USER, file extension usr

Code (Main.st)

PROGRAM _INIT
	UISetup.FileDevice    := 'USER';
	UISetup.FileExtension := 'usr';
	UISetup.UserListSize  := 20;
	UISetup.RoleListSize  := 9;
	UISetup.ScrollWindow  := 1;
END_PROGRAM

PROGRAM _CYCLIC
	UserMgr.Enable     := TRUE;
	UserMgr.ErrorReset := ResetButton;
	UserMgr.UISetup    := UISetup;
	UserMgr.UIConnect  := ADR(UIConnect);
	UserMgr();

	UserLogin.MpLink     := ADR(gUserXLogin);
	UserLogin.Enable     := TRUE;
	UserLogin.ErrorReset := ResetButton;
	UserLogin.UserName   := ADR(sUserName);
	UserLogin.Password   := ADR(sPassword);
	UserLogin.Login      := LoginButton;
	UserLogin.Logout     := LogoutButton;
	UserLogin();
END_PROGRAM

Problems

  1. AS 4.12: UserLogin gives mpUSERX_ERR_USER_NOT_EXISTING, even though the user exists in User.user. I write the name in the Watch window as a string ('Abin') and then set LoginButton.
  2. AS 4.12: UserMgr (MpUserXMgrUI) first showed mpUSERX_ERR_MPLINK_NULL, because I had not set UserMgr.MpLink. When I declare UserMgmtX : MpComIdentType; in Global.var and use UserMgr.MpLink := ADR(UserMgmtX);, I get an error that the MpLink is corrupted. [Add the exact error text and where it appears: build output or Watch window.]
  3. AS 6: The same project now gives mpUSERX_ERR_INVALID_CRED... on UserLogin. The password in my Watch window is 'Admin123'. I am not sure whether it matches the password set for the user.

My questions

  • How should the link variable of Config.mpuserx be declared and mapped for MpUserXMgrUI in AS 4.12? Is the name of the component enough, or do I need a mapping entry?
  • Do I need both User.user and the Users list in Config.mpuserx for a local user system, with the same user name in both?
  • Does MpUserXLogin need MpUserXMgr to be active, or can it work alone (as in the B&R mapp UserX tutorial video)?
  • Where is the password for a user stored, and how do I check that it matches what I type in sPassword?

I can attach screenshots of the Watch window, the configuration and Global.var if that helps.

Thank you for your help.

Hi,

The first and easy step to check would the data type of user name and password variables.
Please make sure both of them are of “WSTRING” type and not a normal STRING type.

Could you please check and confirm that?

Thanks

i added string for username and password instead of wstring