forked from nanoframework/nanoFramework.IoT.Device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Consts.cs
69 lines (55 loc) · 1.93 KB
/
Consts.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Iot.Device.Modbus
{
/// <summary>
/// Contains protocol constant definitions.
/// </summary>
public static class Consts
{
#region Protocol limitations
/// <summary>
/// The lowest accepted device id on RTU protocol.
/// </summary>
public const byte MinDeviceId = 0x01;
/// <summary>
/// The highest accepted device id on RTU protocol.
/// </summary>
public const byte MaxDeviceId = 0xF7; // 247
/// <summary>
/// The lowest address.
/// </summary>
public const ushort MinAddress = 0x0000;
/// <summary>
/// The highest address.
/// </summary>
public const ushort MaxAddress = 0xFFFF; // 65535
/// <summary>
/// The lowest number of requested data sets.
/// </summary>
public const ushort MinCount = 0x01;
/// <summary>
/// The highest number of requested coils to read.
/// </summary>
public const ushort MaxCoilCountRead = 0x7D0; // 2000
/// <summary>
/// The highest number of requested coils to write.
/// </summary>
public const ushort MaxCoilCountWrite = 0x7B0; // 1968
/// <summary>
/// The highest number of requested registers to read.
/// </summary>
public const ushort MaxRegisterCountRead = 0x7D; // 125
/// <summary>
/// The highest number of requested registers to write.
/// </summary>
public const ushort MaxRegisterCountWrite = 0x7B; // 123
#endregion
#region Error/Exception
/// <summary>
/// The Bit-Mask to filter the error-state of a Modbus response.
/// </summary>
public const byte ErrorMask = 0x80;
#endregion
}
}