Hi,
I want to handle visu users via code.
One of the main topics is to read the users (and groups) list.
I'm testing the method "GetUsers" of VisuUserManagement.VisuUserMgmt but my system crash.
The code looks good, I can't understand.
This is the code implemented:
VAR
  iFBUserMng  : VisuUserManagement.VisuUserMgmt;
  stRet    : VisuUserManagement.VUM_ReturnValues;
 Â
  udiNumberOfUsers  : UDINT;
  dwUserDB      : DWORD;
  xUpdateUserList    : BOOL;
 Â
  astUserList      : ARRAY[0..10] OFVisuUserManagement.VUM_User;
  dwpUserList      : POINTERTOARRAY[0..0] OFVisuUserManagement.VUM_User;
  udiUserListSize  : UDINT;END_VARIFxUpdateUserListTHEN
  dwUserDB :=iFBUserMng.GetUserDBAsCopy();
  udiNumberOfUsers :=iFBUserMng.GetUserCount(dwUserDB);
  xUpdateUserList :=FALSE;
 Â
  dwpUserList :=ADR(astUserList);
  udiUserListSize :=SIZEOF(astUserList);
 Â
 Â
  stRet :=iFBUserMng.GetUsers(
            dwUserDB:=dwUserDB,
            udiStartIndex:=1,
            udiEndIndex:=1,
            pArr:=dwpUserList,
            udiArrSize:=udiUserListSize);
 Â
END_IF;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally created by: massimiliano.legati
Hi,
I want to handle visu users via code.
One of the main topics is to read the users (and groups) list.
I'm testing the method "GetUsers" of VisuUserManagement.VisuUserMgmt but my system crash.
The code looks good, I can't understand.
This is the code implemented:
I'm not sure, but
seems strange.
Originally created by: massimiliano.legati
I tested it in thousand ways...this is just the last version.
I already tested:
And also with ARD(...) and SIZE_OF(...) directly on the method call.
Hello, does someone has an update? How can all existing users be retrieved? Kind regards!
Hi. Check this topic:
https://forge.codesys.com/forge/talk/Visualization/thread/37a2b491cb/