CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Jan 17, 2019 7:37 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Jan 14, 2019 12:05 pm 
Offline

Joined: Tue Jan 08, 2019 4:24 pm
Posts: 2
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:
Code:
VAR
   iFBUserMng   : VisuUserManagement.VisuUserMgmt;
   stRet      : VisuUserManagement.VUM_ReturnValues;
   
   udiNumberOfUsers   : UDINT;
   dwUserDB         : DWORD;
   xUpdateUserList      : BOOL;
   
   astUserList         : ARRAY[0..10] OF VisuUserManagement.VUM_User;
   dwpUserList         : POINTER TO ARRAY[0..0] OF VisuUserManagement.VUM_User;
   udiUserListSize   : UDINT;
END_VAR



IF xUpdateUserList THEN
   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;


Top
   
PostPosted: Mon Jan 14, 2019 1:37 pm 
Offline
Frequent User
Frequent User

Joined: Thu Mar 17, 2016 1:24 pm
Posts: 120
I'm not sure, but

Code:
 dwpUserList         : POINTER TO ARRAY[0..0] OF VisuUserManagement.VUM_User;


seems strange.


Top
   
PostPosted: Mon Jan 14, 2019 2:16 pm 
Offline

Joined: Tue Jan 08, 2019 4:24 pm
Posts: 2
I tested it in thousand ways...this is just the last version. :(

I already tested:
Code:
dwpUserList         : POINTER TO ARRAY[0..10] OF VisuUserManagement.VUM_User;


And also with ARD(...) and SIZE_OF(...) directly on the method call. :cry:


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited