Controller.DeviceReplacement

The Generation B Controller, starting with firmware version 2.0.0, includes the Device Replacement feature. This feature allows a piece of hardware that has failed during operation to be replaced with new hardware, and the necessary application data to be transferred.

Activity Diagram for Device Replacement

The functionality is described in five steps:

  • General Information

  • Preparation and configuration during commissioning

  • Automatic storage during normal operation

  • Replacement of defective hardware and transfer of application data

  • Final activities

General Information

Different types of Data

Application data is categorized into three different data types.

  • Requested Data
    The slowly changing data are saved when a change occurs. This data includes boot projects and similar data that changes only rarely and is required for machine operation. This data is backed up when project is changed, when the machine configuration is modified, or when a parameter set is saved.

  • Immediate Data
    The fast-changing data are stored in RAM and archived on the SD Card shortly before data loss. This data are aggregated during machine operation and reflects the current state of the machine. Data generated by EASY UI Visualization such as trend data are backed up automatically. If the customer wants to write additional cyclic data, this must be implemented in the Soft PLC within the IEC application using the corresponding parameter via Function Block.

  • Retain Data
    The retain data are written unencrypted directly to the SD Card in the event of a power loss. These data are secured via signing mechanisms and contains the most recent production data generated during machine operation. They are backed up exclusively in a power-fail scenario.

Different types of encryption Keys

There are two different types of encryption keys:

  • Device-Key (default setting)
    The Device-Key fully meets the applicable security-level requirements and is the default key in the Controller's delivery state. This Device-Key is unique to each individual Controller and is generated automatically; in other words, the User does not need to configure any settings for this. However, it requires additional handling because the key must be backed up separately (e.g., via a USB Stick or a communication module) during machine configuration and stored securely. The backup must remain available and be protected against unauthorized access to ensure compliance with the applicable security-level requirements. It must be available so that the key can be provided to the replacement Controller.

  • Lenze-Key
    The Lenze-Key is easy to use because it comes preinstalled on all Controllers, meaning the same key is available on all Devices. The advantage is that it does not need to be transferred (no extra USB Stick or communication module transfer needed); the disadvantage is that the encrypted Application Data on the SD Card can be loaded onto any Controller, so from a security perspective, it should only be used for applications in a protected environment. Its use is recommended only for commissioning series-production machines. After commissioning the Controller should be reconfigured to use a different encryption method, e.g. the Device-Key.

Preparation and configuration during Commissioning

First, you must select a key, and depending on which key you choose, you may need to back it up externally.

Preparation and configuration during Commissioning

Preparation of Lenze-Key

To use the Lenze-Key, follow these steps:

  • Start PLC Designer or EASY Starter and connect to the Controller.

  • User authentication and log in.

  • Use parameter 0x5906:10 "Secret transfer: Type" and select "Lenze [0]".

  • Execute parameter 0x5906:1 "Secret transfer: Apply settings" with "On / Start [1]" to activate the selected key.

  • Save the parameter set to update the data currently stored on the SD Card.

Preparation of Device-Key (default setting)

To use the Device_Key, follow these steps:

  • Start PLC Designer or EASY Starter and connect to the Controller.

  • User authentication and log in.

  • Use parameter 0x5906:10 "Secret transfer: Type" and select "[1] Device" (factory default).

  • Use parameter 0x5906:11 "Secret transfer: Storage" and select "[0] USB stick" or "[1] COM module".

  • Execute parameter 0x5906:1 "Secret transfer: Apply settings" with "On / Start [1]" to activate the selected key and save the Storage-Location.

  • Make sure the desired storage device [0] USB stick or [1] COM module is connected.

  • Execute parameter 0x5906:2 "Secret transfer: Save to storage" with "On / Start [1]" to transfer the cryptographically protected Device-Key to the selected storage.

  • Save the parameter set to update the data currently stored on the SD Card.

  • If USB storage was used to store the Device-Key, remove the USB stick from the Controller and store it securely.

Automatic storage during normal operation

During operation, the controller saves its application data to the SD card. This is done in different ways, depending on the data.

Automatic storage

Immediate data

  • The fast-changing data are stored in RAM and archived on the SD Card shortly before data loss. This data are aggregated during machine operation and reflects the current state of the machine. Data generated by EASY UI Visualization such as trend data are backed up automatically.

  • For other cyclic data written by the customer application, the L_IPAP_ParameterManagerAccess library and the L_IPAP_ParameterWrite function block can be used. Write parameter 0x2022:55 "Device Command: Backup immediately data" with "On / Start [1]" to trigger the backup of this data.

  • Frequent cyclic write operations reduce the service life of the SD Card and internal storage. Therefore, the backup should be triggered only at appropriate intervals, either after a meaningful amount of data has accumulated of after a suitable time interval has elapsed.

Requested data

  • The slowly changing data are saved when a change occurs. This data includes boot projects and similar data that changes only rarely and is required for machine operation. This data is backed up when project is changed, when the machine configuration is modified, or when a parameter set is saved.

Retain data

  • The retain data are written unencrypted directly to the SD Card in the event of a power loss. These data are secured via signing mechanisms and contains the most recent production data generated during machine operation. They are backed up exclusively in a power-fail scenario.

Replacement of defective hardware and transfer of application data

The "Replacement" step varies depending on the key used.

Replacement

Replacement using Lenze-Key

  • Ensure that the replacement Controller is in the required initial state.

  • Insert the SD Card from the defective Controller into the new Controller.

  • Switch on the supply voltage and boot the new Controller.

  • If necessary, the Controller starts an automatic firmware update. This firmware update can be recognized by the Controller status LEDs. Details of the update are entered in the logbook.

  • After successful checks and restoration, the data from the defective Controller, such as an executable boot project and visualization, is reused.

 

Replacement using Device-Key

  • Ensure that the replacement Controller is in the required initial state.

  • Insert the SD Card from the defective Controller into the new Controller.

  • Insert the used USB Stick or the Communication Module into the new Controller.

  • Switch on the supply voltage and boot the new Controller.

  • If necessary, the Controller starts an automatic firmware update. This firmware update can be recognized by the Controller status LEDs. Details of the update are entered in the logbook.

  • After successful checks and restoration, the data from the defective Controller, such as an executable boot project and visualization, is reused.

  • Remove the USB Stick if used, and store it securely, again.

  • When using the device key, the key stored on the USB flash drive or communication module is used to decrypt the encrypted data from the SD card. Since the new controller has its own device key, the data is immediately encrypted with the new device key and written to the SD card. Furthermore, the device key on the USB flash drive or communication module is replaced by the new one.

  • If the data on the SD Card cannot be decrypted and verified during boot, the Controller remains in the safe stopped state and activated the red status LED. Because communication with the Controller is not available at this stage, an SD-Card error file containing the corresponding error code is created on the SD Card. Switch off the Controller, remove the SD Card, and analyze the error code in this file. Depending on the reported error, provide the correct SD Card or the matching key storage medium, then repeat the restore procedure. The restore can continue only when the SD Card and the required key match.

Final activities

After the device replacement, the client must trust the new server certificates.

Trust new Server-Certificates after Device Replacement

Description of the situation before the device replacement:

  • The Controller has its own Certificate with a Private Key (confidential) and its own Certificate with a Public Key (2) (public).

  • The OPC UA Client has its own Certificate with a Private Key (confidential) and its own Certificate with a Public Key (1) (public).

  • When establishing a connection, the OPC UA Client transmits its Certificate with the Public Key (1) to the Controller. Through a manual trust setup on the Controller’s side, this Certificate is added to the Controller’s trust list.

  • When establishing a connection, the Controller transmits its public-key Certificate (2) to the OPC UA Client. Through a manual trust configuration on the OPC UA Client side, this Certificate is added to the OPC UA Client’s trust list.

  • With this mutual trust, the Secure Channel can be established.

  • Within this Secure Channel, a session can now be established in which a User transmits their Username and Password for authentication.

  • The Controller can now validate this user using the user management system.

Device replacement:

  • Replace the faulty Controller with a new one.

  • Transfer the SD Card from the faulty Controller to the new Controller; this transfers the encrypted Application Data and the Retain Data.

  • Optional: Transfer the USB flash drive or communication module from the defective Controller to a new Controller; this transfers the Device Key.

  • Boot the new Controller; during this process, the encrypted Application Data is decrypted and transferred. Once booting is complete, the new Controller is ready for use.

  • Conclusion: This process transfers user management and the trust list. What is not transferred is the device’s own Certificate with the Private Key. Since the Certificate with the private key and the Certificate with the public key belong together, both have changed as a result of the Device Replacement.

Description of the situation after the device replacement:

  • The Controller has its own Certificate with a Private Key (confidential) and its own Certificate with a Public Key (3) (public).

  • The OPC UA Client has its own Certificate with a Private Key (confidential) and its own Certificate with a Public Key (1) (public).

  • When establishing a connection, the OPC UA Client transmits its Certificate with the public key (1) to the Controller. Since the trust list was carried over during the device replacement, this Certificate is automatically used.

  • When establishing a connection, the Controller transmits its public-key Certificate (3) to the OPC UA Client. Since the OPC UA Client’s trust list contains the public-key Certificate (2) and not the public-key Certificate (3) from the new Controller, a manual trust configuration is required on the OPC UA Client side; this certificate is then added to the OPC UA Client’s trust list.

  • With this mutual trust, the Secure Channel can be established. If the OPC UA client has an autotrust mechanism, this step is not necessary because the certificate is automatically trusted. If the GDS mechanism is used on the controller, this step is also omitted, since signed certificates are stored that are automatically trusted by the OPC UA clients. For more details, see Chapter Controller.OPCUAServer.GDS or the OPC UA documentation.

  • Within this Secure Channel, a session can now be established in which a user transmits their username and password for authentication.

  • The Controller can now validate this user using the user management system.