Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Firmware Version V4.0 #88

Merged
merged 8 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ Plc Version | Client Library Version
2.9.x | 2.0.x
3.0.x | 2.1.x
3.1.x | 2.2.x
4.0.x | 3.0.x

## SIMATIC S7-1200:
Plc Version | Client Library Version
Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiAlarmAcknowledgementState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiAlarmsBrowseFilterAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
Expand Down
13 changes: 8 additions & 5 deletions src/Webserver.API/Enums/ApiAuthenticationMode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
Expand All @@ -9,12 +9,15 @@ namespace Siemens.Simatic.S7.Webserver.API.Enums
{
/// <summary>
/// User Authentication modes of the PLC.<br/>
/// Depends on the configured user management which authentication modes will be supported by the PLC<br/>
/// based on the authentication mode.
/// Depends on the configured user management which authentication modes will be supported by the PLC based on the authentication mode.
/// </summary>
[JsonConverter(typeof(StringEnumConverter), converterParameters: typeof(SnakeCaseNamingStrategy))]
public enum ApiAuthenticationMode
{
/// <summary>
/// The users are stored on the PLC
/// </summary>
Local,
/// <summary>
/// Legacy User Management
/// </summary>
Expand All @@ -24,8 +27,8 @@ public enum ApiAuthenticationMode
/// </summary>
Disabled,
/// <summary>
/// The users are stored on the PLC
/// Central User Management (via remote authentication with Username and Password)
/// </summary>
Local
Umc,
}
}
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiBrowseFilterMode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiDayOfWeek.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
Expand Down
42 changes: 39 additions & 3 deletions src/Webserver.API/Enums/ApiErrorCode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -53,9 +53,11 @@ public enum ApiErrorCode
/// </summary>
SystemIsReadOnly = 5,
/// <summary>
/// The password change cannot be performed. This is caused for example if an older PLC project is present where password changes are not supported.
/// Not accepted in login: The authentication cannot be performed. This may happen because the requested mode is not supported by the PLC. <br/>
/// Not accepted in password change: The password change cannot be performed. This is caused for example if an older PLC project is present where password changes are not supported.
/// The execution of the requested method has not been accepted due to a method-specific restriction.
/// </summary>
PasswordChangeNotAccepted = 6,
NotAccepted = 6,
/// <summary>
/// The data of a PLC of an R/H system is not accessible.
/// This may happen if the system is in state Syncup or RUN-redundant or if the service data of the partner PLC has been requested.
Expand Down Expand Up @@ -83,6 +85,10 @@ public enum ApiErrorCode
/// </summary>
NewPasswordMatchesOldPassword = 104,
/// <summary>
/// Authentication on the UMC server was not successful. This may happen due to various reasons, e.g. the UMC server could not be reached by the PLC.
/// </summary>
InfrastructureError = 105,
/// <summary>
/// The requested address does not exist or the webserver cannot access the requested address.
/// Die angeforderte Adresse existiert nicht oder der Webserver kann nicht auf die angeforderte Adresse zugreifen.
/// </summary>
Expand Down Expand Up @@ -173,6 +179,10 @@ public enum ApiErrorCode
/// </summary>
ResourceLimitReached = 509,
/// <summary>
/// The version string provided does not meet the criteria of a valid version string.
/// </summary>
InvalidVersionString = 510,
/// <summary>
/// The proposed modification time is inalid. Adjust the proposed modification before calling this method again.
/// Die vorgesehene Änderungszeit liegt außerhalb des zulässigen Zeitfensters für die Änderungszeit. Verringern Sie die Änderungszeit entsprechend, bevor Sie diese Methode aufrufen.
/// </summary>
Expand Down Expand Up @@ -228,6 +238,32 @@ public enum ApiErrorCode
/// </summary>
InvalidHwId = 1100,
/// <summary>
/// The provided pattern is not in the allowed list. Choose a pattern that is allowed to be configured.
/// </summary>
InvalidPattern = 1301,
/// <summary>
/// At least one of the provided HTTP headers is not part in the allowed list. Choose a HTTP header that is allowed to be set.
/// </summary>
HTTPHeaderNotAllowed = 1302,
/// <summary>
/// At least one of the provided HTTP headers represents an invalid HTTP header. Verify the provided HTTP header string and correct it as required.
/// </summary>
HTTPHeaderInvalid = 1303,
/// <summary>
/// Too many HTTP response headers are configured. <br/>
/// Reduce the number to a supported number of headers. The number is currently capped at 1.
/// </summary>
TooManyHTTPHeaders = 1304,
/// <summary>
/// The overall size of all HTTP headers requested to be configured is too large. <br/>
/// The user shall either reduce the number of headers or the length of an individual HTTP header.
/// </summary>
RequestTooLarge = 1305,
/// <summary>
/// The accessed variable is not a variable of a technology object and cannot be read.
/// </summary>
NotATechnologyObject = 1400,
/// <summary>
/// The method has not been found by the plc - check the spelling and fw-version (and according methods) of plc
/// </summary>
MethodNotFound = -32601,
Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiFailsafeHardwareType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiFileResourceState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiFileResourceType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiObjectDirectoryStatus.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down
25 changes: 25 additions & 0 deletions src/Webserver.API/Enums/ApiPlcDataRepresentation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

namespace Siemens.Simatic.S7.Webserver.API.Enums
{
/// <summary>
/// Determines the response format for various methods that return data from the PLC.
/// </summary>
public enum ApiPlcDataRepresentation
{
/// <summary>
/// Should never be the case
/// </summary>
None = 0,
/// <summary>
/// "Simple", comfortable format -- represented in a semi-human-readable format.
/// </summary>
Simple = 1,
/// <summary>
/// The data is represented in big endian format, formatted as a JSON byte array.
/// </summary>
Raw = 2
}
}
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiPlcHwId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiPlcModeSelectorState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
Expand Down
20 changes: 18 additions & 2 deletions src/Webserver.API/Enums/ApiPlcOperatingMode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -36,6 +36,22 @@ public enum ApiPlcOperatingMode
/// <summary>
/// STOP Firmware-Update
/// </summary>
Stop_fwupdate = 6
Stop_fwupdate = 6,
/// <summary>
/// RH PLCs are in Run-Redundant mode.
/// </summary>
Run_redundant = 7,
/// <summary>
/// RH PLCs are in syncup state.
/// </summary>
Syncup = 8,
/// <summary>
/// RH PLCs are synchronizing.
/// </summary>
Run_syncup = 9,
/// <summary>
///
/// </summary>
Remote_unknown = 10,
}
}
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiPlcProgramBlockType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiPlcProgramBrowseMode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiPlcProgramDataType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Siemens.Simatic.S7.Webserver.API.Models.ApiPlcProgramDataTypes;
Expand Down
2 changes: 1 addition & 1 deletion src/Webserver.API/Enums/ApiPlcRedundancyId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023, Siemens AG
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT

Expand Down
53 changes: 53 additions & 0 deletions src/Webserver.API/Enums/ApiPlcRedundancyPairingState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;

namespace Siemens.Simatic.S7.Webserver.API.Enums
{
/// <summary>
/// The pairing status of the R/H system.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ApiPlcRedundancyPairingState
{
/// <summary>
/// Default value if the pairing status could not be retrieved or was 0.
/// </summary>
[EnumMember(Value = "unknown")]
Unknown = 0,
/// <summary>
/// Redundant connection between both PLCs.
/// </summary>
[EnumMember(Value = "paired")]
Paired = 1,
/// <summary>
/// Only single pairing via port 1 (or 2) is available.
/// </summary>
[EnumMember(Value = "paired_single")]
Paired_single = 2,
/// <summary>
/// There are more than 2 R/H PLCs in the network. Cannot determine partner PLC.
/// </summary>
[EnumMember(Value = "not_paired_too_many_partners")]
Not_paired_too_many_partners = 3,
/// <summary>
/// The partner PLC is not reachable or internal error, represented as unspecified error to the user.
/// </summary>
[EnumMember(Value = "not_paired")]
Not_paired = 4,
/// <summary>
/// The order IDs of both PLCs of the R/H system do not match.
/// </summary>
[EnumMember(Value = "not_paired_order_id_mismatch")]
Not_paired_order_id_mismatch = 5,
/// <summary>
/// The firmware versions of both PLCs of the R/H system do not match.
/// </summary>
[EnumMember(Value = "not_paired_firmware_mismatch")]
Not_paired_firmware_mismatch = 6,

}
}
32 changes: 32 additions & 0 deletions src/Webserver.API/Enums/ApiPlcRedundancyRole.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) 2024, Siemens AG
//
// SPDX-License-Identifier: MIT
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;

namespace Siemens.Simatic.S7.Webserver.API.Enums
{
/// <summary>
/// The role of the represented PLC in the redundant system.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ApiPlcRedundancyRole
{
/// <summary>
/// For the tree of the partner PLC, the role may be unknown in case that the partner PLC is not properly paired.
/// </summary>
[EnumMember(Value = "unknown")]
Unknown = 0,
/// <summary>
/// Primary PLC
/// </summary>
[EnumMember(Value = "primary")]
Primary = 1,
/// <summary>
/// Backup PLC
/// </summary>
[EnumMember(Value = "backup")]
Backup = 2
}
}
Loading
Loading