分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-07-19 7a4c218909936721fe281737491d10efc7378e09
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.FreeDB;
using WIDESEA_Entity.DomainModels;
 
namespace WIDESEA_WCS.JobsPart.Common
{
    public class Createplcinfodetail
    {
        FreeDB FreeDB = new FreeDB();
        public void PLCinfodetail()
        {
            try
            {
                //for (int i = 1; i <= 3; i++)
                //{
                int i = 7;
                string name = "3单元链条机";
                dt_plcinfodetail plcinfodetail = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 0.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "int16",
                    plcdetail_name = "R_oi_on",
                    plcdetail_number = name,
                    plcdetail_remark = "PLC->1, PMS->0 after setting i_ variables"
                };
                FreeDB.Add(plcinfodetail);
                dt_plcinfodetail plcinfodetail1 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 2.0 + (i - 1) * 330 + "",
                    plcdetail_len = 20,
                    plcdetail_valtype = "string",
                    plcdetail_name = "R_o_wp_id",
                    plcdetail_number = name,
                    plcdetail_remark = "车轮SN"
                };
                FreeDB.Add(plcinfodetail1);
                dt_plcinfodetail plcinfodetail2 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 22.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "datetime",
                    plcdetail_name = "R_o_mach_start_time",
                    plcdetail_number = name,
                    plcdetail_remark = "开始时间"
                };
                FreeDB.Add(plcinfodetail2);
                dt_plcinfodetail plcinfodetail3 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 38.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "datetime",
                    plcdetail_name = "R_o_mach_finish_time",
                    plcdetail_number = name,
                    plcdetail_remark = "完成时间"
                };
                FreeDB.Add(plcinfodetail3);
                dt_plcinfodetail plcinfodetail4 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 54.0 + (i - 1) * 330 + "",
                    plcdetail_len = 20,
                    plcdetail_valtype = "string",
                    plcdetail_name = "R_o_operator",
                    plcdetail_number = name,
                    plcdetail_remark = "操作人"
                };
                FreeDB.Add(plcinfodetail4);
                dt_plcinfodetail plcinfodetail5 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 74.0 + (i - 1) * 330 + "",
                    plcdetail_len = 20,
                    plcdetail_valtype = "string",
                    plcdetail_name = "R_o_shift",
                    plcdetail_number = name,
                    plcdetail_remark = "去向"
                };
                FreeDB.Add(plcinfodetail5);
                dt_plcinfodetail plcinfodetail6 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 94.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "int16",
                    plcdetail_name = "R_o_wp_status",
                    plcdetail_number = name,
                    plcdetail_remark = "质检状态 0:未定义,1:OK,2:NG"
                };
                FreeDB.Add(plcinfodetail6);
                dt_plcinfodetail plcinfodetail7 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 96.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "int16",
                    plcdetail_name = "R_o_result",
                    plcdetail_number = name,
                    plcdetail_remark = "结果"
                };
                FreeDB.Add(plcinfodetail7);
                dt_plcinfodetail plcinfodetail8 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 98.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "int16",
                    plcdetail_name = "R_o_error_code",
                    plcdetail_number = name,
                    plcdetail_remark = "错误代码"
                };
                FreeDB.Add(plcinfodetail8);
                dt_plcinfodetail plcinfodetail9 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 100.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "int16",
                    plcdetail_name = "R_o_substation",
                    plcdetail_number = name,
                    plcdetail_remark = " "
                };
                FreeDB.Add(plcinfodetail9);
                dt_plcinfodetail plcinfodetail10 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 102.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "string",
                    plcdetail_len = 55,
                    plcdetail_name = "R_o_value_result_real_1",
                    plcdetail_number = name,
                    plcdetail_remark = "结果1"
                };
                FreeDB.Add(plcinfodetail10);
                dt_plcinfodetail plcinfodetail11 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 157.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "string",
                    plcdetail_len = 55,
                    plcdetail_name = "R_o_value_result_real_2",
                    plcdetail_number = name,
                    plcdetail_remark = "结果2"
                };
                FreeDB.Add(plcinfodetail11);
                dt_plcinfodetail plcinfodetail12 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 212.0 + (i - 1) * 330 + "",
                    plcdetail_valtype = "string",
                    plcdetail_len = 55,
                    plcdetail_name = "R_o_value_result_real_3",
                    plcdetail_number = name,
                    plcdetail_remark = "结果3"
                };
                FreeDB.Add(plcinfodetail12);
                dt_plcinfodetail plcinfodetail13 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 267 + (i - 1) * 330 + "",
                    plcdetail_valtype = "string",
                    plcdetail_len = 55,
                    plcdetail_name = "R_o_value_result_real_4",
                    plcdetail_number = name,
                    plcdetail_remark = "结果4"
                };
                FreeDB.Add(plcinfodetail13);
                dt_plcinfodetail plcinfodetail14 = new dt_plcinfodetail()
                {
                    plcdetail_id = Guid.NewGuid(),
                    plcdetail_iotype = "Truss",
                    plcdetail_db = "DB611",
                    plcdetail_value = 322.1 + (i - 1) * 330 + "",
                    plcdetail_valtype = "boolean",
                    plcdetail_name = "R_o_value_result_bool",
                    plcdetail_number = name,
                    plcdetail_remark = " "
                };
                FreeDB.Add(plcinfodetail14);
                //dt_plcinfodetail plcinfodetail15 = new dt_plcinfodetail()
                //{
                //    plcdetail_id = Guid.NewGuid(),
                //    plcdetail_iotype = "Truss",
                //    plcdetail_db = "DB611",
                //    plcdetail_value = 4.0 + (i - 1) * 330 + "",
                //    plcdetail_valtype = "string",
                //    plcdetail_len = 18,
                //    plcdetail_name = "fault_channel",
                //    plcdetail_number = name,
                //    plcdetail_remark = "错误消息频道"
                //};
                //FreeDB.Add(plcinfodetail15);
                //dt_plcinfodetail plcinfodetail16 = new dt_plcinfodetail()
                //{
                //    plcdetail_id = Guid.NewGuid(),
                //    plcdetail_iotype = "Truss",
                //    plcdetail_db = "DB611",
                //    plcdetail_value = 22.0 + (i - 1) * 330 + "",
                //    plcdetail_valtype = "string",
                //    plcdetail_len = 14,
                //    plcdetail_name = "fault_axes_drives",
                //    plcdetail_number = name,
                //    plcdetail_remark = "错误消息axes(轴)驱动器"
                //};
                //FreeDB.Add(plcinfodetail16);
                //dt_plcinfodetail plcinfodetail17 = new dt_plcinfodetail()
                //{
                //    plcdetail_id = Guid.NewGuid(),
                //    plcdetail_iotype = "Truss",
                //    plcdetail_db = "DB611",
                //    plcdetail_value = 36.0 + (i - 1) * 330 + "",
                //    plcdetail_valtype = "string",
                //    plcdetail_len = 16,
                //    plcdetail_name = "fault_user_0_to1",
                //    plcdetail_number = name,
                //    plcdetail_remark = "错误消息用户区域0...1"
                //};
                //FreeDB.Add(plcinfodetail17);
                //}
            }
            catch (Exception ex)
            {
 
                throw;
            }
        }
    }
}