Configuring an OPC XML/DA Client connection to an OPC XML-DA server

The OPC XML/DA Client task/worksheet is used to communicate with any system that implements the OPC XML-DA protocol.

About OPC XML/DA

The OPC XML/DA Client task/worksheet uses the new OPC XML-DA communication protocol that was introduced by the OPC Foundation. OPC XML-DA is an improvement on OPC DA (also known as OPC Classic): it is based on the XML, SOAP, and WSDL standards for web services, instead of the original DCOM/OLE model that is used by OPC DA. It also standardizes the SOAP messages exchanged between clients and server, which allows the protocol to be implemented on different operating systems.

For more information, go to the OPC Foundation website.

Configuring a new OPC XML/DA server connection

To configure a new connection to an OPC XML/DA server:
  1. Do one of the following:
    • On the Insert tab of the ribbon, in the Communication group, click OPC Client and then select OPC XML/DA Connection from the drop-down list; or
    • In the Comm tab of the Project Explorer, right-click OPC XML/DA Connections and then click Insert on the shortcut menu.
    The Server Connection dialog is displayed:
    Figure 1. OPC XML/DA Server Connection dialog
    Web Studio Help dialog opcxml serverconnection OPC XML/DA

  2. In the Connection Name box, type a name for the connection.

    This name will be displayed in the OPC XML/DA Connections folder in the Project Explorer, and it is the name you will look for when you configure the OPC XML/DA Client worksheet.

  3. From the Specification list, select the exact OPC specificiation that you want to use to communicate with the server.
  4. From the Host Name list, select the name or address of the host to which you want to connect. Hosts should broadcast their availability on the network. If the host you want doesn’t appear to be available, click Refresh to update the list.
  5. From the Server Url list, select a specific OPC server process on the host. If the process you want doesn’t appear, click Refresh the update the list from the host.
  6. In the User Name and Password boxes, type your login credentials for the OPC server process.
  7. In the Ping Rate box, type the frequency (in milliseconds) at which the client should ping the server to make sure the connection is still active. By default, the client pings the server once per minute.
  8. Click OK. The connection is saved in the OPC XML/DA Connections folder in the Project Explorer.

Configuring a new OPC XML/DA Client worksheet

To configure a new OPC XML/DA Client worksheet:
  1. Do one of the following:
    • On the Insert tab of the ribbon, in the Communication group, click OPC Client and then select OPC XML/DA Client from the drop-down list; or
    • In the Comm tab of the Project Explorer, right-click OPC XML/DA and then click Insert on the shortcut menu.
    A new OPC XML/DA Client worksheet is displayed:
    Figure 2. OPC XML/DA Client worksheet
    Web Studio Help worksheet comm opcxml OPC XML/DA

  2. In the Description box, type a description of the worksheet. This is for documentation purposes only and does not affect the execution of the worksheet.
  3. In the Connection list, select the server connection that you configured earlier.
  4. For more connection options, click Advanced.
    The Advanced dialog box is displayed.
    Figure 3. Advanced dialog box
    Web Studio Help worksheet comm opcua advanced OPC XML/DA

    Review the settings and configure as needed:
    Read actions
    Enable subscription
    When this value is TRUE (non-zero), the client will subscribe to the server nodes so that it can receive notifications when the node values change.
    Note: This is enabled by default. If it is disabled, you must use read triggers (see below).
    Maximum group size
    The maximum number of server nodes that may be read in a single read operation.

    For example, if you have 1000 items/rows configured in the worksheet and Maximum group size is set to 100, 10 read operations will be performed when a read is triggered.

    Synchronous read trigger
    When the value of this tag/expression changes, the client reads all of the node values from the server. The read operation is performed synchronously, which means all other client operations are blocked until the read operation is finished. When the read operation is finished, the client increments the tag configured in Read count.
    Asynchronous read trigger
    The same as Synchronous read trigger except that the read operation is performed asynchronously, which means that other client operations may continue while the read operation is being performed.
    Read count
    The name of a project tag (Integer type) that will receive a count of the number of read operations performed since the project was run.
    Status
    The name of a project tag (Integer type) that will receive a status code for the last read operation performed by a trigger. If the status code is 0, the read operation finished successfully. For all other status codes, see List of read/write status codes and messages for OPC UA.
    Status message
    The name of a project tag (String type) that will receive the corresponding status message.
    Maximum aging
    The maximum age (in milliseconds) of values that will be accepted from the server’s cache. If a value is older than this, the server will be forced to get the latest value from the field device.
    Sampling rate
    When this option is selected, you can change the rate (in milliseconds) at which the OPC server reads from field devices. By default, the sampling rate is half the publishing rate.
    Write actions
    Enable write on tag change
    When this value is TRUE (non-zero), an asynchronous write operation will be performed automatically whenever the value of a project tag changes. All tag changes that occured since the last scan of the worksheet will be written in a single write operation, or in multiple write operations if the number of tag changes exceeds the maximum group size.
    Note: This is enabled by default. If it is disabled, you must use write triggers (see below).
    Maximum group size
    The maximum number of tag changes that may be written in a single write operation.

    For example, if you have 1000 items/rows configured in the worksheet and Maximum group size is set to 100, 10 write operations will be performed during each scan of the worksheet.

    Synchronous write trigger
    When the value of this tag/expression changes, the client writes all of the tag values to the server. The write operation is performed synchronously, which means all other client operations are blocked until the write operation is finished. When the write operation is finished, the client increments the tag configured in Write count.
    Asynchronous write trigger
    The same as Synchronous write trigger except that the write operation is performed asynchronously, which means that other client operations may continue while the write operation is being performed.
    Write count
    The name of a project tag (Integer type) that will receive a count of the number of write operations performed since the project was run.
    Status
    The name of a project tag (Integer type) that will receive a status code for the last write operation performed by a trigger. If the status code is 0, the write operation finished successfully. For all other status codes, see List of read/write status codes and messages for OPC UA.
    Status message
    The name of a project tag (String type) that will receive the corresponding status message.
    Reload trigger
    The name of a project tag (Boolean, Integer, or Real type) that can be used as a trigger. When the value of this tag changes, the worksheet is reloaded. Tags in curly brackets (e.g., {tagname}) configured in the body of the worksheet are refreshed only when the worksheet is reloaded. After the worksheet is reloaded, the value of this tag will be reset to 0.
    Refresh IDs on startup
    When this option is selected, the node IDs in the worksheet will be refreshed from the specified paths every time the project is run.
    Note: Refreshing IDs like this may cause the project to take longer to start up, so if you select this option, you should also specify a root node (see below) to limit how much of the server’s list of items must scanned.
    Ensure cache synchronization
    When this option is selected, the client will wait after each write operation for confirmation from the server that the node values actually changed. If the client does not receive confirmation, it will restore the previous tag values.
    Enable bit notation
    When this option is selected, bit notation is allowed in the Item column of the worksheet body.
    Note: IWS‘s OPC client does not normally use the Triggering Mode that is defined the OPC protocol. Instead, it allows any change in any tag/expression to be used as a trigger. If you want to use Triggering Mode, configure one worksheet to read the trigger values, and then configure another worksheet that specifies the read values as triggers.
  5. Click OK to close the Advanced dialog box and return to the worksheet.
  6. In the Status box, type the name of a project tag (Integer type) that will receive connection status codes during project runtime.
  7. In the Status Message box, type the name of a project tag (String type) that will receive the corresponding status messages.
  8. In the Publish Rate box, type the frequency (in milliseconds) at which the client will request updates from the server.
  9. In the Disable box, type a tag/expression. When the value is TRUE (non-zero), the worksheet will not be executed.
  10. In the Percent Deadband box, you may type a value between 0.0 and 100.0, as a percentage of the full engineering units scale. (The scale is calculated using the specified minimum and maximum values of the server item.) This tells the server to publish only changes in item values that are greater than the specified deadband. For example, if the minimum value is 1000, the maximum value is 5000, and the deadband is 0.1, then only changes greater than 4 (i.e., 0.1% of 4000) will be published by the server.

    If you do not specify a deadband, then the default is 0.0, which means the server will publish all changes in item values.

    Note: Percent Deadband only applies to server items that have the Engineering Units Type attribute (dwEUType) set to Analog (1). For more information about this attribute, see either the OPC specification or the documentation for the OPC server.
    CAUTION:
    If Ensure cache synchronization (in the advanced settings) is selected, then Percent Deadband should not be used.
  11. In the Root node or view box, specify the server node that will serve as the root for all items in the worksheet body. Specifying a root node makes it easier to find items and improves runtime performance.
  12. For each row of the worksheet body, specify the following:
    • Tag Name: The name of a project tag.

      You may use indirect tags (e.g., {tagname}), but if you do, then be sure to configure the Reload trigger option above.

    • Item: The server item with which the project tag should be associated.

      To browse the server’s list of items, right-click in this field and then click Browse on the shortcut menu.

      Note: If Enable bit notation is selected in the advanced settings, you can select a specific bit of a server node value by appending the bit number to the item name (e.g., nodepath.bit). Please note that this is supported only for unsigned variables and 32-bit signed variables; if you try to do it with 16-bit or 8-bit signed variables, the most significant bit (MSB) will not work properly.
    • Scan: If Always, then the row is continuously scanned during runtime. If Screen, then the row is scanned only when a project screen that uses the specified tag is open.
    • Div: For scaling — the value is divided by this number when reading from the server, and it is multiplied by this number when writing to the server.
    • Add: For scaling — this number is added to the value when reading from the server, and it is subtracted from the value when writing to the server.
    • Array Index: If the server item is an array, then the array index with which the project tag should be associated.
  13. Save and close the worksheet.

Enabling the OPC XML/DA Client task

To enable the OPC XML/DA Client task for runtime:
  1. On the Home tab of the ribbon, in either the Local Management or Remote Management group (depending on where the project server will be), click Tasks.

    The Execution Tasks dialog is displayed.

  2. In the list of tasks, select OPC XML/DA Client Runtime.
  3. Click Startup.

    The Startup dialog is displayed.

  4. Select Automatic, and then click OK.
  5. Click OK again to close the Execution Tasks dialog.
Note: The OPC XML/DA specification supports custom item qualities using the high byte of the two-byte quality field. However, such qualities are often vendor-specific or even hand-coded, so it is not possible for InduSoft Web Studio to interpret them. All item qualities other than GOOD (192) will be ignored.

OPC XML/DA