Creating a Query Destination System with Parameterizable Tag Names

Prerequisites

You have created a source system, for example, an OPC UA source system, and an agent instance. The source system needs to support tag queries and the query type of the destination system.

Context

This procedure describes what you need to configure so that the names of the tags that are to be read or written can be determined dynamically at the runtime of the query destination system.

Procedure

  1. Create a new destination system of the type query destination system.
  2. Select the query type in the query definition area, for example, store query.
  3. Select the agent instance in the query definition area.
  4. In the Variables screen area, choose Browse Source System and Add Tag as New Variable.

    The browse window appears.

  5. In the browse window, choose only one of the four tags, for example, Tag1 (see example above). Choose Add Selected Items and close the browse window by choosing OK.

    The system now generates a variable for the tag. You can change the variable name to Tag, for example.

  6. In the Source System Tag column of the Variables table, replace the part of the tag path that is determined dynamically at the runtime of the agent instance with the character string {0}.

    In this example, therefore, you change nsurl=PCo;s=Machine1.Tag1 to nsurl=PCo;s=Machine1.Tag{0}.

  7. Depending on the query type, the query destination system now has an input variable (for store queries) or an output variable (for retrieve queries) with the name Tag_Value for the tag value. With the addition of the parameter {0}, the query destination system also gets an input variable with the name Tag_Parameter_0 of data type System.String. You transfer the character string, which is to be implemented at the runtime of the agent Instance instead of the parameter {0} to this input variable.
  8. You can also make additional parts of the tag name parameterizable. To do so, replace further parts of the original tag name with the character strings {1}, {2}, {3}, and so on.

    Each of these new parameters generates a new input variable with the suffixes _Parameter_1, _Parameter_2, _Parameter_3, and so on. In the example given above, you can also make the node name of the tag parameterizable by using the following character string as a tag name:

    nsurl=PCo;s={1}.Tag{0}