PlcAddressConfig.cs 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223
  1. using Prism.Mvvm;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using TeamAAS_VP.Models.PLC;
  8. namespace TeamAAS_VP.Models.PLC
  9. {
  10. public class PlcAddressConfig : BindableBase
  11. {
  12. #region 写入到PLC的地址
  13. private PlcPointAddress _QrCodeCamera = new PlcPointAddress();
  14. /// <summary>
  15. /// 二维码拍照点位参数
  16. /// </summary>
  17. public PlcPointAddress Out_QrCodeCamera
  18. {
  19. get { return _QrCodeCamera; }
  20. set { SetProperty(ref _QrCodeCamera, value); }
  21. }
  22. private PlcAddress _QrCodePhotoResault = new PlcAddress();
  23. /// <summary>
  24. /// pc发送二维码拍照点位成功后 =1 失败=2 未执行=0
  25. /// </summary>
  26. public PlcAddress Out_QrCodePhotoResault
  27. {
  28. get { return _QrCodePhotoResault; }
  29. set { SetProperty(ref _QrCodePhotoResault, value); }
  30. }
  31. private int _PlcNo;
  32. public int PlcNo
  33. {
  34. get { return _PlcNo; }
  35. set { SetProperty(ref _PlcNo, value); }
  36. }
  37. private PlcAddress _Out_ProductLoadMode;
  38. /// <summary>
  39. /// 产品切换类型
  40. /// </summary>
  41. public PlcAddress Out_ProductLoadMode
  42. {
  43. get { return _Out_ProductLoadMode; }
  44. set { SetProperty(ref _Out_ProductLoadMode, value); }
  45. }
  46. private PlcAddress _Out_WorkMode = new PlcAddress();
  47. /// <summary>
  48. /// 工作模式 =1 拍1打1 =2 拍1打所有
  49. /// </summary>
  50. public PlcAddress Out_WorkMode
  51. {
  52. get { return _Out_WorkMode; }
  53. set { SetProperty(ref _Out_WorkMode, value); }
  54. }
  55. private PlcAddress _PickPointNum = new PlcAddress();
  56. /// <summary>
  57. /// 取料位置 =0 不需要取料 =1 需要取料
  58. /// </summary>
  59. public PlcAddress Out_PickPointNum
  60. {
  61. get { return _PickPointNum; }
  62. set { SetProperty(ref _PickPointNum, value); }
  63. }
  64. private PlcAddress _DowmCameraNum = new PlcAddress();
  65. /// <summary>
  66. /// 下相机拍照次数=0 无
  67. /// </summary>
  68. public PlcAddress Out_DowmCameraNum
  69. {
  70. get => _DowmCameraNum;
  71. set => SetProperty(ref _DowmCameraNum, value);
  72. }
  73. private PlcAddress _UpCameraPickNum = new PlcAddress();
  74. /// <summary>
  75. /// 上相机取料拍照次数=0 无
  76. /// </summary>
  77. public PlcAddress Out_UpCameraPickNum
  78. {
  79. get => _UpCameraPickNum;
  80. set => SetProperty(ref _UpCameraPickNum, value);
  81. }
  82. private PlcAddress _UpCameraPutNum = new PlcAddress();
  83. /// <summary>
  84. /// 上相机放料拍照次数=0 无
  85. /// </summary>
  86. public PlcAddress Out_UpCameraPutNum
  87. {
  88. get => _UpCameraPutNum;
  89. set => SetProperty(ref _UpCameraPutNum, value);
  90. }
  91. private PlcAddress _UPCameracheckNum = new PlcAddress();
  92. /// <summary>
  93. /// 上相机锁附/组装次数=0 无
  94. /// </summary>
  95. public PlcAddress Out_UPCameracheckNum
  96. {
  97. get => _UPCameracheckNum;
  98. set => SetProperty(ref _UPCameracheckNum, value);
  99. }
  100. private PlcAddress _FixedCameraPickNum = new PlcAddress();
  101. /// <summary>
  102. /// 取料固定位置拍产品相机数量 =0 无
  103. /// </summary>
  104. public PlcAddress Out_FixedCameraPickNum
  105. {
  106. get => _FixedCameraPickNum;
  107. set => SetProperty(ref _FixedCameraPickNum, value);
  108. }
  109. private PlcAddress _FixedCameraPutNum = new PlcAddress();
  110. /// <summary>
  111. /// 锁附/组装固定位置拍产品相机数量 =0 无
  112. /// </summary>
  113. public PlcAddress Out_FixedCameraPutNum
  114. {
  115. get => _FixedCameraPutNum;
  116. set => SetProperty(ref _FixedCameraPutNum, value);
  117. }
  118. private PlcAddress _FixedCameracheckNum = new PlcAddress();
  119. /// <summary>
  120. /// 固定相机检测锁附/组装次数=0 无
  121. /// </summary>
  122. public PlcAddress Out_FixedCameracheckNum
  123. {
  124. get => _FixedCameracheckNum;
  125. set => SetProperty(ref _FixedCameracheckNum, value);
  126. }
  127. private PlcAddress _WorkNum = new PlcAddress();
  128. /// <summary>
  129. /// 锁附/组装数量
  130. /// </summary>
  131. public PlcAddress Out_WorkNum
  132. {
  133. get { return _WorkNum; }
  134. set { SetProperty(ref _WorkNum, value); }
  135. }
  136. private PlcAddress _DownCameraStatus = new PlcAddress();
  137. /// <summary>
  138. /// 下相机拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
  139. /// </summary>
  140. public PlcAddress Out_DownCameraStatus
  141. {
  142. get { return _DownCameraStatus; }
  143. set { SetProperty(ref _DownCameraStatus, value); }
  144. }
  145. private PlcAddress _UpCameraPickStatus = new PlcAddress();
  146. /// <summary>
  147. /// 上相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
  148. /// </summary>
  149. public PlcAddress Out_UpCameraPickStatus
  150. {
  151. get { return _UpCameraPickStatus; }
  152. set { SetProperty(ref _UpCameraPickStatus, value); }
  153. }
  154. private PlcAddress _UpCameraPutStatus = new PlcAddress();
  155. /// <summary>
  156. /// 上相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
  157. /// </summary>
  158. public PlcAddress Out_UpCameraPutStatus
  159. {
  160. get { return _UpCameraPutStatus; }
  161. set { SetProperty(ref _UpCameraPutStatus, value); }
  162. }
  163. private PlcAddress _UPCameracheckStatus = new PlcAddress();
  164. /// <summary>
  165. /// 上相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
  166. /// </summary>
  167. public PlcAddress Out_UPCameracheckStatus
  168. {
  169. get { return _UPCameracheckStatus; }
  170. set { SetProperty(ref _UPCameracheckStatus, value); }
  171. }
  172. private PlcAddress _FixedCameraPickStatus = new PlcAddress();
  173. /// <summary>
  174. /// 固定相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
  175. /// </summary>
  176. public PlcAddress Out_FixedCameraPickStatus
  177. {
  178. get { return _FixedCameraPickStatus; }
  179. set { SetProperty(ref _FixedCameraPickStatus, value); }
  180. }
  181. private PlcAddress _FixedCameraPutStatus = new PlcAddress();
  182. /// <summary>
  183. /// 固定相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
  184. /// </summary>
  185. public PlcAddress Out_FixedCameraPutStatus
  186. {
  187. get { return _FixedCameraPutStatus; }
  188. set { SetProperty(ref _FixedCameraPutStatus, value); }
  189. }
  190. private PlcAddress _FixedCameracheckStatus = new PlcAddress();
  191. /// <summary>
  192. /// 固定相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
  193. /// </summary>
  194. public PlcAddress Out_FixedCameracheckStatus
  195. {
  196. get { return _FixedCameracheckStatus; }
  197. set { SetProperty(ref _FixedCameracheckStatus, value); }
  198. }
  199. private PlcAddress _Out_CameraDone = new PlcAddress();
  200. /// <summary>
  201. /// 相机坐标拟合完成
  202. /// </summary>
  203. public PlcAddress Out_CameraDone
  204. {
  205. get { return _Out_CameraDone; }
  206. set { SetProperty(ref _Out_CameraDone, value); }
  207. }
  208. private PlcAddress _MesStatus = new PlcAddress();
  209. /// <summary>
  210. /// 过站信息 =1 允许工作 =2 本站放行 =3 数据上传完成
  211. /// </summary>
  212. public PlcAddress Out_MesStatus
  213. {
  214. get { return _MesStatus; }
  215. set { SetProperty(ref _MesStatus, value); }
  216. }
  217. private PlcPointAddress _PickCamera = new PlcPointAddress();
  218. /// <summary>
  219. /// 取料拍照点位参数
  220. /// </summary>
  221. public PlcPointAddress Out_PickCamera
  222. {
  223. get { return _PickCamera; }
  224. set { SetProperty(ref _PickCamera, value); }
  225. }
  226. private PlcPointAddress _Pick = new PlcPointAddress();
  227. /// <summary>
  228. /// 取料点位参数
  229. /// </summary>
  230. public PlcPointAddress Out_Pick
  231. {
  232. get { return _Pick; }
  233. set { SetProperty(ref _Pick, value); }
  234. }
  235. private PlcPointAddress _SecPosCamera = new PlcPointAddress();
  236. /// <summary>
  237. /// 下相机二次定位点位参数
  238. /// </summary>
  239. public PlcPointAddress Out_SecPosCamera
  240. {
  241. get { return _SecPosCamera; }
  242. set { SetProperty(ref _SecPosCamera, value); }
  243. }
  244. private PlcPointAddress _ScrewCamera = new PlcPointAddress();
  245. /// <summary>
  246. /// 锁附拍照点位参数
  247. /// </summary>
  248. public PlcPointAddress Out_ScrewCamera
  249. {
  250. get { return _ScrewCamera; }
  251. set { SetProperty(ref _ScrewCamera, value); }
  252. }
  253. private PlcPointAddress _Screw = new PlcPointAddress();
  254. /// <summary>
  255. /// 锁附点位参数
  256. /// </summary>
  257. public PlcPointAddress Out_Screw
  258. {
  259. get { return _Screw; }
  260. set { SetProperty(ref _Screw, value); }
  261. }
  262. private PlcPointAddress _CheckCamera = new PlcPointAddress();
  263. /// <summary>
  264. /// 复检点位参数
  265. /// </summary>
  266. public PlcPointAddress Out_CheckCamera
  267. {
  268. get { return _CheckCamera; }
  269. set { SetProperty(ref _CheckCamera, value); }
  270. }
  271. private PlcPointAddress _Out_RemovePos = new PlcPointAddress();
  272. /// <summary>
  273. /// 撕膜点位参数
  274. /// </summary>
  275. public PlcPointAddress Out_RemovePos
  276. {
  277. get { return _Out_RemovePos; }
  278. set { SetProperty(ref _Out_RemovePos, value); }
  279. }
  280. private PlcPointAddress _Out_PressurePlace = new PlcPointAddress();
  281. /// <summary>
  282. /// 压力组装点位参数
  283. /// </summary>
  284. public PlcPointAddress Out_PressurePlace
  285. {
  286. get { return _Out_PressurePlace; }
  287. set { SetProperty(ref _Out_PressurePlace, value); }
  288. }
  289. private PlcAddress _Out_ScrewTeachNum;
  290. /// <summary>
  291. /// 披头矫正的模式,1:初始化时矫正,2:每个产品矫正一次,3:每颗螺丝矫正一次
  292. /// </summary>
  293. public PlcAddress Out_ScrewTeachNum
  294. {
  295. get { return _Out_ScrewTeachNum; }
  296. set { SetProperty(ref _Out_ScrewTeachNum, value); }
  297. }
  298. private PlcAddress _Out_ScrewTeachOk;
  299. /// <summary>
  300. /// 下相机矫正披头的结果,1:OK,2:NG
  301. /// </summary>
  302. public PlcAddress Out_ScrewTeachOk
  303. {
  304. get { return _Out_ScrewTeachOk; }
  305. set { SetProperty(ref _Out_ScrewTeachOk, value); }
  306. }
  307. private PlcAddress _Out_ScrewFeederIsChanged;
  308. /// <summary>
  309. /// 螺丝供料器发生改变
  310. /// </summary>
  311. public PlcAddress Out_ScrewFeederIsChanged
  312. {
  313. get { return _Out_ScrewFeederIsChanged; }
  314. set { SetProperty(ref _Out_ScrewFeederIsChanged, value); }
  315. }
  316. private PlcAddress _Down_Time;
  317. /// <summary>
  318. /// A_Camera Assy组装时间
  319. /// </summary>
  320. public PlcAddress Down_Time
  321. {
  322. get { return _Down_Time; }
  323. set { SetProperty(ref _Down_Time, value); }
  324. }
  325. private PlcAddress _Down_WetOut_Num;
  326. /// <summary>
  327. /// A_Camera Assy组装压力
  328. /// </summary>
  329. public PlcAddress Down_WetOut_Num
  330. {
  331. get { return _Down_WetOut_Num; }
  332. set { SetProperty(ref _Down_WetOut_Num, value); }
  333. }
  334. private PlcAddress _Down_WetOut_Num_max;
  335. /// <summary>
  336. /// A_Camera Assy组装压力最大值
  337. /// </summary>
  338. public PlcAddress Down_WetOut_Num_max
  339. {
  340. get { return _Down_WetOut_Num_max; }
  341. set { SetProperty(ref _Down_WetOut_Num_max, value); }
  342. }
  343. #endregion
  344. #region 从PLC读取的地址
  345. private PlcAddress _In_QrCodePhotoRequest = new PlcAddress();
  346. /// <summary>
  347. /// 二维码拍照请求
  348. /// </summary>
  349. public PlcAddress In_QrCodePhotoRequest
  350. {
  351. get { return _In_QrCodePhotoRequest; }
  352. set { SetProperty(ref _In_QrCodePhotoRequest, value); }
  353. }
  354. private PlcAddress _In_QrCodeCamera_ScanNum = new PlcAddress();
  355. /// <summary>
  356. /// 二维码拍照请求序号
  357. /// </summary>
  358. public PlcAddress In_QrCodeCamera_ScanNum
  359. {
  360. get { return _In_QrCodeCamera_ScanNum; }
  361. set { SetProperty(ref _In_QrCodeCamera_ScanNum, value); }
  362. }
  363. private PlcAddress _In_Code = new PlcAddress();
  364. /// <summary>
  365. /// 产品编码
  366. /// </summary>
  367. public PlcAddress In_Code
  368. {
  369. get { return _In_Code; }
  370. set { SetProperty(ref _In_Code, value); }
  371. }
  372. private PlcAddress _In_MesCheck = new PlcAddress();
  373. /// <summary>
  374. /// Mes交互 =1 获取过站信息当站是否生产,=2 上传本站数据
  375. /// </summary>
  376. public PlcAddress In_MesCheck
  377. {
  378. get { return _In_MesCheck; }
  379. set { SetProperty(ref _In_MesCheck, value); }
  380. }
  381. private PlcAddress _In_Result = new PlcAddress();
  382. /// <summary>
  383. /// 产品的最终结果
  384. /// </summary>
  385. public PlcAddress In_Result
  386. {
  387. get { return _In_Result; }
  388. set { SetProperty(ref _In_Result, value); }
  389. }
  390. private PlcAddress _In_DowmCameraNum = new PlcAddress();
  391. /// <summary>
  392. /// 下相机拍照编号
  393. /// </summary>
  394. public PlcAddress In_DowmCameraNum
  395. {
  396. get { return _In_DowmCameraNum; }
  397. set { SetProperty(ref _In_DowmCameraNum, value); }
  398. }
  399. private PlcAddress _In_DowmCameraExe = new PlcAddress();
  400. /// <summary>
  401. /// 下相机拍照触发
  402. /// </summary>
  403. public PlcAddress In_DowmCameraExe
  404. {
  405. get { return _In_DowmCameraExe; }
  406. set { SetProperty(ref _In_DowmCameraExe, value); }
  407. }
  408. private PlcAddress _In_UpCameraPickNum = new PlcAddress();
  409. /// <summary>
  410. /// 上相机取料拍照编号
  411. /// </summary>
  412. public PlcAddress In_UpCameraPickNum
  413. {
  414. get { return _In_UpCameraPickNum; }
  415. set { SetProperty(ref _In_UpCameraPickNum, value); }
  416. }
  417. private PlcAddress _In_UpCameraPickExe = new PlcAddress();
  418. /// <summary>
  419. /// 上相机取料拍照触发
  420. /// </summary>
  421. public PlcAddress In_UpCameraPickExe
  422. {
  423. get { return _In_UpCameraPickExe; }
  424. set { SetProperty(ref _In_UpCameraPickExe, value); }
  425. }
  426. private PlcAddress _In_UpCameraPutNum = new PlcAddress();
  427. /// <summary>
  428. /// 上相机锁附/组装拍照编号
  429. /// </summary>
  430. public PlcAddress In_UpCameraPutNum
  431. {
  432. get { return _In_UpCameraPutNum; }
  433. set { SetProperty(ref _In_UpCameraPutNum, value); }
  434. }
  435. private PlcAddress _In_UpCameraPutExe = new PlcAddress();
  436. /// <summary>
  437. /// 上相机锁附/组装拍照触发
  438. /// </summary>
  439. public PlcAddress In_UpCameraPutExe
  440. {
  441. get { return _In_UpCameraPutExe; }
  442. set { SetProperty(ref _In_UpCameraPutExe, value); }
  443. }
  444. private PlcAddress _In_UPCameracheckNum = new PlcAddress();
  445. /// <summary>
  446. /// 上相机检测拍照编号
  447. /// </summary>
  448. public PlcAddress In_UPCameracheckNum
  449. {
  450. get { return _In_UPCameracheckNum; }
  451. set { SetProperty(ref _In_UPCameracheckNum, value); }
  452. }
  453. private PlcAddress _In_UPCameracheckExe = new PlcAddress();
  454. /// <summary>
  455. /// 上相机检测拍照触发
  456. /// </summary>
  457. public PlcAddress In_UPCameracheckExe
  458. {
  459. get { return _In_UPCameracheckExe; }
  460. set { SetProperty(ref _In_UPCameracheckExe, value); }
  461. }
  462. private PlcAddress _In_FixedCameraPickNum = new PlcAddress();
  463. /// <summary>
  464. /// 固定相机取料拍照编号
  465. /// </summary>
  466. public PlcAddress In_FixedCameraPickNum
  467. {
  468. get { return _In_FixedCameraPickNum; }
  469. set { SetProperty(ref _In_FixedCameraPickNum, value); }
  470. }
  471. private PlcAddress _In_FixedCameraPickExe = new PlcAddress();
  472. /// <summary>
  473. /// 固定相机取料拍照触发
  474. /// </summary>
  475. public PlcAddress In_FixedCameraPickExe
  476. {
  477. get { return _In_FixedCameraPickExe; }
  478. set { SetProperty(ref _In_FixedCameraPickExe, value); }
  479. }
  480. private PlcAddress _In_FixedCameraPutNum = new PlcAddress();
  481. /// <summary>
  482. /// 固定相机锁附/组装拍照编号
  483. /// </summary>
  484. public PlcAddress In_FixedCameraPutNum
  485. {
  486. get { return _In_FixedCameraPutNum; }
  487. set { SetProperty(ref _In_FixedCameraPutNum, value); }
  488. }
  489. private PlcAddress _In_FixedCameraPutExe = new PlcAddress();
  490. /// <summary>
  491. /// 固定相机锁附/组装拍照触发
  492. /// </summary>
  493. public PlcAddress In_FixedCameraPutExe
  494. {
  495. get { return _In_FixedCameraPutExe; }
  496. set { SetProperty(ref _In_FixedCameraPutExe, value); }
  497. }
  498. private PlcAddress _In_FixedCameracheckNum = new PlcAddress();
  499. /// <summary>
  500. /// 固定相机检测拍照编号
  501. /// </summary>
  502. public PlcAddress In_FixedCameracheckNum
  503. {
  504. get { return _In_FixedCameracheckNum; }
  505. set { SetProperty(ref _In_FixedCameracheckNum, value); }
  506. }
  507. private PlcAddress _In_FixedCameracheckExe = new PlcAddress();
  508. /// <summary>
  509. /// 固定相机检测拍照触发
  510. /// </summary>
  511. public PlcAddress In_FixedCameracheckExe
  512. {
  513. get { return _In_FixedCameracheckExe; }
  514. set { SetProperty(ref _In_FixedCameracheckExe, value); }
  515. }
  516. private PlcAddress _In_ProductNum = new PlcAddress();
  517. /// <summary>
  518. /// 正在锁附/组装编号
  519. /// </summary>
  520. public PlcAddress In_ProductNum
  521. {
  522. get { return _In_ProductNum; }
  523. set { SetProperty(ref _In_ProductNum, value); }
  524. }
  525. private PlcAddress _In_RequestPosition = new PlcAddress();
  526. /// <summary>
  527. /// 请求目标位置
  528. /// </summary>
  529. public PlcAddress In_RequestPosition
  530. {
  531. get { return _In_RequestPosition; }
  532. set { SetProperty(ref _In_RequestPosition, value); }
  533. }
  534. private PlcAddress _In_WorkStart = new PlcAddress();
  535. /// <summary>
  536. /// 锁附/组装开始 =1
  537. /// </summary>
  538. public PlcAddress In_WorkStart
  539. {
  540. get { return _In_WorkStart; }
  541. set { SetProperty(ref _In_WorkStart, value); }
  542. }
  543. private PlcAddress _In_WorkDone = new PlcAddress();
  544. /// <summary>
  545. /// 锁附/组装结束 =1OK =2NG
  546. /// </summary>
  547. public PlcAddress In_WorkDone
  548. {
  549. get { return _In_WorkDone; }
  550. set { SetProperty(ref _In_WorkDone, value); }
  551. }
  552. private PlcAddress _In_PressureValue = new PlcAddress();
  553. /// <summary>
  554. /// 压力值
  555. /// </summary>
  556. public PlcAddress In_PressureValue
  557. {
  558. get { return _In_PressureValue; }
  559. set { SetProperty(ref _In_PressureValue, value); }
  560. }
  561. private PlcAddress _In_ScrewTeachExe;
  562. /// <summary>
  563. /// 触发披头视觉矫正
  564. /// </summary>
  565. public PlcAddress In_ScrewTeachExe
  566. {
  567. get { return _In_ScrewTeachExe; }
  568. set { SetProperty(ref _In_ScrewTeachExe, value); }
  569. }
  570. private PlcAddress _In_PickINC;
  571. /// <summary>
  572. /// 取一颗螺丝出发信号
  573. /// </summary>
  574. public PlcAddress In_PickINC
  575. {
  576. get { return _In_PickINC; }
  577. set { SetProperty(ref _In_PickINC, value); }
  578. }
  579. private PlcAddress _In_DryMode;
  580. /// <summary>
  581. /// 空跑模式
  582. /// </summary>
  583. public PlcAddress In_DryMode
  584. {
  585. get { return _In_DryMode; }
  586. set { SetProperty(ref _In_DryMode, value); }
  587. }
  588. private PlcAddress _In_Throw;
  589. /// <summary>
  590. /// 抛料信号
  591. /// </summary>
  592. public PlcAddress In_Throw
  593. {
  594. get { return _In_Throw; }
  595. set { SetProperty(ref _In_Throw, value); }
  596. }
  597. private PlcAddress _In_CurPressureValue = new PlcAddress();
  598. /// <summary>
  599. /// 压力值
  600. /// </summary>
  601. public PlcAddress In_CurPressureValue
  602. {
  603. get { return _In_CurPressureValue; }
  604. set { SetProperty(ref _In_CurPressureValue, value); }
  605. }
  606. private PlcAddress _RunMode;
  607. public PlcAddress RunMode
  608. {
  609. get { return _RunMode; }
  610. set { SetProperty(ref _RunMode, value); }
  611. }
  612. private PlcAddress _ManualMode;
  613. public PlcAddress ManualMode
  614. {
  615. get { return _ManualMode; }
  616. set { SetProperty(ref _ManualMode, value); }
  617. }
  618. private PlcAddress _ClearMode;
  619. public PlcAddress ClearMode
  620. {
  621. get { return _ClearMode; }
  622. set { SetProperty(ref _ClearMode, value); }
  623. }
  624. private PlcAddress _Fault;
  625. public PlcAddress Fault
  626. {
  627. get { return _Fault; }
  628. set { SetProperty(ref _Fault, value); }
  629. }
  630. #endregion
  631. public PlcAddressConfig()
  632. {
  633. }
  634. // 初始默认值
  635. public void SetDefaultValue()
  636. {
  637. // 1. PlcNo 默认
  638. PlcNo = 1;
  639. // 辅助局部函数:确保 PlcAddress 实例存在
  640. PlcAddress Ensure(PlcAddress a)
  641. {
  642. if (a == null) return new PlcAddress();
  643. return a;
  644. }
  645. // 辅助局部函数:确保 PlcPointAddress 实例存在
  646. PlcPointAddress EnsurePoint(PlcPointAddress p)
  647. {
  648. if (p == null) return new PlcPointAddress();
  649. return p;
  650. }
  651. // Out_QrCodeCamera(二维码拍照点位)初始化并赋地址
  652. Out_QrCodeCamera = EnsurePoint(Out_QrCodeCamera);
  653. Out_QrCodeCamera.Description = "二维码拍照点位参数";
  654. Out_QrCodeCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].X_Position";
  655. Out_QrCodeCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].X_Velocity";
  656. Out_QrCodeCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].Y_Position";
  657. Out_QrCodeCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].Y_Velocity";
  658. Out_QrCodeCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].Z_Position_Start";
  659. Out_QrCodeCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].Z_Velocity_Start";
  660. Out_QrCodeCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].Z_Position_Stop";
  661. Out_QrCodeCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].Z_Velocity_Stop";
  662. Out_QrCodeCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].U_Position";
  663. Out_QrCodeCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].U_Velocity";
  664. Out_QrCodeCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].R_Position";
  665. Out_QrCodeCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].R_Velocity";
  666. Out_QrCodeCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].Torque";
  667. Out_QrCodeCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].Feeder";
  668. Out_QrCodeCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_Camera_Scan[{0}].ScrewProNum";
  669. In_QrCodePhotoRequest = Ensure(In_QrCodePhotoRequest);
  670. In_QrCodePhotoRequest.Address = "ns=4;s=DB_Communication|ToPC.Camera_ScanExe";
  671. In_QrCodePhotoRequest.DataType = "int16";
  672. In_QrCodePhotoRequest.Description = "二维码拍照请求";
  673. In_QrCodeCamera_ScanNum = Ensure(In_QrCodeCamera_ScanNum);
  674. In_QrCodeCamera_ScanNum.Address = "ns=4;s=DB_Communication|Camera_ScanNum";
  675. In_QrCodeCamera_ScanNum.DataType = "int16";
  676. In_QrCodeCamera_ScanNum.Description = "二维码拍照编号";
  677. Out_QrCodePhotoResault = Ensure(Out_QrCodePhotoResault);
  678. Out_QrCodePhotoResault.Address = "ns=4;s=DB_Communication|FromPC.Camera_ScanStatus";
  679. Out_QrCodePhotoResault.DataType = "int16";
  680. Out_QrCodePhotoResault.Description = "二维码拍照结果";
  681. // 2. 按 JSON 提供的数据设置默认值(以当前属性名为准)
  682. Out_ProductLoadMode = Ensure(Out_ProductLoadMode);
  683. Out_ProductLoadMode.Address = "ns=4;s=DB_Communication|FromPC.ProductLoadMode";
  684. Out_ProductLoadMode.DataType = "int16";
  685. Out_ProductLoadMode.Description = "产品切换类型";
  686. Out_WorkMode = Ensure(Out_WorkMode);
  687. Out_WorkMode.Address = "ns=4;s=DB_Communication|FromPC.WorkMode";
  688. Out_WorkMode.DataType = "int16";
  689. Out_WorkMode.Description = "工作模式 =1 拍1打1 =2 拍1打所有";
  690. Out_PickPointNum = Ensure(Out_PickPointNum);
  691. Out_PickPointNum.Address = "ns=4;s=DB_Communication|FromPC.PickPointNum";
  692. Out_PickPointNum.DataType = "int16";
  693. Out_PickPointNum.Description = "取料位置 =0 不需要取料 =1 需要取料";
  694. Out_DowmCameraNum = Ensure(Out_DowmCameraNum);
  695. Out_DowmCameraNum.Address = "ns=4;s=DB_Communication|FromPC.DowmCameraNum";
  696. Out_DowmCameraNum.DataType = "int16";
  697. Out_DowmCameraNum.Description = "下相机拍照次数=0 无";
  698. Out_UpCameraPickNum = Ensure(Out_UpCameraPickNum);
  699. Out_UpCameraPickNum.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPickNum";
  700. Out_UpCameraPickNum.DataType = "int16";
  701. Out_UpCameraPickNum.Description = "上相机取料拍照次数=0 无";
  702. Out_UpCameraPutNum = Ensure(Out_UpCameraPutNum);
  703. Out_UpCameraPutNum.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPutNum";
  704. Out_UpCameraPutNum.DataType = "int16";
  705. Out_UpCameraPutNum.Description = "上相机放料拍照次数=0 无";
  706. Out_UPCameracheckNum = Ensure(Out_UPCameracheckNum);
  707. Out_UPCameracheckNum.Address = "ns=4;s=DB_Communication|FromPC.UPCameracheckNum";
  708. Out_UPCameracheckNum.DataType = "int16";
  709. Out_UPCameracheckNum.Description = "上相机锁附/组装次数=0 无";
  710. Out_FixedCameraPickNum = Ensure(Out_FixedCameraPickNum);
  711. Out_FixedCameraPickNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPickNum";
  712. Out_FixedCameraPickNum.DataType = "int16";
  713. Out_FixedCameraPickNum.Description = "取料固定位置拍产品相机数量 =0 无";
  714. Out_FixedCameraPutNum = Ensure(Out_FixedCameraPutNum);
  715. Out_FixedCameraPutNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPutNum";
  716. Out_FixedCameraPutNum.DataType = "int16";
  717. Out_FixedCameraPutNum.Description = "锁附/组装固定位置拍产品相机数量 =0 无";
  718. Out_FixedCameracheckNum = Ensure(Out_FixedCameracheckNum);
  719. Out_FixedCameracheckNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameracheckNum";
  720. Out_FixedCameracheckNum.DataType = "int16";
  721. Out_FixedCameracheckNum.Description = "固定相机检测锁附/组装次数=0 无";
  722. Out_PickCamera = EnsurePoint(Out_PickCamera);
  723. // 3. 为其余 Out_* 设置合理默认(基于注释)
  724. Out_WorkNum = Ensure(Out_WorkNum);
  725. Out_WorkNum.Address = "ns=4;s=DB_Communication|FromPC.WorkNum";
  726. Out_WorkNum.DataType = "int16";
  727. Out_WorkNum.Description = "锁附/组装数量";
  728. Out_DownCameraStatus = Ensure(Out_DownCameraStatus);
  729. Out_DownCameraStatus.Address = "ns=4;s=DB_Communication|FromPC.DownCameraStatus";
  730. Out_DownCameraStatus.DataType = "int16";
  731. Out_DownCameraStatus.Description = "下相机拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
  732. Out_UpCameraPickStatus = Ensure(Out_UpCameraPickStatus);
  733. Out_UpCameraPickStatus.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPickStatus";
  734. Out_UpCameraPickStatus.DataType = "int16";
  735. Out_UpCameraPickStatus.Description = "上相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
  736. Out_UpCameraPutStatus = Ensure(Out_UpCameraPutStatus);
  737. Out_UpCameraPutStatus.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPutStatus";
  738. Out_UpCameraPutStatus.DataType = "int16";
  739. Out_UpCameraPutStatus.Description = "上相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
  740. Out_UPCameracheckStatus = Ensure(Out_UPCameracheckStatus);
  741. Out_UPCameracheckStatus.Address = "ns=4;s=DB_Communication|FromPC.UPCameracheckStatus";
  742. Out_UPCameracheckStatus.DataType = "int16";
  743. Out_UPCameracheckStatus.Description = "上相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
  744. Out_FixedCameraPickStatus = Ensure(Out_FixedCameraPickStatus);
  745. Out_FixedCameraPickStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPickStatus";
  746. Out_FixedCameraPickStatus.DataType = "int16";
  747. Out_FixedCameraPickStatus.Description = "固定相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
  748. Out_FixedCameraPutStatus = Ensure(Out_FixedCameraPutStatus);
  749. Out_FixedCameraPutStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPutStatus";
  750. Out_FixedCameraPutStatus.DataType = "int16";
  751. Out_FixedCameraPutStatus.Description = "固定相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
  752. Out_FixedCameracheckStatus = Ensure(Out_FixedCameracheckStatus);
  753. Out_FixedCameracheckStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameracheckStatus";
  754. Out_FixedCameracheckStatus.DataType = "int16";
  755. Out_FixedCameracheckStatus.Description = "固定相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
  756. Out_CameraDone = Ensure(Out_CameraDone);
  757. Out_CameraDone.Address = "ns=4;s=DB_Communication|FromPC.CameraDone";
  758. Out_CameraDone.DataType = "int16";
  759. Out_CameraDone.Description = "相机坐标拟合完成";
  760. Out_MesStatus = Ensure(Out_MesStatus);
  761. Out_MesStatus.Address = "ns=4;s=DB_Communication|FromPC.MesStatus[{0}]";
  762. Out_MesStatus.DataType = "int16";
  763. Out_MesStatus.Description = "过站信息 =1 允许工作 =2 本站放行 =3 数据上传完成";
  764. // Out_PickCamera 初始化并赋地址
  765. Out_PickCamera = EnsurePoint(Out_PickCamera);
  766. Out_PickCamera.Description = "取料拍照点位参数";
  767. Out_PickCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].X_Position";
  768. Out_PickCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].X_Velocity";
  769. Out_PickCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Y_Position";
  770. Out_PickCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Y_Velocity";
  771. Out_PickCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Z_Position_Start";
  772. Out_PickCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Z_Velocity_Start";
  773. Out_PickCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Z_Position_Stop";
  774. Out_PickCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Z_Velocity_Stop";
  775. Out_PickCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].U_Position";
  776. Out_PickCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].U_Velocity";
  777. Out_PickCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].R_Position";
  778. Out_PickCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].R_Velocity";
  779. Out_PickCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Torque";
  780. Out_PickCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Feeder";
  781. Out_PickCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].ScrewProNum";
  782. // Out_Pick(取料点位)初始化并赋地址
  783. Out_Pick = EnsurePoint(Out_Pick);
  784. Out_Pick.Description = "取料点位参数";
  785. Out_Pick.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].X_Position";
  786. Out_Pick.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].X_Velocity";
  787. Out_Pick.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Y_Position";
  788. Out_Pick.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Y_Velocity";
  789. Out_Pick.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Z_Position_Start";
  790. Out_Pick.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Z_Velocity_Start";
  791. Out_Pick.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Z_Position_Stop";
  792. Out_Pick.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Z_Velocity_Stop";
  793. Out_Pick.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].U_Position";
  794. Out_Pick.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].U_Velocity";
  795. Out_Pick.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].R_Position";
  796. Out_Pick.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].R_Velocity";
  797. Out_Pick.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Torque";
  798. Out_Pick.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Feeder";
  799. Out_Pick.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].ScrewProNum";
  800. // Out_SecPosCamera(下相机二次定位)初始化并赋地址
  801. Out_SecPosCamera = EnsurePoint(Out_SecPosCamera);
  802. Out_SecPosCamera.Description = "下相机二次定位点位参数";
  803. Out_SecPosCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].X_Position";
  804. Out_SecPosCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].X_Velocity";
  805. Out_SecPosCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Y_Position";
  806. Out_SecPosCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Y_Velocity";
  807. Out_SecPosCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Z_Position_Start";
  808. Out_SecPosCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Z_Velocity_Start";
  809. Out_SecPosCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Z_Position_Stop";
  810. Out_SecPosCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Z_Velocity_Stop";
  811. Out_SecPosCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].U_Position";
  812. Out_SecPosCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].U_Velocity";
  813. Out_SecPosCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].R_Position";
  814. Out_SecPosCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].R_Velocity";
  815. Out_SecPosCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Torque";
  816. Out_SecPosCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Feeder";
  817. Out_SecPosCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].ScrewProNum";
  818. // Out_ScrewCamera(锁附拍照点位)初始化并赋地址
  819. Out_ScrewCamera = EnsurePoint(Out_ScrewCamera);
  820. Out_ScrewCamera.Description = "锁附拍照点位参数";
  821. Out_ScrewCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].X_Position";
  822. Out_ScrewCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].X_Velocity";
  823. Out_ScrewCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Y_Position";
  824. Out_ScrewCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Y_Velocity";
  825. Out_ScrewCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Z_Position_Start";
  826. Out_ScrewCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Z_Velocity_Start";
  827. Out_ScrewCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Z_Position_Stop";
  828. Out_ScrewCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Z_Velocity_Stop";
  829. Out_ScrewCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].U_Position";
  830. Out_ScrewCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].U_Velocity";
  831. Out_ScrewCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].R_Position";
  832. Out_ScrewCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].R_Velocity";
  833. Out_ScrewCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Torque";
  834. Out_ScrewCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Feeder";
  835. Out_ScrewCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].ScrewProNum";
  836. // Out_Screw(锁附点位)初始化并赋地址
  837. Out_Screw = EnsurePoint(Out_Screw);
  838. Out_Screw.Description = "锁附点位参数";
  839. Out_Screw.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].X_Position";
  840. Out_Screw.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].X_Velocity";
  841. Out_Screw.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Y_Position";
  842. Out_Screw.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Y_Velocity";
  843. Out_Screw.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Z_Position_Start";
  844. Out_Screw.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Z_Velocity_Start";
  845. Out_Screw.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Z_Position_Stop";
  846. Out_Screw.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Z_Velocity_Stop";
  847. Out_Screw.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].U_Position";
  848. Out_Screw.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].U_Velocity";
  849. Out_Screw.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].R_Position";
  850. Out_Screw.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].R_Velocity";
  851. Out_Screw.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Torque";
  852. Out_Screw.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Feeder";
  853. Out_Screw.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].ScrewProNum";
  854. // Out_CheckCamera(复检点位)初始化并赋地址
  855. Out_CheckCamera = EnsurePoint(Out_CheckCamera);
  856. Out_CheckCamera.Description = "复检点位参数";
  857. Out_CheckCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].X_Position";
  858. Out_CheckCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].X_Velocity";
  859. Out_CheckCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Y_Position";
  860. Out_CheckCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Y_Velocity";
  861. Out_CheckCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Z_Position_Start";
  862. Out_CheckCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Z_Velocity_Start";
  863. Out_CheckCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Z_Position_Stop";
  864. Out_CheckCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Z_Velocity_Stop";
  865. Out_CheckCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].U_Position";
  866. Out_CheckCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].U_Velocity";
  867. Out_CheckCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].R_Position";
  868. Out_CheckCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].R_Velocity";
  869. Out_CheckCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Torque";
  870. Out_CheckCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Feeder";
  871. Out_CheckCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].ScrewProNum";
  872. //撕膜点位
  873. Out_RemovePos = EnsurePoint(Out_RemovePos);
  874. Out_RemovePos.Description = "撕膜点位参数";
  875. Out_RemovePos.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].X_Position";
  876. Out_RemovePos.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].X_Velocity";
  877. Out_RemovePos.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].Y_Position";
  878. Out_RemovePos.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].Y_Velocity";
  879. Out_RemovePos.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].Z_Position_Start";
  880. Out_RemovePos.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].Z_Velocity_Start";
  881. Out_RemovePos.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].Z_Position_Stop";
  882. Out_RemovePos.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].Z_Velocity_Stop";
  883. Out_RemovePos.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].U_Position";
  884. Out_RemovePos.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].U_Velocity";
  885. Out_RemovePos.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].R_Position";
  886. Out_RemovePos.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].R_Velocity";
  887. Out_RemovePos.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].Torque";
  888. Out_RemovePos.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].Feeder";
  889. Out_RemovePos.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_Remove[{0}].ScrewProNum";
  890. //压力组装点位
  891. Out_PressurePlace = EnsurePoint(Out_PressurePlace);
  892. Out_PressurePlace.Description = "压力组装点位参数";
  893. Out_PressurePlace.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].X_Position";
  894. Out_PressurePlace.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].X_Velocity";
  895. Out_PressurePlace.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].Y_Position";
  896. Out_PressurePlace.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].Y_Velocity";
  897. Out_PressurePlace.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].Z_Position_Start";
  898. Out_PressurePlace.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].Z_Velocity_Start";
  899. Out_PressurePlace.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].Z_Position_Stop";
  900. Out_PressurePlace.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].Z_Velocity_Stop";
  901. Out_PressurePlace.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].U_Position";
  902. Out_PressurePlace.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].U_Velocity";
  903. Out_PressurePlace.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].R_Position";
  904. Out_PressurePlace.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].R_Velocity";
  905. Out_PressurePlace.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].Torque";
  906. Out_PressurePlace.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].Feeder";
  907. Out_PressurePlace.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_Wetout[{0}].ScrewProNum";
  908. // Out_CheckCamera(附加轴点位)初始化并赋地址,
  909. Out_ScrewTeachNum = Ensure(Out_ScrewTeachNum);
  910. Out_ScrewTeachNum.Address = "ns=4;s=DB_Communication|FromPC.ScrewTeachNum";
  911. Out_ScrewTeachNum.DataType = "int16";
  912. Out_ScrewTeachNum.Description = "披头矫正的模式,1:初始化时矫正,2:每个产品矫正一次,3:每颗螺丝矫正一次";
  913. Out_ScrewTeachOk = Ensure(Out_ScrewTeachOk);
  914. Out_ScrewTeachOk.Address = "ns=4;s=DB_Communication|FromPC.ScrewTeachOK";
  915. Out_ScrewTeachOk.DataType = "int16";
  916. Out_ScrewTeachOk.Description = "下相机矫正披头的结果,1:OK,2:NG";
  917. Out_ScrewFeederIsChanged = Ensure(Out_ScrewFeederIsChanged);
  918. Out_ScrewFeederIsChanged.Address = "ns=4;s=DB_Communication|FromPC.PickNumChange";
  919. Out_ScrewFeederIsChanged.DataType = "int16";
  920. Out_ScrewFeederIsChanged.Description = "供料器发生改变";
  921. // 4. In_* 默认(假定从 PLC 读到 PC,使用 ToPC 前缀)
  922. In_Code = Ensure(In_Code);
  923. In_Code.Address = "ns=4;s=DB_Communication|ToPC.Mes[{0}].Code";
  924. In_Code.DataType = "string";
  925. In_Code.Description = "产品编码";
  926. In_MesCheck = Ensure(In_MesCheck);
  927. In_MesCheck.Address = "ns=4;s=DB_Communication|ToPC.Mes[{0}].Check";
  928. In_MesCheck.DataType = "int16";
  929. In_MesCheck.Description = "Mes交互 =1 获取过站信息当站是否生产,=2 上传本站数据";
  930. In_Result = Ensure(In_Result);
  931. In_Result.Address = "ns=4;s=DB_Communication|ToPC.Mes[{0}].Product_Status";
  932. In_Result.DataType = "int16";
  933. In_Result.Description = "产品的最终结果,1:OK; 2:NG";
  934. In_DowmCameraNum = Ensure(In_DowmCameraNum);
  935. In_DowmCameraNum.Address = "ns=4;s=DB_Communication|ToPC.DowmCameraNum";
  936. In_DowmCameraNum.DataType = "int16";
  937. In_DowmCameraNum.Description = "下相机拍照编号";
  938. In_DowmCameraExe = Ensure(In_DowmCameraExe);
  939. In_DowmCameraExe.Address = "ns=4;s=DB_Communication|ToPC.DowmCameraExe";
  940. In_DowmCameraExe.DataType = "int16";
  941. In_DowmCameraExe.Description = "下相机拍照触发";
  942. In_UpCameraPickNum = Ensure(In_UpCameraPickNum);
  943. In_UpCameraPickNum.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPickNum";
  944. In_UpCameraPickNum.DataType = "int16";
  945. In_UpCameraPickNum.Description = "上相机取料拍照编号";
  946. In_UpCameraPickExe = Ensure(In_UpCameraPickExe);
  947. In_UpCameraPickExe.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPickExe";
  948. In_UpCameraPickExe.DataType = "int16";
  949. In_UpCameraPickExe.Description = "上相机取料拍照触发";
  950. In_UpCameraPutNum = Ensure(In_UpCameraPutNum);
  951. In_UpCameraPutNum.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPutNum";
  952. In_UpCameraPutNum.DataType = "int16";
  953. In_UpCameraPutNum.Description = "上相机锁附/组装拍照编号";
  954. In_UpCameraPutExe = Ensure(In_UpCameraPutExe);
  955. In_UpCameraPutExe.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPutExe";
  956. In_UpCameraPutExe.DataType = "int16";
  957. In_UpCameraPutExe.Description = "上相机锁附/组装拍照触发";
  958. In_UPCameracheckNum = Ensure(In_UPCameracheckNum);
  959. In_UPCameracheckNum.Address = "ns=4;s=DB_Communication|ToPC.UPCameracheckNum";
  960. In_UPCameracheckNum.DataType = "int16";
  961. In_UPCameracheckNum.Description = "上相机检测拍照编号";
  962. In_UPCameracheckExe = Ensure(In_UPCameracheckExe);
  963. In_UPCameracheckExe.Address = "ns=4;s=DB_Communication|ToPC.UPCameracheckExe";
  964. In_UPCameracheckExe.DataType = "int16";
  965. In_UPCameracheckExe.Description = "上相机检测拍照触发";
  966. In_FixedCameraPickNum = Ensure(In_FixedCameraPickNum);
  967. In_FixedCameraPickNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPickNum";
  968. In_FixedCameraPickNum.DataType = "int16";
  969. In_FixedCameraPickNum.Description = "固定相机取料拍照编号";
  970. In_FixedCameraPickExe = Ensure(In_FixedCameraPickExe);
  971. In_FixedCameraPickExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPickExe";
  972. In_FixedCameraPickExe.DataType = "int16";
  973. In_FixedCameraPickExe.Description = "固定相机取料拍照触发";
  974. In_FixedCameraPutNum = Ensure(In_FixedCameraPutNum);
  975. In_FixedCameraPutNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPutNum";
  976. In_FixedCameraPutNum.DataType = "int16";
  977. In_FixedCameraPutNum.Description = "固定相机锁附/组装拍照编号";
  978. In_FixedCameraPutExe = Ensure(In_FixedCameraPutExe);
  979. In_FixedCameraPutExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPutExe";
  980. In_FixedCameraPutExe.DataType = "int16";
  981. In_FixedCameraPutExe.Description = "固定相机锁附/组装拍照触发";
  982. In_FixedCameracheckNum = Ensure(In_FixedCameracheckNum);
  983. In_FixedCameracheckNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameracheckNum";
  984. In_FixedCameracheckNum.DataType = "int16";
  985. In_FixedCameracheckNum.Description = "固定相机检测拍照编号";
  986. In_FixedCameracheckExe = Ensure(In_FixedCameracheckExe);
  987. In_FixedCameracheckExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameracheckExe";
  988. In_FixedCameracheckExe.DataType = "int16";
  989. In_FixedCameracheckExe.Description = "固定相机检测拍照触发";
  990. In_ProductNum = Ensure(In_ProductNum);
  991. In_ProductNum.Address = "ns=4;s=DB_Communication|ToPC.ProductNum";
  992. In_ProductNum.DataType = "int16";
  993. In_ProductNum.Description = "正在锁附/组装编号";
  994. In_RequestPosition = Ensure(In_RequestPosition);
  995. In_RequestPosition.Address = "ns=4;s=DB_Communication|ToPC.RequestPosition";
  996. In_RequestPosition.DataType = "int16";
  997. In_RequestPosition.Description = "请求目标位置";
  998. In_WorkStart = Ensure(In_WorkStart);
  999. In_WorkStart.Address = "ns=4;s=DB_Communication|ToPC.WorkStart[{0}]";
  1000. In_WorkStart.DataType = "int16";
  1001. In_WorkStart.Description = "锁附/组装开始 =1";
  1002. In_WorkDone = Ensure(In_WorkDone);
  1003. In_WorkDone.Address = "ns=4;s=DB_Communication|ToPC.WorkDone[{0}]";
  1004. In_WorkDone.DataType = "int16";
  1005. In_WorkDone.Description = "锁附/组装结束 =1OK =2NG";
  1006. In_PressureValue = Ensure(In_PressureValue);
  1007. In_PressureValue.Address = "ns=4;s=DB_other|WetOut";// "ns=4;s=DB_DriveControl|AICtrl[{0}].Status.UserData";
  1008. In_PressureValue.DataType = "float";
  1009. In_PressureValue.Description = "压力值";
  1010. In_CurPressureValue = Ensure(In_CurPressureValue);
  1011. In_CurPressureValue.Address = "ns=4;s=DB_DriveControl|AICtrl[{0}].Status.UserData"; ;// "ns=4;s=DB_DriveControl|AICtrl[{0}].Status.UserData";
  1012. In_CurPressureValue.DataType = "float";
  1013. In_CurPressureValue.Description = "实时压力值";
  1014. In_ScrewTeachExe = Ensure(In_ScrewTeachExe);
  1015. In_ScrewTeachExe.Address = "ns=4;s=DB_Communication|ToPC.ScrewTeachExe";
  1016. In_ScrewTeachExe.DataType = "bool";
  1017. In_ScrewTeachExe.Description = "触发披头视觉矫正";
  1018. In_PickINC = Ensure(In_PickINC);
  1019. In_PickINC.Address = "ns=4;s=DB_Communication|ToPC.PickINC";
  1020. In_PickINC.DataType = "int16";
  1021. In_PickINC.Description = "取一颗螺丝触发信号";
  1022. In_DryMode = Ensure(In_DryMode);
  1023. In_DryMode.Address = "ns=4;s=DB_Control|Mode.Status.DryMode";
  1024. In_DryMode.DataType = "bool";
  1025. In_DryMode.Description = "空跑模式";
  1026. Down_Time = Ensure(Down_Time);
  1027. Down_Time.Address = "ns=4;s=DB_other|Down_Time";
  1028. Down_Time.DataType = "int32";
  1029. Down_Time.Description = "A_Camera Assy时间";
  1030. Down_WetOut_Num = Ensure(Down_WetOut_Num);
  1031. Down_WetOut_Num.Address = "ns=4;s=DB_other|WetOut_Num";
  1032. Down_WetOut_Num.DataType = "float";
  1033. Down_WetOut_Num.Description = "A_Camera Assy压力";
  1034. Down_WetOut_Num_max = Ensure(Down_WetOut_Num_max);
  1035. Down_WetOut_Num_max.Address = "ns=4;s=DB_other|WetOut_MAX";
  1036. Down_WetOut_Num_max.DataType = "float";
  1037. Down_WetOut_Num_max.Description = "A_Camera Assy压力最大值";
  1038. In_Throw = Ensure(In_Throw);
  1039. In_Throw.Address = "ns=4;s=DB_Communication|Throw[0]";
  1040. In_Throw.DataType = "Bool";
  1041. In_Throw.Description = "抛料信号";
  1042. RunMode = Ensure(RunMode);
  1043. RunMode.Address = "ns=4;s=DB_Control|Mode.Status.RunMode";
  1044. RunMode.DataType = "Bool";
  1045. RunMode.Description = "自动运行模式";
  1046. ManualMode = Ensure(ManualMode);
  1047. ManualMode.Address = "ns=4;s=DB_Control|Mode.Status.ManualMode";
  1048. ManualMode.DataType = "Bool";
  1049. ManualMode.Description = "维修模式";
  1050. ClearMode = Ensure(ClearMode);
  1051. ClearMode.Address = "ns=4;s=DB_Control|Mode.Status.ClearMode";
  1052. ClearMode.DataType = "Bool";
  1053. ClearMode.Description = "流线模式";
  1054. Fault = Ensure(Fault);
  1055. Fault.Address = "ns=4;s=DB_Control|Mode.Status.Fault";
  1056. Fault.DataType = "Bool";
  1057. Fault.Description = "报警";
  1058. // 说明:若项目中 PlcAddress 的实际属性名或类型与此不同(例如使用枚举、不同字段名),
  1059. // 请根据实际类型调整赋值。本方法主要提供合理的默认字符串地址、数据类型及描述,便于后续从配置覆盖。
  1060. }
  1061. }
  1062. }