mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 14:28:25 +08:00
Minor changes
This commit is contained in:
@@ -58,7 +58,8 @@ namespace S7.Net.UnitTest.Helpers
|
||||
/// <summary>
|
||||
/// DB1.DBX20.0
|
||||
/// </summary>
|
||||
[S7String(S7StringType.S7WString, 10)] public string WStringVariable;
|
||||
[S7String(S7StringType.S7WString, 10)]
|
||||
public string WStringVariable;
|
||||
|
||||
/// <summary>
|
||||
/// DB1.DBX44.0
|
||||
|
||||
@@ -57,11 +57,11 @@ namespace S7.Net.Types
|
||||
/// <summary>
|
||||
/// ASCII string.
|
||||
/// </summary>
|
||||
S7String,
|
||||
S7String = VarType.S7String,
|
||||
|
||||
/// <summary>
|
||||
/// Unicode string.
|
||||
/// </summary>
|
||||
S7WString
|
||||
S7WString = VarType.S7WString
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace S7.Net.Types
|
||||
case "String":
|
||||
S7StringAttribute? attribute = info.GetCustomAttributes<S7StringAttribute>().SingleOrDefault();
|
||||
if (attribute == default(S7StringAttribute))
|
||||
throw new ArgumentException("Please add S7StringAttribute to the field you are trying to read or write");
|
||||
throw new ArgumentException("Please add S7StringAttribute to the string field");
|
||||
|
||||
numBytes = Math.Ceiling(numBytes);
|
||||
if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0)
|
||||
@@ -192,7 +192,7 @@ namespace S7.Net.Types
|
||||
case "String":
|
||||
S7StringAttribute? attribute = info.GetCustomAttributes<S7StringAttribute>().SingleOrDefault();
|
||||
if (attribute == default(S7StringAttribute))
|
||||
throw new ArgumentException("Please add S7StringAttribute to the field you are trying to read or write");
|
||||
throw new ArgumentException("Please add S7StringAttribute to the string field");
|
||||
|
||||
numBytes = Math.Ceiling(numBytes);
|
||||
if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0)
|
||||
@@ -294,7 +294,7 @@ namespace S7.Net.Types
|
||||
case "String":
|
||||
S7StringAttribute? attribute = info.GetCustomAttributes<S7StringAttribute>().SingleOrDefault();
|
||||
if (attribute == default(S7StringAttribute))
|
||||
throw new ArgumentException("Please add S7StringAttribute to the field you are trying to read or write");
|
||||
throw new ArgumentException("Please add S7StringAttribute to the string field");
|
||||
|
||||
bytes2 = attribute.Type switch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user