mappView: mapping a text from a "TextList" to TextOutputs using indices

Greetings,

I am trying to utilize mappView Snippets; however, I must confess that the Help documentation remains entirely opaque to me.

My hardware configuration comprises a 4PPC50, running Automation System version 4.12 and mappView 5.24.

Due to historical precedents, the authentication system is managed within the controller’s program logic. The login history is archived in the array LoginHist[0..15].

My objective is as follows:

Within the LoginHist[0..15] array, each structure member contains an integer field named “level”, which assumes one of four values with the following semantics:

0 = “view only”
1 = “maintenance”
2 = “technician”
3 = “engineer”

In the visualization, I wish to present a summary table on a single page, wherein each row (indexed 0 through 15) displays the textual representation corresponding to the login level, rather than the raw integer values (0 through 3).

I possess a file named snippets_TextLists.snippet containing the following snippet definition:

I’m sorry, but after saving the post, some of the code isn’t showing up.

So snippet is declared with id=“TextListLoginRole”, type=“IndexText” and formatItem=“IAT/LoginRole.{1}”

I have incorporated the following into Visualizat.vis:

<SnippetsSets>
	<SnippetsSet refId="snippets_TextLists" />
</SnippetsSets>

Furthermore, my LocalizableTexts.tmx file contains:

    <tu tuid="LoginRole.0">
      <tuv xml:lang="cs-CZ">
        <seg>ZÁKLADNÍ</seg>
      </tuv>
      <tuv xml:lang="en">
        <seg>VIEW ONLY</seg>
      </tuv>
    </tu>

along with analogous definitions for indices 1 through 3.

In the file LoginHist.binding, I have appended:

	<Binding mode="oneWay">
		<Source xsi:type="opcUa" refId="::AsGlobalPV:LoginHist[0].level" attribute="value" />
		<Target xsi:type="snippet" refId="TextListLoginRole" attribute="value" />
	</Binding>		

On the page LoginHist.content, I have inserted a TextOutput widget, currently configured solely for LoginHist[0].level.

Herein lies my impasse. I have exhaustively reviewed all options within the Data.value.Binding property, yet I remain uncertain of the correct path forward.

Perhaps I am pursuing an erroneous approach: Is it feasible to display text strings derived from a single “TextList” across multiple TextOutput widgets on the same page, each referencing a distinct index?

Thank you for your assistance.

Luboš Hemelík

Hi @Lubos_Hemelik

Lets see if we can help you out in your quest!

Here is an example from the mapp-framework and may help you makes sense of the help by seeing a working example

You already have this or some from of it.

<Snippet id="IndexTextSnippetRecipeMsgBoxType" xsi:type="session" Type="IndexText" formatItem="IAT/mappFramework/Recipe/MsgBox.Confirm.{1}" />

You have a text file

And the bindings to tie it all together

<Binding mode="twoWay">
   <Source xsi:type="opcUa" refId="::RecipeMgr:MpRecipeUIConnect.MessageBox.Type" attribute="value" />
   <Target xsi:type="snippet" refId="IndexTextSnippetRecipeMsgBoxType" attribute="value" />
  </Binding>
  <Binding mode="oneWay">
   <Source xsi:type="snippet" refId="IndexTextSnippetRecipeMsgBoxType" attribute="value" />
   <Target xsi:type="text" refId="IAT/mappFramework/Recipe/MsgBoxType" attribute="value" />
  </Binding>
  <Binding mode="oneWay">
   <Source xsi:type="snippet" refId="IndexTextSnippetRecipeMsgBoxType" attribute="value" />
   <Target xsi:type="session" refId="SessionVarMsgBoxType" attribute="value" />
  </Binding>

Your use case is bit different overall but the underlying concepts should be the same.
Let us know if this helps in any way or if you already had this configured.

Dear Marcel,

Thank you for your suggestion. I have proceeded according to the Help documentation under “Binding snippets to a group of texts.”

Step 1: TextGroup

Step 2: Snippet

Step 3: Visualizat_vis
Visualizat_vis

Step 4: TextOutput Widget
I am unable to configure the Data\value\Binding.

Step 5: Binding

Step 6: “TextOutput_Rec00_uroven” Error codes after downloading
Error_withIndex0 LoginHist[0].uroven == 0
Error_withIndex1 LoginHist[0].uroven == 1

The index varies, indicating that the snippet is functional. However, the error message states: “Requested text entry does not exist.”

Where might I be going wrong?

Thank you,
Luboš

Hello,

Is your TMX file selected in the Textsystem Configuration?

That’s exactly it—it’s working now!!!

I guess I just got a little lost trying to figure out where to set everything. Some settings are in the Logical view, while some are in the Configuration view, and all it takes is overlooking one of those (for me) hidden details, and I’m in for a real headache.

In any case, I’d like to thank everyone—without the community, I would have given up long ago.

Díky

Luboš