Hello Community,
i have a compound widget as you can see below. If the button is clicked a variable ‘BtnTest.intCommand’ is set to a fixed value. The plc application then reacts somhow to this. With this implementation it works as intended.
I don’t know if I get it right, you want the NumericOutput hidden on the HMI? If it’s that just use property visible to false.
If it depend on some role you can use permissionView property.
That´s possible, but this way i still have to create the NumericOutput and bind it to the variable. In case i have multiple buttons, this can be effortful.
I´d rather find a way to adjust my eventbinding so the variable is set directly.
I still don’t really know what you’re trying to do
You want to bind a variable to the compoundWidget then set this variable based on which button is selected?
I may also not be understanding correctly, but it seems like you are using an event binding so that when a button is pressed the numeric input value is changed.
You would like to not display the numeric input.
If that is correct, then you can simply replace the widget.Action with an opcUa.NodeAction to change the variable BtnTest.intCommand directly.
There is syntax error in your code, but anyways you cannot use opcUa action in a Compound widget, but at this point why you want to use a Compound widget, if you use buttons in a content you can use eventbinding on them and use opcUa action to set the value.
Maybe you can give us a little bit more of context?
Thank you @florent.boissadier . This information was very helpfull, i didn´t know this explicit restriction.
With this information i´m going to close this thread.
Summarize:
Within compoundwidget it is not possible to set a the binded variable directly via button click.
The best way to handle this is to make the numeric output invisible.
Outside a compoundwidget simply a opcUa.NodeAction can be used to set the variable.
There is some confusion here.
The restriction will not let you use an opcua action within the compound widget itself, however you can define an event for the button within the compound widget being clicked.
Then once you place your compound widget on a content, you can assign an opcua action to the configured event binding.