7 Commits

Author SHA1 Message Date
Peter Butzhammer
8836c14e2b Update nuget packages
Some checks failed
Release / build (push) Has been cancelled
2024-07-22 14:21:15 +02:00
Peter Butzhammer
e912d088eb Include xml doc in package 2024-07-22 14:20:32 +02:00
Peter Butzhammer
2655d1ec41 Remove duplicate build step 2024-07-22 14:18:21 +02:00
Peter Butzhammer
f90ad5f9be Improve error message 2024-07-22 14:18:03 +02:00
Peter Butzhammer
636c56d252 Use correct ArrayPool reference 2024-07-22 14:17:43 +02:00
Peter Butzhammer
f1734ebd73 Extend list of possible errors 2024-05-13 10:02:01 +02:00
Peter Butzhammer
0c1d5067c2 Remove unused enum 2024-05-13 10:01:44 +02:00
7 changed files with 13 additions and 23 deletions

View File

@@ -26,8 +26,6 @@ jobs:
run: nuget install NUnit.ConsoleRunner -Version 3.17.0 -DirectDownload -OutputDirectory .
- name: Install dependencies
run: dotnet restore
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore /p:version=${{ env.version }}
- name: Tests

View File

@@ -15,9 +15,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DeepEqual" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="DeepEqual" Version="5.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
</ItemGroup>

View File

@@ -1,9 +0,0 @@
namespace Sharp7.Rx.Enums;
internal enum CpuType
{
S7_300,
S7_400,
S7_1200,
S7_1500
}

View File

@@ -1,7 +1,5 @@
#nullable enable
using System.Diagnostics.CodeAnalysis;
namespace Sharp7.Rx;
public static class S7ErrorCodes
@@ -22,7 +20,7 @@ public static class S7ErrorCodes
{0x900000, "This happens when the DB is not long enough."},
{
0x40000, """
This error occurs when the DB is "optimized" or "PUT/GET communication" is not enabled.
This can happen when the cpu MPI address or rack is wrong, the DB is "optimized", or "PUT/GET communication" is not enabled.
See https://snap7.sourceforge.net/snap7_client.html#target_compatibility.
"""
}

View File

@@ -9,7 +9,9 @@
<AnalysisLevel>latest-Recommended</AnalysisLevel>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<Authors>evopro system engineering AG</Authors>
<Company>evopro system engineering AG</Company>
<Description>Reactive framework for Sharp7, the Ethernet S7 PLC communication suite. Handling RFC1006 connections to Siemens S7 300, 1200 and 1500.</Description>
@@ -23,16 +25,17 @@
CA1848: For improved performance, use the LoggerMessage delegates
CA2254: The logging message template should not vary between calls
CA1859: Change type of field 'xxx' from interface to type for performance reasons
CS1591: Missing XML comment for publicly visible type or member
-->
<NoWarn>$(NoWarn);CA1848;CA2254;CA1859</NoWarn>
<NoWarn>$(NoWarn);CA1848;CA2254;CA1859;CS1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Sharp7" Version="1.1.84" />
<PackageReference Include="System.Interactive" Version="6.0.1" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -192,7 +192,7 @@ public class Sharp7Plc : IPlc
}
finally
{
ArrayPool<byte>.Shared.Return(buffer);
arrayPool.Return(buffer);
}
}
}

View File

@@ -120,7 +120,7 @@ internal class VariableNameParser : IVariableNameParser
{
if (defaultValue.HasValue)
return defaultValue.Value;
throw new InvalidS7AddressException($"Variable of type {type} must have a length set \"{input}\"", input);
throw new InvalidS7AddressException($"Variable of type {type} must have a length set. Example \"db12.byte10.3\", found \"{input}\"", input);
}
if (!ushort.TryParse(match.Groups["bitOrLength"].Value, out var result))
@@ -132,7 +132,7 @@ internal class VariableNameParser : IVariableNameParser
byte GetBit()
{
if (!match.Groups["bitOrLength"].Success)
throw new InvalidS7AddressException($"Variable of type {type} must have a bit number set \"{input}\"", input);
throw new InvalidS7AddressException($"Variable of type {type} must have a bit number set. Example \"db12.bit10.3\", found \"{input}\"", input);
if (!byte.TryParse(match.Groups["bitOrLength"].Value, out var result))
throw new InvalidS7AddressException($"\"{match.Groups["bitOrLength"].Value}\" is an invalid bit number in \"{input}\"", input);