PlcAddressConfig.cs 57 KB

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