we have a special mode on our maschines where the operator can change to a “recipe prepare” mode. In this mode all variables are disabled except the ones saved in a recipe.
like this he can prepare a new recipe directly on the maschine without interrupting the producing maschine.
In VC4 we could do that with a style in which the StatusDatapoint was defined and linked to a variable already. So everytime a added a new Input with this style, the statusdatapoint was connected to the correct variable without the need of any additional work and we could disable all these variables in the application by setting the statusdatapoint correctly.
How to solve that in mappView? I bind the “Enable” of a widget to a session variable which is set by the application to “false” to disable the specific widget.
BUT I have to do that binding for every single widget again and again and again….. is there a easier way to go? Can I assign a “default binding” somehow?
The widgets to disable are all over the visualisation and not just on one page, so I can’t just disable a groupbox.
Hello, you can achieve a similar result in mapp View. Create a style for your widgets and bind the enable property to a global variable (e.g., gRecipeMode). In your application logic, toggle this variable to disable/enable all widgets using that style. For widgets that should always be active in recipe mode, you can either use a different style or override the enable property on the specific widget instance.
With a script you can search all widgets for a certain name and then manipulate them all. The following script runs on the content ‘contentStart’ and will be trigger when the OPC UA variable numEnable changes. Then it will look for all widgets that contain "‘NumericInput” in its name and then set the enable of this widgets to the OPC UA value.
There are a few important function and performance notes that I have to make here
mapp Script is an extra license
The function that I use to list all widgets is undocumented and not official
Since you can not cast widgets, you can only manipulate basic properties that all widgets have
Make sure that the OPC UA variable does not change too fast
The function searches all widgets on that content, so you must make sure that there is a limited number of widgets. You can always create a container on your page where most widgets are matches and you dont search the complete page.
Test the function on a real target (not your laptop) to make sure that performance is ok.