CODESYS provides general and fieldbus-specific function blocks for performing diagnostics on connected devices.
Please see the following reference in our online help:
For device diagnosis, please refer to the use of our 'CAA Device Diagnosis' library and corresponding Example under: