Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Deactivating Table Inputs

  • rickj

    rickj - 2021-03-24

    I have implemented a visualization table containing references to configuration and tuneup parameters for my client. The visualization's user management consists of several login groups, only some of which are permitted to modify table values. I am able to implement this functionality minimally using the "Access Rights" property. When inputs are disallowed in this way, the table colors are modified as an indication.

    The problem is that there is no control over the color selection and the colors automatically selected are unattractive. As an alternative I attempted to place a semitransparent rectangle in front of the table that intercepts clicks (effectively disabling table input) while producing a more visually pleasing presentation. The problem with the alternative is that the "access Rights" mechanism will not allow this rectangle to be invisible for groups with higher permission and visible for groups having lower or no permissions.

    I have tried looking up the current sessions group name (as suggested in some example projects) but have come up with an empty wstring.

    I'm open to any suggestions such as ...
    1. How to modify disabled table colors?
    2. How to get the UserGroup name of the current session within the a screen context?
    3. How to make a rectangle visible when not logged in and invisible when logged in?
    4. Any other suggestions?

  • rickj

    rickj - 2021-03-24

    Ok, I've been able to make the code snippet below to work, to get the group name for each active session. However, how would an active screen determine in which session it is being displayed?

        WHILE (VisuClient := VisuElems.g_ClientManager.GetNextClient()) <> 0 DO
            IF (VisuClient^.GlobalData.ClientType = VisuElems.Visu_ClientType.TargetVisualization)  THEN
            CurrentUserGroupName[GroupCnt] := VisuClient^.GlobalData.CurrentUserGroupName;
            GroupCnt := GroupCnt+1;
  • m.prestel

    m.prestel - 2021-03-24

    There is a global variable CurrentUserGroupName available.
    Create a function and call it in the element.

    Best regards,

  • rickj

    rickj - 2021-03-24


    Thank you so much! I have been wanting to know how to do this for almost a year. That is exactly what I was looking for. It works perfectly.

    Marcel, I owe you a big beer for this.

    Best Regards


Log in to post a comment.