EcoStruxure Machine Expert provides access to many of its online services via the scripting API. In order to establish a connection or to use an online service at a later time, valid credentials must be stored in the system.
You can store credentials via online device or online application in case of multi-controller projects. If there are specific credentials provided for the connection, they will be used by the system.
Example:
# create an "online device" to use online services
root_device = projects.primary.find("LMC_PacDrive", False)[0]
online_device = online.create_online_device(root_device)
# store credentials specific to this "online device"
online.set_specific_credentials(online_device, "my_user", "my_password")
# use of any online service
online_device.connect()
If no specific credentials are provided for the connection, the system uses the default credentials.
Example:
# create an "online device" to use online services
root_device = projects.primary.find("LMC_PacDrive", False)[0]
online_device = online.create_online_device(root_device)
# store default credentials
online.set_default_credentials("my_user", "my_password")
# use of any online service
online_device.connect()
The following scenarios require the password to be changed by the user after authentication:
First login to a new controller.
First connection after the user rights management has been reset to default.
A password renewal is enforced for a specific user by an administrator of the device.
A password expired conforming to the expiration timeout configured by your controller.
EcoStruxure Machine Expert does not support the renewal of passwords using the scripting API. Perform this by using the service tool Controller Assistant.
You can call the latest version of Controller Assistant from command line as indicated in the following example:
"c:\Program Files (x86)\Schneider Electric\EcoStruxureMachine Expert\Tools\ControllerAssistant\ControllerAssistant.exe" -username Administrator -password Administrator -renewalpassword MyNewPassword -getcontrollerinfo etcp4://192.168.3.50
For further information, refer to the EcoStruxure Machine Expert Controller Assistant User Guide.