This function block is used to store the access parameter for accessing the EcoStruxure Machine Advisor cloud services supported by this library. The access parameters are required by the function block FB_ESMAClientMonitoringApi. Thus, an instance of this function block must be assigned to the corresponding interface at the instance of FB_ESMAClientMonitoringApi. For the link, the function block implements the interface IF_ESMAClientCredentials.
For the configuration of the client credentials only the connection string for your registered machine is required. The additional parameters, for example the access token, the MQTT topic name, and the client ID, are retrieved from the connection string and the predefined constants in the ESMAMonitoringApi.
With using the connection string, the required access token is generated by the function block. The access token has an expiration date which is calculated from the Real-Time Clock (RTC) of the controller and the specified validity period.
For the update of the controller RTC, you can use the function block FB_SntpClient from the TimeSync library. For more information, refer to TimeSync Library Guide.
As an alternative to use the connection string, the access token generated on the website can be assigned to the corresponding property of this function block. The last parameter set (AccessToken or ConnectionString) is used to provide the token using the GetAccessToken method.
For more information about registration and connection of your machine in EcoStruxure Machine Advisor, refer to registration and connection in the EcoStruxure Machine Advisor web application.