Update numeric value in text if indextext is used

Value is not updating in text.
Plz find attached image

Hello and welcome to the community,

as I understand your question, the value from the snippet is not updated on the visualization.

Therefore, please have a look at the usecase for snippets in Automation Help.
To me it seems, like you are missing some bindings.

Maybe this post can also help you.

BR
Fabian

1 Like

From private message:

Yes u r right
But if this text is also used as index text (group of text) and then value dont update until i changed indextext.

Hello,
I’m not sure where the problem is and with which widget.
For updating texts in widgets you need to have the three bindings in place.

What kind of “group of text” do you use?

BR Fabian

Hello,
let me try to bring some light into this:

If you have and OPC-UA snippet, like this - “Pump1 Speed{@speednumericvalsnippet}” - in your TMX file, you’re creating a static reference to an OPC-UA variable. Such static references are resolved while the texts of your TMX files are transferred to the client. This is usually when you open the HMI or change the language within the HMI. However, this is a one time process - there is no “dynamic” lookup or monitoring of these references, so they will not update automatically!

On the other side, you have the “triple binding” - where you bind a variable to a snippet, the snippet to a text and the text to a widget … in this scenario you have a “trigger”, the bound variable, which tells the snippet that something has changed, which in addition updates the text on the widget. But also in this scenario: If you’re using (as in the example above) an index-text snippet, the text fragments of the TMX files are “static”, they will not be updated. The index text snippet only determines which text to return.

I’m afraid that the use case of updating the OPC-UA snippets in the TMX files dynamically is not supported at the moment. To solve such use cases you would need to assemble the strings via an application task on the PLC.

2 Likes

Hello,
I’m sorry, I will not contact you via Whatsapp or Teamviewer. If you suspect a problem, please contact your local support.

What I can share with you is a small sample with steps.

Create your texts in a mappView localizable texts file:

Make sure to have a Project.language file in place and configured accordingly:

Add a snippet file and a snippet in the Resources folder of mappView:

Place a Textoutput-Widget on a content and connect your TextId from the textsystem:
image

Create a task with a variable, use it in the task and enable the OPC UA tag for it:

Add your textfile to the textsystem configuration:

Add a binding file to the mappView package with the responsible bindings.

Add a vis File and provide the created files:

Transfer and check

As shown this works fine for e.g Textoutput-Widgets. If you have a dataprovider for e.g a DropDownBox- or just a SetText action for a Lable-Widget, this will not work.

As Christian wrote beside the “triple binding” the values inside of textsystem text can not be updated.

How do you want to use this and when it should update?

2 Likes

tried solution as per your last statement but no results

if we changed text using index snippet then it will not work
plz chk attached image

@fabian.pries plz chk this with index text snippet. Means text also need to be dynamic using index snippet and @speednumericvalsnippet also updated.
It wont work for me

Hello,

for the IndexText Snippet it is the way Christian Hobelsberger tried to describe. The snippet is only evaluated when the index is changed, meaning that also the {snippetTemp} is only evaluated when the index is changed.

The IndexText Snippet is therefore not designed to have this kind of dynamics.

I am not able to find a solution, for updating the {snippetTemp} within an IndexText Snippet, since you can not have multiple targets for one variable or snippet.

What you could try is, to duplicate the textkey (abc.1 and abc.2), and toggle between the to indices.

What Christian meant, was that you don’t bind a textkey but an OPC UA String Variable with the text to the output widget. The String Variable is build in the application, and updates the value accordingly.

BR Fabian

tried this but delayed update.

Hello,

I think I have a possible solution for you.

Create two snippets. One for the updating of the value and one for the indexText.

Create your IndexTexts and additionally a TextKey without the index.
Use the snippet for updating the Value as before.
Use the snippet for the IndexText as your value of the TextKey.
image

Create your bindings as following.

If the update value snippet is used as your current TextKey the value gets updatet.
If the update value snippet is not used the binding is not being applied, but is still active without effect. No entries in the logger.

With this setup I was able to accomplish the usecase.

What else could work:

  1. Create the text on the PLC using ArTextSys and the values you want to display. Then bind the created STRING containing your text and value.

  2. Create a compound widget to display textoutput and numeric output together as one widget.

  3. Live with the delayed updates at the indextext toggling.

With this I’m out ideas, if it is still not working for you.
In this case you might want to get in contact with your local support to find other possibilities.

All the best
Fabian

1 Like

If your text isn’t session dependent you maybe take a look in the Function Block “ArTextSysGetFormattedText”
https://help.br-automation.com/#/en/4/libraries%2Fartextsys%2Ffunktionsbausteine%2Fartextsys_artextsysgetformattedtext%2Fartextsys_-_artextsysgetformattedtext().html

Using this you can create your text based on a TMX file and provide argument, get result and bind it to a widget

Hope it can help!

Regards,
Florent

this solution does not work at my end
Please suggest solution.

Hello @c587237 ,

as I wrote before, with my last suggestions I am out of ideas.
You got good suggestions also from @florent.boissadier, so you might want to pick one of them.
If none of the proposed suggestions solve your case, please contact your local support office.

The last thing I can do, is share my test project with you. There the updating of the value and the change via indexText Snippet is working.
Support.zip (134.7 KB)

Use the variable “indexText” in “Program2” to switch through the texts. Text at index 1 is using the snippet.

BR Fabian

1 Like

can u plz share sample using ur suggested way.

Hi,

Here is an example :
test.zip (1.1 MB)

Please take care about this information shared in the help of the function block, my example didn’t integrate this.
image

In the TMX file you can format the text like it’s specify in the help of FBK ArTextSysFormatString

Hope this help!

Best regards,
Florent