mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 14:28:25 +08:00
- 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.
202 lines
4.1 KiB
C#
202 lines
4.1 KiB
C#
namespace S7.Net
|
|
{
|
|
/// <summary>
|
|
/// Types of S7 cpu supported by the library
|
|
/// </summary>
|
|
public enum CpuType
|
|
{
|
|
/// <summary>
|
|
/// S7 200 cpu type
|
|
/// </summary>
|
|
S7200 = 0,
|
|
|
|
/// <summary>
|
|
/// Siemens Logo 0BA8
|
|
/// </summary>
|
|
Logo0BA8 = 1,
|
|
|
|
/// <summary>
|
|
/// S7 300 cpu type
|
|
/// </summary>
|
|
S7300 = 10,
|
|
|
|
/// <summary>
|
|
/// S7 400 cpu type
|
|
/// </summary>
|
|
S7400 = 20,
|
|
|
|
/// <summary>
|
|
/// S7 1200 cpu type
|
|
/// </summary>
|
|
S71200 = 30,
|
|
|
|
/// <summary>
|
|
/// S7 1500 cpu type
|
|
/// </summary>
|
|
S71500 = 40,
|
|
}
|
|
|
|
/// <summary>
|
|
/// Types of error code that can be set after a function is called
|
|
/// </summary>
|
|
public enum ErrorCode
|
|
{
|
|
/// <summary>
|
|
/// The function has been executed correctly
|
|
/// </summary>
|
|
NoError = 0,
|
|
|
|
/// <summary>
|
|
/// Wrong type of CPU error
|
|
/// </summary>
|
|
WrongCPU_Type = 1,
|
|
|
|
/// <summary>
|
|
/// Connection error
|
|
/// </summary>
|
|
ConnectionError = 2,
|
|
|
|
/// <summary>
|
|
/// Ip address not available
|
|
/// </summary>
|
|
IPAddressNotAvailable,
|
|
|
|
/// <summary>
|
|
/// Wrong format of the variable
|
|
/// </summary>
|
|
WrongVarFormat = 10,
|
|
|
|
/// <summary>
|
|
/// Wrong number of received bytes
|
|
/// </summary>
|
|
WrongNumberReceivedBytes = 11,
|
|
|
|
/// <summary>
|
|
/// Error on send data
|
|
/// </summary>
|
|
SendData = 20,
|
|
|
|
/// <summary>
|
|
/// Error on read data
|
|
/// </summary>
|
|
ReadData = 30,
|
|
|
|
/// <summary>
|
|
/// Error on write data
|
|
/// </summary>
|
|
WriteData = 50
|
|
}
|
|
|
|
/// <summary>
|
|
/// Types of memory area that can be read
|
|
/// </summary>
|
|
public enum DataType
|
|
{
|
|
/// <summary>
|
|
/// Input area memory
|
|
/// </summary>
|
|
Input = 129,
|
|
|
|
/// <summary>
|
|
/// Output area memory
|
|
/// </summary>
|
|
Output = 130,
|
|
|
|
/// <summary>
|
|
/// Merkers area memory (M0, M0.0, ...)
|
|
/// </summary>
|
|
Memory = 131,
|
|
|
|
/// <summary>
|
|
/// DB area memory (DB1, DB2, ...)
|
|
/// </summary>
|
|
DataBlock = 132,
|
|
|
|
/// <summary>
|
|
/// Timer area memory(T1, T2, ...)
|
|
/// </summary>
|
|
Timer = 29,
|
|
|
|
/// <summary>
|
|
/// Counter area memory (C1, C2, ...)
|
|
/// </summary>
|
|
Counter = 28
|
|
}
|
|
|
|
/// <summary>
|
|
/// Types
|
|
/// </summary>
|
|
public enum VarType
|
|
{
|
|
/// <summary>
|
|
/// S7 Bit variable type (bool)
|
|
/// </summary>
|
|
Bit,
|
|
|
|
/// <summary>
|
|
/// S7 Byte variable type (8 bits)
|
|
/// </summary>
|
|
Byte,
|
|
|
|
/// <summary>
|
|
/// S7 Word variable type (16 bits, 2 bytes)
|
|
/// </summary>
|
|
Word,
|
|
|
|
/// <summary>
|
|
/// S7 DWord variable type (32 bits, 4 bytes)
|
|
/// </summary>
|
|
DWord,
|
|
|
|
/// <summary>
|
|
/// S7 Int variable type (16 bits, 2 bytes)
|
|
/// </summary>
|
|
Int,
|
|
|
|
/// <summary>
|
|
/// DInt variable type (32 bits, 4 bytes)
|
|
/// </summary>
|
|
DInt,
|
|
|
|
/// <summary>
|
|
/// Real variable type (32 bits, 4 bytes)
|
|
/// </summary>
|
|
Real,
|
|
|
|
/// <summary>
|
|
/// LReal variable type (64 bits, 8 bytes)
|
|
/// </summary>
|
|
LReal,
|
|
|
|
/// <summary>
|
|
/// String variable type (variable)
|
|
/// </summary>
|
|
String,
|
|
|
|
/// <summary>
|
|
/// String variable type (variable)
|
|
/// </summary>
|
|
StringEx,
|
|
|
|
/// <summary>
|
|
/// Timer variable type
|
|
/// </summary>
|
|
Timer,
|
|
|
|
/// <summary>
|
|
/// Counter variable type
|
|
/// </summary>
|
|
Counter,
|
|
|
|
/// <summary>
|
|
/// DateTIme variable type
|
|
/// </summary>
|
|
DateTime,
|
|
|
|
/// <summary>
|
|
/// DateTimeLong variable type
|
|
/// </summary>
|
|
DateTimeLong
|
|
}
|
|
}
|