- HMI Model: cMT-3108xp
- EasyBuilder Pro Version: v6.10.01
How can I get the currently logged in HMI user to Codesys? Either the actual username would work or the user’s index.
What I’m trying to accomplish is populating a string variable with that user’s role such as “Admin”, “Operator”, “Engineer”, etc. to display on the HMI right underneath the username.
There is an internal HMI register that corresponds to the current user’s index (can be 1 - 12) but I’m not able to select that for a data transfer. That would work fine, then in Codesys I can populate a string based on that value.
Hi @JDControlsLLC,
This is possible, but a key point to remember is that with our client application cMT Viewer technically multiple users can login at the same time. However, the username if the user that is logged into the local HMI is stored within LW-10754 ~ 10761 (8 words). To transfer that into CODESYS you can use one of the methods shown within this post: Link
And, on multiple users, each username logged in as a cMT Viewer client is stored within PLW-10754 ~ 10761. The PLW memory type is independent of the HMI’s local memory, so as an example the value in PLW-1 on client 1 may be different from the value in PLW-1 on client 2. This does not affect your project goals, as I mentioned you should reference LW-10754 in this case. However, I am just adding it here so that others can reference this information.
I almost got it to work, but it seems as if the data transfer is skipping every other letter in the user name. I’m logged in as “Jimmy” and the data transfer is giving me “Jmy”.
Also tried logging in as Operator and got “Oeao” as the string conversion.
See screenshots below:
Here’s my Data Transfer
Here’s the resulting data in Codesys.
Here’s how I’m doing the conversion in the PLC code. This should work fine, but I’d expect the first 5 elements of that SINT array to be populated instead of just 3 when logged in as Jimmy.
I figured it out. At some point when experimenting with this before asking the forum question, it seemed as if EBP was wanting me to do the data transfer to a SINT array. I don’t remember what made me think that.
Just changed it to a WORD array in Codesys and it works fine if done like below. Thanks!

1 Like