-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGXModbusProperty.cs
78 lines (74 loc) · 2.37 KB
/
GXModbusProperty.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
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Text;
using Gurux.Device;
using Gurux.Device.Editor;
using System.Runtime.Serialization;
using System.ComponentModel;
namespace Gurux.Modbus.AddIn
{
/// <summary>
/// Extends GXProperty class with the modbus specific properties.
/// </summary>
[GXReadMessage("ModbusRead", "ModbusReadReply")]
[GXWriteMessage("ModbusWrite", "ModbusWriteReply", Index=1)]
[GXWriteMessage("ModbusFailedWrite", "ModbusFailedWriteReply", Index=2)]
[DataContract(Namespace = "http://www.gurux.org")]
public class GXModbusProperty : GXProperty
{
/// <summary>
/// Constructor.
/// </summary>
public GXModbusProperty()
{
}
/// <summary>
/// Defines modbus function types.
/// </summary>
public enum GXFunctionType
{
/// <summary>
/// Discrete Output Coils. Read/write.
/// </summary>
CoilOutputs = 1,
/// <summary>
/// Discrete Input Contacts. Read.
/// </summary>
DigitalInputs = 2,
/// <summary>
/// Analog Input Registers. Read.
/// </summary>
AnalogueInputs = 4,
/// <summary>
/// Analog Output Holding Registers. Read/write.
/// </summary>
HoldingRegisters = 3,
/// <summary>
/// Extended registers
/// </summary>
ExtendedRegisters = 0x14
}
/// <summary>
/// Register type where read/writes are made.
/// </summary>
[System.ComponentModel.Category("Design"), System.ComponentModel.Description("Register type where read/writes are made.")]
[ValueAccess(ValueAccessType.Show, ValueAccessType.None)]
[ReadOnly(false), DataMember(IsRequired = true)]
public GXFunctionType Function
{
get;
set;
}
/// <summary>
/// Register address.
/// </summary>
[System.ComponentModel.Category("Design"), System.ComponentModel.Description("Register address.")]
[DataMember(IsRequired = true)]
[ReadOnly(false), ValueAccess(ValueAccessType.Show, ValueAccessType.None)]
public UInt16 Address
{
get;
set;
}
}
}