PlcAddressConfig.cs 57 KB

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