For whatever reason, Mappview lacks an easy way to show my machine state dynamically by the use of a text list. Simplified, when my case step changes, the number is used to trigger a text in a textoutput field. When the case changes to another number again, another text is shown in the same text output. I could do this by writing a different string value to a string variable every time, but then its not translatable, so I need a localizable text list
When I’m binding a text output, it shows me a tab called “List” where I am able to bind a OPC-UA selector and a binding list. This seems to be the way I need, but I can’t get it to work. When I ask B&R they use another method using snippets, but that’s another dead end as well, simply because I lack the xml knowledge and the way things communicate.
Would someone be willing to explain to me in detail how to accomplish this?
I have a localized text file with my states in it and I use an integer (or actually Enum) which should trigger these texts into an text output.
In the images I hope you can find what I am trying to accomplish with these binding lists. (Sorry, new user can only put 1 image).
Hi Patrick,
this way I think you can also achieve the goal. I guess the reason why it is not working now is that $IAT/… is not a valid element here.
You can try creating two (just to try it) session variables to store the full identifiers of the text.
Here is how it could look like:
create a list having these elements
With this approach you can get also some default text for the case you will add more states in future without breaking the text system at the widget.
Other option would be to use the snippet (but you already know).
I hope I do not have a typo there. I did not compile it. Let me know if that approach is working for you.
There may be a second solution:
You can use the Widget DropDownBox and configure it in a way that it visually does not appear as drop down box. Set enable=false and showOpenIndicator=false, this should prevent the list from opening when you click on it and hide the arrow.
Change the colors that it doesn’t appear greayed out and maybe you have to change some mousedown colors, that the users does not notice it’s clickable.
The propertie dataProvider is bindable to IAT Texts with an assigned value. selectedValue is bindable to your step number. That way the Text of the widget should change if the step number changes.
Essentially you are switching the selected Item from the DropDownBox with the step number but nobody notices that it’s a DropDownBox
Pro of this solution: The binding is directly editable in the MappView editor and everybody understands it.
Con: The widget is beeing “abused”.
Björn, thank you! That is a very good alternative. Saving this for later! It is actually much easier that way.
Funnily enough, the first method I was thought was by a colleague of mine, it was a somewhat butchered way to make it happen.
Insert an imagelist and make it invisible, use it’s selectedIndex for binding with your integer, and then trigger an event that if this selectedindex changes to a specfic number it will show my text id entry to TextOutput1.
There are more ways that lead to Rome but I prefer Tomas and yours!