mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-24 15:38:25 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea84cd414f | ||
|
|
ad98783888 | ||
|
|
cddb826053 |
21
S7.Net.Core/S7.Net.Core.nuget.props
Normal file
21
S7.Net.Core/S7.Net.Core.nuget.props
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">C:\Users\shade\Documents\GitHub\s7netplus\S7.Net.Core\project.lock.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\shade\.nuget\packages\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">ProjectJson</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.3.1</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.0\build\Microsoft.Net.Native.Compiler.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.0\build\Microsoft.Net.Native.Compiler.props')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
12
S7.Net.Core/S7.Net.Core.nuget.targets
Normal file
12
S7.Net.Core/S7.Net.Core.nuget.targets
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.0\build\Microsoft.Net.Native.Compiler.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.0\build\Microsoft.Net.Native.Compiler.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
|
||||
"Microsoft.NETCore.UniversalWindowsPlatform": "5.4.0"
|
||||
},
|
||||
"frameworks": {
|
||||
"uap10.0": {}
|
||||
"uap10.0.10240": {}
|
||||
},
|
||||
"runtimes": {
|
||||
"win10-arm": {},
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace S7.Net.UnitTest.Helpers
|
||||
class S7TestServer
|
||||
{
|
||||
static S7Server Server;
|
||||
static private byte[] DB1 = new byte[512]; // Our DB1
|
||||
static private byte[] DB1 = new byte[1024]; // Our DB1
|
||||
static private byte[] DB2 = new byte[64000]; // Our DB2
|
||||
static private byte[] DB3 = new byte[1024]; // Our DB3
|
||||
|
||||
|
||||
@@ -455,6 +455,18 @@ namespace S7.Net.UnitTest
|
||||
plc.Write("DB1.DBX0.7", 0);
|
||||
boolVariable = (bool)plc.Read("DB1.DBX0.7");
|
||||
Assert.IsFalse(boolVariable);
|
||||
|
||||
plc.Write("DB1.DBX658.0", 1);
|
||||
boolVariable = (bool)plc.Read("DB1.DBX658.0");
|
||||
Assert.IsTrue(boolVariable);
|
||||
|
||||
plc.Write("DB1.DBX658.7", 1);
|
||||
boolVariable = (bool)plc.Read("DB1.DBX658.7");
|
||||
Assert.IsTrue(boolVariable);
|
||||
|
||||
plc.Write("DB2.DBX9658.0", 1);
|
||||
boolVariable = (bool)plc.Read("DB2.DBX9658.0");
|
||||
Assert.IsTrue(boolVariable);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -664,8 +676,8 @@ namespace S7.Net.UnitTest
|
||||
|
||||
Assert.AreEqual(expectedReadBytes, actualReadBytes);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
[TestMethod]
|
||||
public void T22_ReadClassWithArray()
|
||||
{
|
||||
Assert.IsTrue(plc.IsConnected, "Before executing this test, the plc must be connected. Check constructor.");
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace S7.Net
|
||||
catch (SocketException sex)
|
||||
{
|
||||
// see https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx
|
||||
if (sex.ErrorCode == CONNECTION_TIMED_OUT_ERROR_CODE)
|
||||
if (sex.SocketErrorCode == SocketError.TimedOut)
|
||||
{
|
||||
LastErrorCode = ErrorCode.IPAddressNotAvailable;
|
||||
}
|
||||
@@ -1136,7 +1136,7 @@ namespace S7.Net
|
||||
package.Add(Types.Word.ToByteArray((ushort)varCount));
|
||||
package.Add(Types.Word.ToByteArray((ushort)(db)));
|
||||
package.Add((byte)dataType);
|
||||
var overflow = (int)(startByteAdr * 8 + bitAdr / 0xffffU); // handles words with address bigger than 8191
|
||||
var overflow = (int)(startByteAdr * 8 / 0xffffU); // handles words with address bigger than 8191
|
||||
package.Add((byte)overflow);
|
||||
package.Add(Types.Word.ToByteArray((ushort)(startByteAdr * 8 + bitAdr)));
|
||||
package.Add(new byte[] { 0, 0x03 }); //ending 0x03 is used for writing a sinlge bit
|
||||
|
||||
Reference in New Issue
Block a user