Messagebox with two Snippets

I am referring here to an example from the help section AS6 Help where a numerical value is to be displayed in a message box.

However, when I try to display two values in the message box, I simply cannot get it to work. When I attempt to bind the second value for the third time, I get an error stating that a further binding to the text is not possible.

I’ve also tried using two operands, but I can’t combine them in the expression, for example:
=myOperand1+myOperand2

Is there a solution to this?

Hello,

I would recommend to adapt the inital Text and add there the 2ten Snipped Information. The Event for the Messagebox will stay unchanged. It will only load one text and show it. But the Text itself contains both of your information.
image

If i have a look at the Operators for expressions the + is an Addition. I don’t think this can be used to combine strings. I only see Mathematical Operators.

Greetings
Michael

Hello,

I would also agree with the solution suggested by Michael.

I quickly tried it and it looks like this.

image

1 Like

It’s not as simple as just adding a second snippet! The values will only change with the right bindings.

My concern isn’t about how to insert a second snippet, but rather that the second snippet also changes the value.

The marked lines are not working!

Hi,

Ok. I understand your problem better now.

You want to use two snippets, and when any of the snippet values change, they should get updated in the MessageBox as well.

I could not find a way to solve this in mappView.

One workaround would be to monitor two variables in an application and use an additional variable to implement this.
However, it requires additional variables, a snippet, and some small logic, so I do not know if the effort is worth it or not.

The second option would be to connect with your local B&R office and discuss it with them.

1 Like

Hello,

I only found this information in AS-Help about Snippeds in Text. I am not sure if there is a alternative solution to this, with sinippeds. Your first snipped is also not updating i think, so i was not aware that this was a requirement in the question. Is this a requirement for you, to show actual value after opening of message box ?

Integrating snippets in texts

But if the Standard Message Box is not capable of showing your Data, you may use a coustom Dialog Box where you can add additional outputs like Numeric-Outputs which do show actual data.

Greetings
Michael

2 Likes

I agree with Michael, when you openned a message box you cannot change after the openning the value display in it, all is resolved before the openning.

As Michael mention you should use custom dialog with bindings to be able to modify the values. Else you close and re-open the message box

2 Likes

I only found this information in AS-Help about Snippeds in Text. I am not sure if there is a alternative solution to this, with sinippeds. Your first snipped is also not updating i think, so i was not aware that this was a requirement in the question. Is this a requirement for you, to show actual value after opening of message box ?

That’s exactly my problem: I have changes to the values and want to open the message box. However, the values in the message box aren’t up to date. If I switch the language before opening the message box, both values are updated.

So I can’t solve my problem using the system’s built-in message box and have to create a separate dialogue box.