OPC UA variables not being modified with widgets using mappView

I seem to be having an issue adjusting variables using mappView widgets, I’m not really sure what else I need to configure to make this happen. I’m fairly new to this so I’m assuming that I’m missing something kind of obvious. In this case, I have a boolean variable that I want to adjust, and the mappView visualization has two buttons that I want to use, one button to make the variable true (ON), and the other makes it false (OFF). There is also a toggle button that I would like to use to flip the variable value (true if its already false, and false if its already true, an ON/OFF button so to speak).

When I go into the properties, I don’t see any Data tab for the regular buttons where I can select a value to bind the widget to, unlike with the toggle button as shown:

I’m not really sure what to make of this, but I went into the event binding file for this page and added the actions shown:

Button1 is the ON button shown in the first screenshot. The action for Button2 is the OFF button and does the same thing as for the first one except I have the value set to false. When I rebuild and upload the project, the HMI shows the widgets, but the ON and OFF buttons don’t do anything, I can click them, but nothing happens, the variable remains unchanged by the buttons. The toggle button comes out greyed out and I’m unable to do anything with it, which from my understanding implies that the widget is disable, but I have it set to enabled in the properties for the toggle button. I’m also noticing that the widgets that have a Data tab for binding a value are the widgets that get greyed out as if disabled and have the event bindings that make it onto the binding file for the page while the other widgets’ event bindings (like for the regular buttons) don’t make it into the binding file, I’m not sure what to make of that but it seems relevant.

I’ve included the information I think is most relevant, but if there is additional information needed to determine what the issue is, I will provide it. Any help on this would be greatly appreciated.

Hello,

Please check the logger. Which versions do you use? Do you have your binding and eventbinding files in the *.vis file? Is a user with a role that can write to enableMotor variable logged in?

Have you checked that the “Accessibility” → “permissionOperate” is set to the currently logged-in user? Assuming you are using AS6.x this is a common oversight I had to adjust myself to, as per default changes were not accepted.

image

Hi Rodrigo,

There are a few different button types, and I personally found this a little confusing when I started working with mappView. The “Button” is can only be used with eventbindings. It is intended to trigger an action. This could be an action that changes a variable, but it can be many other things as well (e.g., logging out, changing the page, etc.) There are other buttons (PushButton, MomentaryPushButton, ToggleButton) which are meant to be tied directly to variables. These buttons have the Data property that you’re looking for.

In this case, I have a boolean variable that I want to adjust, and the mappView visualization has two buttons that I want to use, one button to make the variable true (ON), and the other makes it false (OFF). There is also a toggle button that I would like to use to flip the variable value (true if its already false, and false if its already true, an ON/OFF button so to speak.

What you describe is definitely possible, and I’ve put together a very simple testing/sample project that demonstrates it. Hopefully it helps you find the issue in your own project.

TestMappView.zip (139.5 KB)

In addition to the other suggestions, my suggestion would be to make sure your variable is used in code somewhere. It can be as simple as:

PROGRAM _INIT

    MyBooleanVar;

END_PROGRAM

The variable needs to be used in a program in order for the compiler to compile it, and if it’s not compiled then mappView can’t access it.