WebSocket Server

Context

You can connect PCo as a WebSocket server to Web applications. The following processes are supported:

  • Notification Process

    The events provided by the source system can be displayed directly on modern user interfaces (for example, HTML5 interfaces) using the notification process. (See: Settings for the Notification Process with WebSocket.)

  • Query Process

    The connected client can send messages directly to the PCo WebSocket server. For example, you can query a specific tag in an OPC source system using a JSON retrieve message. PCo processes the query and returns a corresponding result.

Procedure

  1. Select the WebSocket Server checkbox and make the following connection settings:

    Field

    Description

    Allow Changes to Tag Values

    Indicates that the tag values from the source system can be changed.

    If you select the checkbox, the tag values of the data source can be changed using store queries if the tag can be changed in the source system.

    Unsecured Protocol

    Select this connection setting if you want to use an unsecured protocol.

    Secured Protocol (WSS)

    Select this connection setting if you want the communication to run with a secured protocol. In this case, you need to assign a certificate in the Certificate field.

    Port

    Here you need to enter the PCo port through which the WebSocket connection is to be established and kept alive.

    Server Certificate

    When using a secured protocol, you must assign a certificate here from the certificate store. You can use this certificate to identify PCo to the WebSocket-based client.

    Request Client Certificate

    Specifies that the client has to identify itself to PCo with a certificate. In the case of a WebSocket connection, the client is the Internet browser.

    If the indicator is set, the PCo server can ask that the client identifies itself with a certificate. This allows you to increase the security of the connection. However, for some browsers, it is not easily possible to request client certificates. In this case, deactivate the requesting of client certificates by deselecting the indicator.

    Client Root Certificate

    In this field, you can specify for the client the root certificate that is to be used to authenticate the client. The client certificate inherits the trustworthiness from the trusted root certificate. PCo only allows client certificates for the connection to the PCo WebSocket server that inherit from the specified root certificate.

    If you do not specify a root certificate, PCo allows all client certificates that inherit from a root certificate from Microsoft's trusted root certificate store (for example, Verisign) or from another trusted certification authority.

    Message Format

    Here you enter the data format for transferring the notification messages. The following data formats are available:

    • JSON

    • XML

  2. To create a destination system for the WebSocket, choose the Create Destination System function key.

    PCo creates the destination system automatically and displays the information Destination system used in configuration in the Status field. If no destination system exists, the information Destination system not created is displayed in the Status field.

  3. To delete the destination system, you can choose the Delete Destination System pushbutton. You can only delete the destination system if it is not being used in a notification.