I’m working with Automation Studio 6 and mappView and I have a question about HMI session variables.
I would like to read the currently selected HMI language in my PLC code. I see that the language is available as a session variable:
::SYSTEM:clientInfo.languageId
I created a binding to copy this value to a PLC variable. The project compiles without any errors, but at runtime the PLC variable never changes and stays empty.
So my question is:
Is it actually possible / supported to use ::SYSTEM:clientInfo.languageId in PLC code using bindings?
Or is there another recommended way to access the HMI selected language from the PLC?
Hi Noe,
I’m very new on mappView, so let’s ask AI some help:
Question to AI: “How, on B&R mapp View, can I access on HMI session languageId from PLC?“
Answer:
In B&R mapp View, you can access the HMI session’s languageId from the PLC by using Session Variables and Data Bindings. While the system variable ::SYSTEM:clientInfo.languageId exists within the visualization, it often requires explicit binding to update a PLC variable at runtime.
Steps to Access languageId from the PLC
Define a PLC Variable: Create a global or local variable in Automation Studio (e.g., a STRING or WSTRING named gCurrentLanguage) to store the ID.
Expose via OPC UA: Ensure the PLC variable is enabled in your OPC UA default view (.uaview) so it is visible to the mapp View system.
Create a Data Binding:
Open your project’s Binding file (.binding).
Create a new binding where the Source is the system session variable: ::SYSTEM:clientInfo.languageId.
Set the Target as your exposed PLC variable.
Set the Binding Mode to TwoWay or OneWayToSource to ensure the HMI updates the PLC.
Use Event-Based Updates (Alternative):
If a direct binding does not trigger as expected, use an Event Binding.
Trigger an action on the event LanguageChanged (under Client Actions) to write the current languageId into your PLC variable.
Important Considerations
Multi-Client Support: Because mapp View supports multiple simultaneous clients, a single global PLC variable will only reflect the language of the most recently updated session. For client-specific logic, you may need an array of variables indexed by session ID.
Language Codes: The languageId typically returns a standard code (e.g., “en” for English, “de” for German) based on your project’s text system configuration.
Automation Studio 6: In the latest versions (as of 2026), B&R provides sample projects like mappServicesHighlights that demonstrate these session variable bindings.
Ok we have feedback from AI, and fortunately in AS 6, we have a folder “Sample“ with a prj mappServicesHighlights, Do you know that?
Hi Noe,
We also have a topic in our help about this; it describes how to bind client information (Session Variable) to OPC-UA. In the help, they use it to display the information in the HMI. But as soon as you have bound the information to OPC-UA, you can use it in your PLC code (ST) as well. Displaying client information from all clients
This is part of the topic Binding applications, which describes some more binding possibilities from mapp View.
I hope this helps you.
Adrian
I’m not sure exactly what’s happening; I followed the instructions in the help guide precisely, yet it doesn’t work. I used the example project recommended by @valerio.manenti as a reference, simulated it, and the variable functions correctly there.
To test, I created a separate project solely to replicate this configuration, but I obtain the same result namely, the variable remains empty.
Here is the step-by-step process I followed; I likely made an error somewhere.
As additional information, the binding file is located in the .vis file, OPC UA is enabled, and the MpServer library is included in the program.
Thank you in advance to everyone for your support and contributions.
Best regards
Hi @novi ,
you have reported 4 steps, but there are at least other 10 to double check in my opinion.
Attached my first prj, from scratch, with mappView visualization “That is one small step for a man, one giant leap for mankind”…with just change language button and a label.
I hope it helps
Note: I did many mistakes on that, but one took me a while to figure out the problem: on my tmx file I have forgotten to rename the Namespace to IAT so I didn’t see
my element on that:
@Note#2: Login on our website and download the training manuals:
TM611 - Working with mapp View
TM642 – Diagnostics, charts and customized widgets
TM671 – Creating efficient mapp View HMI applications
Ciao
Valerio
Hello Noe
Did you have a look in the logger already? Often there are some information, about problems.
For this problem I would activate the logbooks for visualization and the communication.
I would also recommend to check if the bindings are working using the service Page. Diagnostics page https://Ip-adress:port/Server/Info → i.e. https://127.0.0.1:443/Server/Info
The service page can be activated in the mapp View configuration.
Activate diagnostic page –> on
Then assign a role to the Role 1 → i.e. MappViewSerivePage
I created a user called mvServiceUsr and assigned it the MappViewServicePage role.
With this user I can log in the diagnostic page.
Can you use and access your visualization normally?
One point that remains unclear to me is why, despite having already assigned the Admin role (as seen in the previous image’s panel) and having designated the admin user in the MappviewConfigurator → Startup User section, the system did not function properly until I assigned an anonymous user and logged in with the user Noe. It then worked correctly.