qin
2025-03-14 185565a8eb30c0546746aad52aac0926d395a76d
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IBox.WinFrmUI
{
    public class dModbus
    {
        public Dictionary<int, string> ModbusDataType()
        {
            var dic = new Dictionary<int, string>();
            dic.Add(1, "线圈");
            dic.Add(2, "离散");
            dic.Add(3, "short");
            dic.Add(4, "ushort");
            dic.Add(5, "int");
            dic.Add(6, "uint");
            dic.Add(7, "long");
            dic.Add(8, "ulong");
            dic.Add(9, "float");
            dic.Add(10, "double");
            return dic;
 
        }
 
        public Dictionary<string, string> ProtocolType()
        {
            var dic = new Dictionary<string, string>();
            dic.Add("ModbusRTU", "ModbusRTU");
            dic.Add("ModbusTcp", "ModbusTcp");
            dic.Add("ModbusAscii", "ModbusAscii");
            dic.Add("西门子S7-200", "S7200");
            dic.Add("西门子S7-200Smart", "S7200Smart");
            dic.Add("西门子S7-300", "S7300");
            dic.Add("西门子S7-400", "S7400");
            dic.Add("西门子S7-1200", "S71200");
            dic.Add("西门子S7-1500", "S71500");
            dic.Add("三菱MC Qna-3E", "MCQna3E");
            dic.Add("三菱MC A-1E", "MCA1E");
            dic.Add("欧姆龙Fins", "Fins");
            dic.Add("罗克韦尔CIP", "CIP");
 
            return dic;
        }
 
        public Dictionary<int, string> OperType()
        {
            var dic = new Dictionary<int, string>();
            dic.Add(0, "无");
            dic.Add(1, "+");
            dic.Add(2, "-");
            dic.Add(3, "*");
            dic.Add(4, "/");
            return dic;
        }
 
        public Dictionary<int, int> BaudRate()
        {
 
            var dic = new Dictionary<int, int>();
            dic.Add(1200, 1200);
            dic.Add(4800, 4800);
            dic.Add(9600, 9600);
            dic.Add(14400, 14400);
            dic.Add(19200, 19200);
            dic.Add(38400, 38400);
            dic.Add(57600, 57600);
            return dic;
        }
 
        public Dictionary<int, string> AdcType()
        {
            var dic = new Dictionary<int, string>();
            dic.Add(0, "无");
            dic.Add(1, "4-20mA");
            dic.Add(2, "0-5V");
            return dic;
        }
 
        public Dictionary<int, string> XMZDataType()
        {
            var dic = new Dictionary<int, string>();
            dic.Add(1, "bit");
            dic.Add(2, "byte");
            dic.Add(3, "short");
            dic.Add(4, "ushort");
            dic.Add(5, "int");
            dic.Add(6, "uint");
            dic.Add(7, "long");
            dic.Add(8, "ulong");
            dic.Add(9, "float");
            dic.Add(10, "double");
            return dic;
 
        }
 
        public Dictionary<int, string> SLANDCIPDataType()
        {
            var dic = new Dictionary<int, string>();
            dic.Add(1, "bit");
            dic.Add(2, "short");
            dic.Add(3, "ushort");
            dic.Add(4, "int");
            dic.Add(5, "uint");
            dic.Add(6, "long");
            dic.Add(7, "ulong");
            dic.Add(8, "float");
            dic.Add(9, "double");
            return dic;
 
        }
 
        public Dictionary<int, string> OMLDataType()
        {
            var dic = new Dictionary<int, string>();
            dic.Add(1, "bool");
            dic.Add(2, "short");
            dic.Add(3, "ushort");
            dic.Add(4, "int");
            dic.Add(5, "uint");
            dic.Add(6, "long");
            dic.Add(7, "ulong");
            dic.Add(8, "float");
            dic.Add(9, "double");
            return dic;
 
        }
    }
}