Operating the Application

General

The application example implements a web visualization for monitoring and control purposes.

This section provides a brief description of each function. In addition, refer to the visualization screen.

Open the Web Visualization

To open the web visualization, enter the following address in the address bar of your web browser:

http://<IP Address form the controller>:8080\webvisu.htm

Register a New Machine in EcoStruxure Machine Advisor

Before you can send data from your controller to the EcoStruxure Machine Advisor a machine must be registered in your account, to this you can connect to.

Step

Action

1

Activate the radio button M262 as gateway.

2

Select the format Charly.

3

Use either HTTPs or MQTTs as transport protocol.

Result: The generated configuration is provided. The provided parameter must be transferred into the application as connection parameter of the corresponding client.

Obtain the IPv4 Address Using the DNS Client

For the connection to the EcoStruxure Machine Advisor, the corresponding client requires the IPv4 address of the EcoStruxure Machine Advisor. The IPv4 address can be obtained by using the implemented DNS client functionality. Therefore, switch to the DNS client visualization screen and send a request to a reachable DNS server to get resolved IP address for the specified domain name.

Establish a Connection to the EcoStruxure Machine Advisor Using the MQTT Client

Before you can establish a connection, you must specify the corresponding parameters.

oEnter the IPv4 address of the EcoStruxure Machine Advisor

oThe port number corresponds to the standard MQTTS port and must be set to 8883.

oEnter the corresponding parameters Client ID, Username, and Password, which are provided on the EcoStruxure Machine Advisor configuration page.

oThe TopicName is filled automatically when entering the Client ID, the format is devices/<client id>/messages/events/

To establish the connection, click Connect. The progress and the result of the operation is displayed in the display Status on the visualization screen. After the connection is successfully established, the connection status changes to Connected. The button Connect changes to Disconnect and can be used to close the connection.

The application example implements an auto reconnect function which can be activated / deactivated at any time.

Establish a Connection to the EcoStruxure Machine Advisor Using the HTTP Client

Before you can establish a connection, you must specify the corresponding parameters.

oEnter the IPv4 address of the EcoStruxure Machine Advisor, in case there is an http proxy server between your controller and the Internet, enter the IPv4 address of the proxy server.

oThe port number corresponds to the standard HTTPS port and must be set to 443.

oEnter the corresponding parameters Hostname, Resource, Custom Header 1, and Custom Header 2, which are provided on the EcoStruxure Machine Advisor configuration page.

NOTE: If you have the server URL available for the registered machine twin, you can also enter this into the field Server URL. Doing so, the required fields Hostname and Resource are filled automatically.

To establish the connection, click Connect. The progress and the result of the operation is displayed in the display Status on the visualization screen. After the connection is successfully established, the connection status changes to Connected. The button Connect changes to Disconnect and can be used to close the connection.

The application example implements an auto reconnect function which can be activated / deactivated at any time.

Transmit Data

The application implements four different sample data assets which can be sent to the EcoStruxure Machine Advisor. Therefore, the visualizations for the HTTP client and the MQTT client provided the dedicated displays:

oData OEE - asset 1

oData Motor1 - asset 2

oData Motor2 - asset 3

oTest - asset 4

Each of the four data assets can be edited from the visualization by clicking Edit data.

To request the transmission of the data asset, click Transmit. If the button Transmit is green, the request for the transmission is stored it switches back to grey when the transmission request has been processed.

The request is processed when the following preconditions are fulfilled:

oThe corresponding client is in state Connected.

oNo other data transmission is in progress.

The result of the data transmission is provided in the associated display. Depending on the used client, the detailed status of the latest data transmission is provided on the corresponding visualization screen.

For the HTTP client, the http status code, the header, and the content of the received server response are provided.

For the MQTT client, the status and the result of the function block FB_MqttPublish are provided.

Considerations for TLS Certificates

The clients in the application are configured that only connections to servers which provide a trusted certificate are accepted. This requires that you must declare the server certificate as trusted on your controller. For more information about certificate management on the controller, refer to How to Manage Certificates on the Controller - User Guide.