ke_junjie
2025-06-04 101c57ec4c28bc3c36e49c50a926e9e7c0dd0247
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace iWareSda_QQJF.SRM.SrmModel
{
    //通过构造函数参数来区分不同设备
   public class SrmDBli
    {
        //WCS-Wirte-SRM 
        /// <summary>WCS心跳1-10000
        /// 
        /// </summary>
        public string handShakeW { get; set; }
        /// <summary>堆垛机号
        /// 
        /// </summary>
        public string srmNOW { get; set; }
        /// <summary>托盘类型
        /// 
        /// </summary>
        public string palletTypeW { get; set; }
        /// <summary>堆垛机写入起始列
        /// (人站控制柜,前面号大后面小)
        /// </summary>
        public string sourcePosXW { get; set; }
        /// <summary>堆垛机写入起始层
        /// 
        /// </summary>
        public string sourcePosYW { get; set; }
        /// <summary>堆垛机写入起始排1.4远2.3近 
        /// (人站控制柜左1.2右3.4)
        /// </summary>
        public string sourcePosZW { get; set; }
        /// <summary>堆垛机目标列
        /// 
        /// </summary>
        public string destinationPosXW { get; set; }
        /// <summary>堆垛机目标层
        /// 
        /// </summary>
        public string destinationPosYW { get; set; }
        /// <summary>堆垛机目标排
        /// 
        /// </summary>
        public string destinationPosZW { get; set; }
        /// <summary>堆垛机执行功能
        /// 0= 无
        ///1= 搬运
        ///2= 单放
        ///3= 移动
        ///4= 取消任务 
        /// </summary>
        public string commandW { get; set; }
        /// <summary>紧急停止(SRM=1)
        /// 
        /// </summary>
        public string emergencyStopW { get; set; }
        /// <summary>报警解除(SRM=1)
        /// 
        /// </summary>
        public string alarmAckW { get; set; }
        /// <summary>赋值为1执行任务完毕确认任务完成
        /// 
        /// </summary>
        public string taskFinishW { get; set; }
        /// <summary>备用2
        /// 
        /// </summary>
        public string Reserve2W { get; set; }
        /// <summary>备用3
        /// 
        /// </summary>
        public string Reserve3W { get; set; }
        /// <summary>WCS通信位
        /// 执行任务其他值填写完毕把该值STB置为1
        /// plc收到此值把ACK置为1
        /// ACK为1时WCS再把stb置为0
        /// stb为0时plc把ack置为0同时执行任务
        /// 以上为通信一个循环
        /// </summary>
        public string stbW { get; set; }
        /// <summary>SRM应答位(WCS只读)
        /// 
        /// </summary>
        public string ackW { get; set; }
        /// <summary>任务号
        /// 
        /// </summary>
        public string taskNOW { get; set; }
 
       /// <summary>
       /// 主任务号
       /// </summary>
        public string taskFather { get; set; }
        //--------------------------------------------------------------------------------------------  
        //WCS-read-SRM
        /// <summary>堆垛机心跳
        /// 
        /// </summary>
        public string handShakeR { get; set; }
        /// <summary>堆垛机编号
        /// =1 自动模式
        ///=2 手动模式
        ///=3 半自动模式
        ///=4 维修模式
        ///=0 关机模式
        /// </summary>
        public string srmNOR { get; set; }
        /// <summary>堆垛机当前模式 
        /// 
        /// </summary>
        public string modeR { get; set; }
        /// <summary>值为1堆垛机就是报警状态
        /// 
        /// </summary>
        public string alarmISR { get; set; }
        /// <summary>值为1堆垛机载货台为有货
        /// 
        /// </summary>
        public string liftFullR { get; set; }
        /// <summary>堆垛机当前列
        /// 
        /// </summary>
        public string posXR { get; set; }
        /// <summary>堆垛机当前层
        /// 
        /// </summary>
        public string posYR { get; set; }
        /// <summary>堆垛机当前货叉位置
        /// =0 货叉原位
        ///=1 货叉在左侧
        ///=2 货叉在右侧
        /// </summary>
        public string posZR { get; set; }
        /// <summary>堆垛机当前列坐标单位MM
        /// 
        /// </summary>
        public string posxmmR { get; set; }
        /// <summary>堆垛机当前层坐标
        /// 
        /// </summary>
        public string posymmR { get; set; }
        /// <summary>堆垛机当前货叉坐标
        /// 
        /// </summary> 
        public string poszmmR { get; set; }
        /// <summary>值为1堆垛机取货完成
        /// 
        /// </summary>
        public string pickFinishR { get; set; }
        /// <summary>值为1堆垛机放货完成
        /// 
        /// </summary>
        public string deliveryFinishR { get; set; }
        /// <summary>值为1表示任务完成
        /// 
        /// </summary>
        public string taskFinishR { get; set; }
        /// <summary>报警代码
        /// 
        /// </summary>
        public string alarmNOR { get; set; }
        /// <summary>当前堆垛机任务状态
        /// =0空闲
        ///=1取货定位中
        ///=2请求取货
        ///=3取货中
        ///=4取货完成放货定位中
        ///=5请求放货
        ///=6放货中
        ///=98维修
        ///=99报警
        /// </summary>
        public string stateR { get; set; }
        /// <summary>堆垛机当前巷道
        /// 
        /// </summary>
        public string actualLaneR { get; set; }
        /// <summary>堆垛机当前任务号
        /// 
        /// </summary>
        public string tasknoR { get; set; }
        public SrmDBli(int srmDeviceId = 0)
        {
            if (srmDeviceId<1||srmDeviceId >9) return;
            int srmno = srmDeviceId;
            handShakeW = "DB540.DBW0";
            srmNOW = "DB540.DBW2";
            palletTypeW = "DB540.DBW4";
            sourcePosXW = "DB540.DBW6";
            sourcePosYW = "DB540.DBW8";
            sourcePosZW = "DB540.DBW10";
            destinationPosXW = "DB540.DBW12";
            destinationPosYW = "DB540.DBW14";
            destinationPosZW = "DB540.DBW16";
            commandW = "DB540.DBW18";
            emergencyStopW = "DB540.DBW20";
            alarmAckW = "DB540.DBW22";
            taskFinishW = "DB540.DBW24";
            Reserve2W = "DB540.DBW26";
            Reserve3W = "DB540.DBW28";
            stbW = "DB540.DBW30";
            ackW = "DB540.DBW32";
            taskNOW = "DB540.DBW34";
            taskFather = "DB540.DBW26";
            //----------------------------------------------------------------------------
            handShakeR = "DB541.DBW0";
            srmNOR = "DB541.DBW2";
            modeR = "DB541.DBW4";
            alarmISR = "DB541.DBW6";
            liftFullR = "DB541.DBW8";
            posXR = "DB541.DBW10";
            posYR = "DB541.DBW12";
            posZR = "DB541.DBW14";
            posxmmR = "DB541.DBD16";
            posymmR = "DB541.DBD20";
            poszmmR = "DB541.DBD24";
            pickFinishR = "DB541.DBW28";
            deliveryFinishR = "DB541.DBW30";
            taskFinishR = "DB541.DBW32";
            alarmNOR = "DB541.DBW34";
            stateR = "DB541.DBW36";
            actualLaneR = "DB541.DBW38";
            tasknoR = "DB541.DBW40";
 
        }
    }
}