GetDiagnostics(UINT, => DiagnosticDetails) : GetDiagnosticsReturnCode - Manual - SIMATIC AX - SIMATIC AX hardware diagnostics. - Siemens.Simatic.S71500.Diagnostics.Hardware,library

Siemens.Simatic.S71500.Diagnostics.Hardware library

Portfolio
SIMATIC AX
Product
SIMATIC AX
Software version
6.0.1
Edition
11/2023
Language
English (original)
Package Name
@ax/simatic-1500-diagnostics-hardware

Retrieves the diagnostic information of a hardware component.

This function does not return the group state of the IO device; errors in the subordinate modules are only retrieved by GetDiagnostics(UINT, SubordinateDiagnosticDetails) : GetDiagnosticsReturnCode.

Parameters:

Name Type Section Description
hardwareID UINT Input Hardware identifier of the component.
diagnosticDetails DiagnosticDetails InOut Diagnostic information of the addressed hardware component.
GetDiagnosticsReturnCode Return Provides information about the execution of the instruction.

To determine the OperatingState of a SIMATIC PLC, use hardwareID value 52 for standard PLC, value 65147 and 65347 for redundant PLCs, and 34 to query a R/H system.

Example:

USING Siemens.Simatic.S71500.Diagnostics.Hardware;

PROGRAM DiagnosticsProgram
    VAR
        diagInfo : DiagnosticDetails;
        deviceAddress : UINT := UINT#269;
    END_VAR

    // Retrieve device information
    IF GetDiagnostics(deviceAddress, diagInfo) = GetDiagnosticsReturnCode#NoError THEN
        IF diagInfo.ComponentState <> ComponentState#Good THEN
            ;// The device with address '269' has a problem
        ELSE
            ;// The device with address '269' is working fine
        END_IF;
    END_IF;
END_PROGRAM