Files
s7netplus/S7.Net.UnitTest/Helpers/TestStruct.cs
Serge Camille e8a9983367 Add LReal support, kill old "Double" sham.
- Adds true support for 64bit double / LReal datatype.
- Set old Types.Single and Types.Double to obselete. Both class names use .NET types instead of S7 type names, contrary to all other types.
- Remove already obsoleted conversion from DWord to Real. Why is this even necessary?
  For users caring about converting from DWord, they can still convert to single. But unless we get LWord support, there won't be a direct conversion to double/LReal.
- Adjust unit tests by removing rounding, testing directly double read/writes.

There is quite a bit of breaking changes at least in the automated Struct and object functions which automatically translate .NET types to appropriate S7 types.
My consideration was that if we ever want to support 64bit types, there is no way against breaking those existing incorrect conversions from 64bit .NET double to 32 bit S7 Real variables.
2020-09-04 20:46:16 +02:00

56 lines
1.3 KiB
C#

namespace S7.Net.UnitTest.Helpers
{
public struct TestStruct
{
/// <summary>
/// DB1.DBX0.0
/// </summary>
public bool BitVariable00;
public bool BitVariable01;
public bool BitVariable02;
public bool BitVariable03;
public bool BitVariable04;
public bool BitVariable05;
public bool BitVariable06;
public bool BitVariable07;
/// <summary>
/// DB1.DBX1.0
/// </summary>
public bool BitVariable10;
public bool BitVariable11;
public bool BitVariable12;
public bool BitVariable13;
public bool BitVariable14;
public bool BitVariable15;
public bool BitVariable16;
public bool BitVariable17;
/// <summary>
/// DB1.DBW2
/// </summary>
public short IntVariable;
/// <summary>
/// DB1.DBD4
/// </summary>
public double LRealVariable;
/// <summary>
/// DB1.DBD8
/// </summary>
public float RealVariable;
/// <summary>
/// DB1.DBD12
/// </summary>
public int DIntVariable;
/// <summary>
/// DB1.DBD16
/// </summary>
public ushort DWordVariable;
}
}