11
啊鑫
2025-08-01 4df72b089c81867796f33cf64834725070810aa5
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
{
  "ConfigVersion": "1.0",
  "ProjectName": "润达项目",
  "Description": "润达项目TCP通信配置文件",
 
  "Connection": {
    "IpAddress": "192.168.1.231",
    "Port": 502,
    "ConnectionTimeoutMs": 5000,
    "OperationTimeoutMs": 3000
  },
  "Communication": {
    "HeartbeatIntervalMs": 1000,
    "DataPollingIntervalMs": 500,
    "EnableAutoReconnect": true,
    "ReconnectDelayMs": 3000,
    "MaxRetryCount": 3
  },
  "OutputAddresses": {
    "Description": "MES发送给PLC的地址配置",
    "HeartbeatAddress": {
      "Address": 6000,
      "DataType": "Byte",
      "Description": "MES心跳包地址,一秒交替发0/1"
    },
    "DataConfirmationAddress": {
      "Address": 6001,
      "DataType": "Byte",
      "Description": "MES数据读取确认地址,数据读取OK置1"
    }
  },
  "InputAddresses": {
    "Description": "从PLC读取的地址配置",
    "ControlSignals": {
      "PlcHeartbeat": {
        "Address": 6002,
        "DataType": "Byte",
        "Length": 1,
        "DisplayName": "PLC心跳",
        "Description": "PLC发送的心跳信号,一秒交替发0/1"
      },
      "DataReady": {
        "Address": 6003,
        "DataType": "Byte",
        "Length": 1,
        "DisplayName": "数据就绪",
        "Description": "PLC数据准备就绪信号,数据OK置1",
        "ValueMap": {
          "0": "数据未就绪",
          "1": "数据就绪"
        }
      }
    },
    "ProductData": {
      "ProductModel": {
        "Address": 6004,
        "DataType": "String",
        "Length": 10,
        "Encoding": "BigEndian",
        "DisplayName": "产品型号",
        "Description": "产品型号字符串,大端模式存储,一个字节两个字符"
      },
      "TestStation": {
        "Address": 6014,
        "DataType": "Byte",
        "Length": 1,
        "DisplayName": "测试工位",
        "Description": "当前测试工位编号"
      },
      "ProductCode": {
        "Address": 6015,
        "DataType": "String",
        "Length": 10,
        "Encoding": "BigEndian",
        "DisplayName": "产品码",
        "Description": "产品唯一标识码,大端模式存储,一个字节两个字符"
      },
      "TestResult": {
        "Address": 6025,
        "DataType": "Byte",
        "Length": 1,
        "DisplayName": "测试结果",
        "Description": "测试结果状态",
        "ValueMap": {
          "0": "不合格",
          "1": "合格"
        }
      },
      "RecordTime": {
        "Address": 6026,
        "DataType": "Timestamp",
        "Length": 7,
        "Format": "YYYYMMDDHHMMSS",
        "Encoding": "BigEndian",
        "DisplayName": "记录时间",
        "Description": "数据记录时间戳,大端模式存储,一个字节两个字符,格式:年月日时分秒(14位)"
      }
    },
    "MeasurementData": {
      "MinInstallSize": {
        "Address": 6033,
        "DataType": "Integer",
        "Length": 2,
        "Scale": 0.01,
        "Unit": "mm",
        "DecimalPlaces": 2,
        "DisplayName": "最小安装尺寸",
        "Description": "最小安装尺寸测量值,默认两个小数点,例:收到12345应为123.45"
      },
      "MaxInstallSize": {
        "Address": 6035,
        "DataType": "Integer",
        "Length": 2,
        "Scale": 0.01,
        "Unit": "mm",
        "DecimalPlaces": 2,
        "DisplayName": "最大安装尺寸",
        "Description": "最大安装尺寸测量值,默认两个小数点"
      },
      "Stroke": {
        "Address": 6037,
        "DataType": "Integer",
        "Length": 2,
        "Scale": 0.01,
        "Unit": "mm",
        "DecimalPlaces": 2,
        "DisplayName": "行程",
        "Description": "执行器行程测量值,默认两个小数点"
      },
      "Speed": {
        "Address": 6039,
        "DataType": "Integer",
        "Length": 2,
        "Scale": 0.01,
        "Unit": "mm/s",
        "DecimalPlaces": 2,
        "DisplayName": "速度",
        "Description": "执行器运行速度,默认两个小数点"
      },
      "WorkingVoltage": {
        "Address": 6041,
        "DataType": "Integer",
        "Length": 2,
        "Scale": 0.01,
        "Unit": "V",
        "DecimalPlaces": 2,
        "DisplayName": "工作电压",
        "Description": "系统工作电压,默认两个小数点"
      },
      "WorkingCurrent": {
        "Address": 6043,
        "DataType": "Integer",
        "Length": 2,
        "Scale": 0.01,
        "Unit": "A",
        "DecimalPlaces": 2,
        "DisplayName": "工作电流",
        "Description": "系统工作电流,默认两个小数点"
      },
      "WorkingPressure": {
        "Address": 6045,
        "DataType": "Integer",
        "Length": 2,
        "Scale": 0.01,
        "Unit": "N",
        "DecimalPlaces": 2,
        "DisplayName": "工作压力",
        "Description": "系统工作压力,默认两个小数点,单位:牛顿"
      },
      "UpHallSensor": {
        "Address": 6047,
        "DataType": "Integer",
        "Length": 2,
        "Scale": 0.01,
        "Unit": "",
        "DecimalPlaces": 2,
        "DisplayName": "上升霍尔传感器",
        "Description": "上升霍尔传感器读数,默认两个小数点"
      }
    }
  },
  "DataTypes": {
    "Description": "支持的数据类型定义",
    "Byte": "单字节数值 (0-255),用于心跳包、信号状态等",
    "Integer": "多字节整数,支持缩放,用于测量数据",
    "String": "字符串,支持大端/小端编码,用于产品型号、产品码",
    "Timestamp": "时间戳,支持自定义格式,用于记录时间",
    "Float": "浮点数",
    "Boolean": "布尔值"
  },
  "UI": {
    "WindowTitle": "生产线MES与PLC通信系统",
    "AutoStartPolling": false,
    "LogLevel": "Info",
    "MaxLogLines": 1000
  },
  "Database": {
    "Enabled": true,
    "Type": "Oracle",
    "ConnectionString": "Data Source = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.223)(PORT = 1521))(CONNECT_DATA = (SERVICE_NAME = ORCL))); Persist Security Info=True;User ID = rdmes_dev; Password=rdmesdev",
    "AutoCreateTables": true,
    "DataRetentionDays": 90,
    "Tables": {
      "ModbusDataTable": "PRODUCTION_DATA",
      "CommunicationLogTable": "COMMUNICATION_LOG",
      "ErrorLogTable": "ERROR_LOG",
      "StatisticsTable": "STATISTICS"
    }
  }
}