Retrieves the diagnostic information of a hardware component's subcomponents.
Parameters:
| Name | Type | Section | Description |
|---|---|---|---|
| hardwareID | UINT |
Input | Hardware identifier of the hardware component |
| subordinateDiagnosticDetails | SubordinateDiagnosticDetails |
InOut | Diagnostic information of the addressed hardware subcomponents. |
GetDiagnosticsReturnCode |
Return | Provides information about the execution of the instruction. |
Example:
USING Siemens.Simatic.S71500.Diagnostics.Hardware;
PROGRAM DiagnosticsProgram
VAR
diagInfo : SubordinateDiagnosticDetails;
deviceAddress : UINT := UINT#269;
END_VAR
// Retrieve device information
IF GetDiagnostics(deviceAddress, diagInfo) = GetDiagnosticsReturnCode#NoError THEN
IF diagInfo.SubordinateState <> ComponentState#Good THEN
;// A subcomponent of the device with address '269' has a problem
ELSE
;// All subcomponents of the device with address '269' are working fine
END_IF;
END_IF;
END_PROGRAM