Robot_Config.cs
8.0 KB
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
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.LoadCSVLibrary
{
public class Robot_Config : DeviceConfig
{
public Robot_Config()
: base()
{
}
public Robot_Config(int id, string type, string filepath)
: base(id, LoadCSVLibrary.DeviceType.Line, filepath)
{
}
/// <summary>
/// 设备是否处于调试状态(1=调试,0=正常)
/// </summary>
[ConfigProAttribute("IsDebug",false)]
public int IsDebug { get; set; }
/// <summary>
/// 气压检测信号关闭需要持续的时间
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
/// <summary>
/// PRO,当多久没有出入库操作时,流水线进行休眠(休眠毫秒数),Sleep_MSeconds,120,,,,,
/// </summary>
[ConfigProAttribute("Sleep_MSeconds")]
public int Sleep_MSeconds { get; set; }
/// <summary>
/// PRO IO信号超时时间(秒) IOSingle_TimerOut 5000
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut",false)]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO IO模块对应的DI数量 IO_DILength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DILength")]
public string IO_DILength { get; set; }
/// <summary>
/// PRO 模块对应的DO数量 IO_DOLength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DOLength")]
public string IO_DOLength { get; set; }
/// <summary>
/// AXIS,,取料机构旋转轴_SVD01,Take_Middle_Axis,1,COM1,,,,250,80,80,80,60,50,10,1000,0,0
/// </summary>
[ConfigProAttribute("Take_Middle_Axis")]
public ConfigMoveAxis Take_Middle_Axis { get; set; }
/// <summary>
/// AXIS,,取料机构上下轴_SVD02,Take_UpDown_Axis,2,COM1,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Take_UpDown_Axis")]
public ConfigMoveAxis Take_UpDown_Axis { get; set; }
/// <summary>
/// AXIS,,取料机构进出轴_SVD03,Take_InOut_Axis,3,COM1,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Take_InOut_Axis")]
public ConfigMoveAxis Take_InOut_Axis { get; set; }
/// <summary>
/// AXIS,,左轨道提升轴_SVD04,Left_Batch_Axis,4,COM1,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Left_Batch_Axis")]
public ConfigMoveAxis Left_Batch_Axis { get; set; }
/// <summary>
/// AXIS,,右轨道提升轴_SVD05,Right_Batch_Axis,5,COM1,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Right_Batch_Axis")]
public ConfigMoveAxis Right_Batch_Axis { get; set; }
/// <summary>
/// AXIS,,取料移栽机构X轴_SVD06,Move_X_Axis,1,COM2,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Move_X_Axis")]
public ConfigMoveAxis Move_X_Axis { get; set; }
/// <summary>
/// AXIS,,取料移栽机构Z轴_SVD07,Move_Z_Axis,2,COM2,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Move_Z_Axis")]
public ConfigMoveAxis Move_Z_Axis { get; set; }
/// <summary>
/// AXIS,,贴标移栽机构X轴_SVD08,Label_X_Axis,3,COM2,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Label_X_Axis")]
public ConfigMoveAxis Label_X_Axis { get; set; }
/// <summary>
/// AXIS,,贴标移栽机构Y轴_SVD09,Label_Y_Axis,4,COM2,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Label_Y_Axis")]
public ConfigMoveAxis Label_Y_Axis { get; set; }
/// <summary>
/// AXIS,,贴标移栽机构Z轴_SVD10,Label_Z_Axis,5,COM2,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Label_Z_Axis")]
public ConfigMoveAxis Label_Z_Axis { get; set; }
/// <summary>
/// AXIS,,贴标移栽机构R轴_SVD11,Label_R_Axis,6,COM2,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Label_R_Axis")]
public ConfigMoveAxis Label_R_Axis { get; set; }
/// <summary>
/// AXIS,,出料工位提升轴_SVD12,Out_Batch_Axis,7,COM2,,,,100,300,200,20,50,200,10,1000,0,0
/// </summary>
[ConfigProAttribute("Out_Batch_Axis")]
public ConfigMoveAxis Out_Batch_Axis { get; set; }
public void SetAxisParam()
{
Left_Batch_Axis.ServerOnDO = IO_Type.LeftBatchAxis_ON;
Left_Batch_Axis.BreakOnDO = IO_Type.LeftBatchAxis_Break;
Right_Batch_Axis.ServerOnDO = IO_Type.RightBatchAxis_ON;
Right_Batch_Axis.BreakOnDO = IO_Type.RightBatchAxis_Break;
Out_Batch_Axis.ServerOnDO = IO_Type.OutBatchAxis_ON;
Out_Batch_Axis.BreakOnDO = IO_Type.OutBatchAxis_Break;
Take_Middle_Axis.ServerOnDO = IO_Type.TakeAxis_ON;
Take_InOut_Axis.ServerOnDO = IO_Type.TakeAxis_ON;
Take_UpDown_Axis.ServerOnDO = IO_Type.TakeAxis_ON;
Take_UpDown_Axis.BreakOnDO = IO_Type.Take_Axis_Break;
Move_X_Axis.ServerOnDO = IO_Type.MoveAxis_ON;
Move_Z_Axis.ServerOnDO = IO_Type.MoveAxis_ON;
Move_Z_Axis.BreakOnDO = IO_Type.MoveAxis_Break;
Label_R_Axis.ServerOnDO = IO_Type.LabelAxis_ON;
Label_X_Axis.ServerOnDO = IO_Type.LabelAxis_ON;
Label_Y_Axis.ServerOnDO = IO_Type.LabelAxis_ON;
Label_Z_Axis.ServerOnDO = IO_Type.LabelAxis_ON;
Label_Z_Axis.BreakOnDO = IO_Type.LabelAxis_Break;
}
private Dictionary<string, ushort> DILengthMap = null;
private Dictionary<string, ushort> DOLengthMap = null;
public ushort GetDILength(string ip)
{
try
{
if (DILengthMap == null)
{
DILengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DILength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DILengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DILengthMap.ContainsKey(ip))
{
return DILengthMap[ip];
}
return 16;
}
public ushort GetDOLength(string ip)
{
try
{
if (DOLengthMap == null)
{
DOLengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DOLength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DOLengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DOLengthMap.ContainsKey(ip))
{
return DOLengthMap[ip];
}
return 16;
}
}
}