| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394 |
- using Prism.Mvvm;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using TeamAAS_VP.Models.PLC;
- using TeamAAS_VP.Resources.Languages;
- namespace TeamAAS_VP.Models.PLC
- {
- public class PlcAddressConfig : BindableBase
- {
- #region 写入到PLC的地址
- private int _PlcNo;
- public int PlcNo
- {
- get { return _PlcNo; }
- set { SetProperty(ref _PlcNo, value); }
- }
- private PlcAddress _Out_ProductLoadMode;
- /// <summary>
- /// 产品切换类型
- /// </summary>
- public PlcAddress Out_ProductLoadMode
- {
- get { return _Out_ProductLoadMode; }
- set { SetProperty(ref _Out_ProductLoadMode, value); }
- }
- private PlcAddress _Out_WorkMode = new PlcAddress();
- /// <summary>
- /// 工作模式 =1 拍1打1 =2 拍1打所有
- /// </summary>
- public PlcAddress Out_WorkMode
- {
- get { return _Out_WorkMode; }
- set { SetProperty(ref _Out_WorkMode, value); }
- }
- private PlcAddress _PickPointNum = new PlcAddress();
- /// <summary>
- /// 取料位置 =0 不需要取料 =1 需要取料
- /// </summary>
- public PlcAddress Out_PickPointNum
- {
- get { return _PickPointNum; }
- set { SetProperty(ref _PickPointNum, value); }
- }
- private PlcAddress _DowmCameraNum = new PlcAddress();
- /// <summary>
- /// 下相机拍照次数=0 无
- /// </summary>
- public PlcAddress Out_DowmCameraNum
- {
- get => _DowmCameraNum;
- set => SetProperty(ref _DowmCameraNum, value);
- }
- private PlcAddress _UpCameraPickNum = new PlcAddress();
- /// <summary>
- /// 上相机取料拍照次数=0 无
- /// </summary>
- public PlcAddress Out_UpCameraPickNum
- {
- get => _UpCameraPickNum;
- set => SetProperty(ref _UpCameraPickNum, value);
- }
- private PlcAddress _UpCameraPutNum = new PlcAddress();
- /// <summary>
- /// 上相机放料拍照次数=0 无
- /// </summary>
- public PlcAddress Out_UpCameraPutNum
- {
- get => _UpCameraPutNum;
- set => SetProperty(ref _UpCameraPutNum, value);
- }
- private PlcAddress _UPCameracheckNum = new PlcAddress();
- /// <summary>
- /// 上相机锁附/组装次数=0 无
- /// </summary>
- public PlcAddress Out_UPCameracheckNum
- {
- get => _UPCameracheckNum;
- set => SetProperty(ref _UPCameracheckNum, value);
- }
- private PlcAddress _FixedCameraPickNum = new PlcAddress();
- /// <summary>
- /// 取料固定位置拍产品相机数量 =0 无
- /// </summary>
- public PlcAddress Out_FixedCameraPickNum
- {
- get => _FixedCameraPickNum;
- set => SetProperty(ref _FixedCameraPickNum, value);
- }
- private PlcAddress _FixedCameraPutNum = new PlcAddress();
- /// <summary>
- /// 锁附/组装固定位置拍产品相机数量 =0 无
- /// </summary>
- public PlcAddress Out_FixedCameraPutNum
- {
- get => _FixedCameraPutNum;
- set => SetProperty(ref _FixedCameraPutNum, value);
- }
- private PlcAddress _FixedCameracheckNum = new PlcAddress();
- /// <summary>
- /// 固定相机检测锁附/组装次数=0 无
- /// </summary>
- public PlcAddress Out_FixedCameracheckNum
- {
- get => _FixedCameracheckNum;
- set => SetProperty(ref _FixedCameracheckNum, value);
- }
- private PlcAddress _WorkNum = new PlcAddress();
- /// <summary>
- /// 锁附/组装数量
- /// </summary>
- public PlcAddress Out_WorkNum
- {
- get { return _WorkNum; }
- set { SetProperty(ref _WorkNum, value); }
- }
- private PlcAddress _DownCameraStatus = new PlcAddress();
- /// <summary>
- /// 下相机拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
- /// </summary>
- public PlcAddress Out_DownCameraStatus
- {
- get { return _DownCameraStatus; }
- set { SetProperty(ref _DownCameraStatus, value); }
- }
- private PlcAddress _UpCameraPickStatus = new PlcAddress();
- /// <summary>
- /// 上相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
- /// </summary>
- public PlcAddress Out_UpCameraPickStatus
- {
- get { return _UpCameraPickStatus; }
- set { SetProperty(ref _UpCameraPickStatus, value); }
- }
- private PlcAddress _UpCameraPutStatus = new PlcAddress();
- /// <summary>
- /// 上相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
- /// </summary>
- public PlcAddress Out_UpCameraPutStatus
- {
- get { return _UpCameraPutStatus; }
- set { SetProperty(ref _UpCameraPutStatus, value); }
- }
- private PlcAddress _UPCameracheckStatus = new PlcAddress();
- /// <summary>
- /// 上相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
- /// </summary>
- public PlcAddress Out_UPCameracheckStatus
- {
- get { return _UPCameracheckStatus; }
- set { SetProperty(ref _UPCameracheckStatus, value); }
- }
- private PlcAddress _FixedCameraPickStatus = new PlcAddress();
- /// <summary>
- /// 固定相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
- /// </summary>
- public PlcAddress Out_FixedCameraPickStatus
- {
- get { return _FixedCameraPickStatus; }
- set { SetProperty(ref _FixedCameraPickStatus, value); }
- }
- private PlcAddress _FixedCameraPutStatus = new PlcAddress();
- /// <summary>
- /// 固定相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
- /// </summary>
- public PlcAddress Out_FixedCameraPutStatus
- {
- get { return _FixedCameraPutStatus; }
- set { SetProperty(ref _FixedCameraPutStatus, value); }
- }
- private PlcAddress _FixedCameracheckStatus = new PlcAddress();
- /// <summary>
- /// 固定相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
- /// </summary>
- public PlcAddress Out_FixedCameracheckStatus
- {
- get { return _FixedCameracheckStatus; }
- set { SetProperty(ref _FixedCameracheckStatus, value); }
- }
- private PlcAddress _FzCameraPickStatus = new PlcAddress();
- /// <summary>
- /// 固定相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
- /// </summary>
- public PlcAddress Out_FzCameraPickStatus
- {
- get { return _FzCameraPickStatus; }
- set { SetProperty(ref _FzCameraPickStatus, value); }
- }
- private PlcAddress _Out_CameraDone = new PlcAddress();
- /// <summary>
- /// 相机坐标拟合完成
- /// </summary>
- public PlcAddress Out_CameraDone
- {
- get { return _Out_CameraDone; }
- set { SetProperty(ref _Out_CameraDone, value); }
- }
- private PlcAddress _MesStatus = new PlcAddress();
- /// <summary>
- /// 过站信息 =1 允许工作 =2 本站放行 =3 数据上传完成
- /// </summary>
- public PlcAddress Out_MesStatus
- {
- get { return _MesStatus; }
- set { SetProperty(ref _MesStatus, value); }
- }
- private PlcAddress _QrCodePhotoResault = new PlcAddress();
- /// <summary>
- /// pc发送二维码拍照点位成功后 =1 失败=2 未执行=0
- /// </summary>
- public PlcAddress Out_QrCodePhotoResault
- {
- get { return _QrCodePhotoResault; }
- set { SetProperty(ref _QrCodePhotoResault, value); }
- }
- private PlcPointAddress _PickCamera = new PlcPointAddress();
- /// <summary>
- /// 取料拍照点位参数
- /// </summary>
- public PlcPointAddress Out_PickCamera
- {
- get { return _PickCamera; }
- set { SetProperty(ref _PickCamera, value); }
- }
- private PlcPointAddress _Pick = new PlcPointAddress();
- /// <summary>
- /// 取料点位参数
- /// </summary>
- public PlcPointAddress Out_Pick
- {
- get { return _Pick; }
- set { SetProperty(ref _Pick, value); }
- }
- private PlcPointAddress _SecPosCamera = new PlcPointAddress();
- /// <summary>
- /// 下相机二次定位点位参数
- /// </summary>
- public PlcPointAddress Out_SecPosCamera
- {
- get { return _SecPosCamera; }
- set { SetProperty(ref _SecPosCamera, value); }
- }
- private PlcPointAddress _ScrewCamera = new PlcPointAddress();
- /// <summary>
- /// 锁附拍照点位参数
- /// </summary>
- public PlcPointAddress Out_ScrewCamera
- {
- get { return _ScrewCamera; }
- set { SetProperty(ref _ScrewCamera, value); }
- }
- private PlcPointAddress _Screw = new PlcPointAddress();
- /// <summary>
- /// 锁附点位参数
- /// </summary>
- public PlcPointAddress Out_Screw
- {
- get { return _Screw; }
- set { SetProperty(ref _Screw, value); }
- }
- private PlcPointAddress _CheckCamera = new PlcPointAddress();
- /// <summary>
- /// 复检点位参数
- /// </summary>
- public PlcPointAddress Out_CheckCamera
- {
- get { return _CheckCamera; }
- set { SetProperty(ref _CheckCamera, value); }
- }
- private PlcAddress _Out_ScrewTeachNum;
- /// <summary>
- /// 披头矫正的模式,1:初始化时矫正,2:每个产品矫正一次,3:每颗螺丝矫正一次
- /// </summary>
- public PlcAddress Out_ScrewTeachNum
- {
- get { return _Out_ScrewTeachNum; }
- set { SetProperty(ref _Out_ScrewTeachNum, value); }
- }
- private PlcPointAddress _QrCodeCamera = new PlcPointAddress();
- /// <summary>
- /// 二维码拍照点位参数
- /// </summary>
- public PlcPointAddress Out_QrCodeCamera
- {
- get { return _QrCodeCamera; }
- set { SetProperty(ref _QrCodeCamera, value); }
- }
- private PlcPointAddress _HotMelt = new PlcPointAddress();
- /// <summary>
- /// 二维码拍照点位参数
- /// </summary>
- public PlcPointAddress Out_HotMelt
- {
- get { return _HotMelt; }
- set { SetProperty(ref _HotMelt, value); }
- }
- private PlcAddress _Out_ScrewTeachOk;
- /// <summary>
- /// 下相机矫正披头的结果,1:OK,2:NG
- /// </summary>
- public PlcAddress Out_ScrewTeachOk
- {
- get { return _Out_ScrewTeachOk; }
- set { SetProperty(ref _Out_ScrewTeachOk, value); }
- }
- private PlcAddress _Out_ScrewFeederIsChanged;
- /// <summary>
- /// 螺丝供料器发生改变
- /// </summary>
- public PlcAddress Out_ScrewFeederIsChanged
- {
- get { return _Out_ScrewFeederIsChanged; }
- set { SetProperty(ref _Out_ScrewFeederIsChanged, value); }
- }
- private PlcAddress _Check_Screw;
- /// <summary>
- /// 点检扭力 电批正转
- /// </summary>
- public PlcAddress Check_ScrewTorque
- {
- get { return _Check_Screw; }
- set { SetProperty(ref _Check_Screw, value); }
- }
- private PlcAddress _Screw_OK;
- public PlcAddress Screw_OK
- {
- get { return _Screw_OK; }
- set { SetProperty(ref _Screw_OK, value); }
- }
- private PlcAddress _Screw_NG;
- public PlcAddress Screw_NG
- {
- get { return _Screw_NG; }
- set { SetProperty(ref _Screw_NG, value); }
- }
- private PlcAddress _OP_AutoManual;
- /// <summary>
- /// PLC手动模式与自动模式切换
- /// </summary>
- public PlcAddress OP_AutoManual
- {
- get { return _OP_AutoManual; }
- set { _OP_AutoManual = value; }
- }
- private PlcAddress _ManuToHome;
- /// <summary>
- /// 关闭真空
- /// </summary>
- public PlcAddress ManuToHome
- {
- get { return _ManuToHome; }
- set { _ManuToHome = value; }
- }
- private PlcAddress _ManuTOWork;
- /// <summary>
- /// 打开真空
- /// </summary>
- public PlcAddress ManuTOWork
- {
- get { return _ManuTOWork; }
- set { _ManuTOWork = value; }
- }
- private PlcAddress _InWork;
- /// <summary>
- /// 真空关闭反馈
- /// </summary>
- public PlcAddress InWork
- {
- get { return _InWork; }
- set { _InWork = value; }
- }
- private PlcAddress _Screw_Backward;
- /// <summary>
- /// 电批反转 需要一直给true
- /// </summary>
- public PlcAddress Screw_Backward
- {
- get { return _Screw_Backward; }
- set { _Screw_Backward = value; }
- }
- private PlcAddress _Manu_XAxis_Velocity;
- /// <summary>
- /// 设置X轴速度
- /// </summary>
- public PlcAddress Manu_XAxis_Velocity
- {
- get { return _Manu_XAxis_Velocity; }
- set { _Manu_XAxis_Velocity = value; }
- }
- private PlcAddress _Manu_YAxis_Velocity;
- /// <summary>
- /// 设置Y轴速度
- /// </summary>
- public PlcAddress Manu_YAxis_Velocity
- {
- get { return _Manu_YAxis_Velocity; }
- set { _Manu_YAxis_Velocity = value; }
- }
- private PlcAddress _Manu_ZAxis_Velocity;
- /// <summary>
- /// 设置Z轴速度
- /// </summary>
- public PlcAddress Manu_ZAxis_Velocity
- {
- get { return _Manu_ZAxis_Velocity; }
- set { _Manu_ZAxis_Velocity = value; }
- }
- #endregion
- #region 从PLC读取的地址
- private PlcAddress _In_Code = new PlcAddress();
- /// <summary>
- /// 产品编码
- /// </summary>
- public PlcAddress In_Code
- {
- get { return _In_Code; }
- set { SetProperty(ref _In_Code, value); }
- }
- private PlcAddress _Cam_code_mode;
- public PlcAddress Cam_code_mode
- {
- get { return _Cam_code_mode; }
- set { SetProperty(ref _Cam_code_mode, value); }
- }
- private PlcAddress _In_MesCheck = new PlcAddress();
- /// <summary>
- /// Mes交互 =1 获取过站信息当站是否生产,=2 上传本站数据
- /// </summary>
- public PlcAddress In_MesCheck
- {
- get { return _In_MesCheck; }
- set { SetProperty(ref _In_MesCheck, value); }
- }
- private PlcAddress _In_Result = new PlcAddress();
- /// <summary>
- /// 产品的最终结果
- /// </summary>
- public PlcAddress In_Result
- {
- get { return _In_Result; }
- set { SetProperty(ref _In_Result, value); }
- }
- private PlcAddress _In_DowmCameraNum = new PlcAddress();
- /// <summary>
- /// 下相机拍照编号
- /// </summary>
- public PlcAddress In_DowmCameraNum
- {
- get { return _In_DowmCameraNum; }
- set { SetProperty(ref _In_DowmCameraNum, value); }
- }
- private PlcAddress _In_DowmCameraExe = new PlcAddress();
- /// <summary>
- /// 下相机拍照触发
- /// </summary>
- public PlcAddress In_DowmCameraExe
- {
- get { return _In_DowmCameraExe; }
- set { SetProperty(ref _In_DowmCameraExe, value); }
- }
- private PlcAddress _In_UpCameraPickNum = new PlcAddress();
- /// <summary>
- /// 上相机取料拍照编号
- /// </summary>
- public PlcAddress In_UpCameraPickNum
- {
- get { return _In_UpCameraPickNum; }
- set { SetProperty(ref _In_UpCameraPickNum, value); }
- }
- private PlcAddress _In_UpCameraPickExe = new PlcAddress();
- /// <summary>
- /// 上相机取料拍照触发
- /// </summary>
- public PlcAddress In_UpCameraPickExe
- {
- get { return _In_UpCameraPickExe; }
- set { SetProperty(ref _In_UpCameraPickExe, value); }
- }
- private PlcAddress _In_UpCameraPutNum = new PlcAddress();
- /// <summary>
- /// 上相机锁附/组装拍照编号
- /// </summary>
- public PlcAddress In_UpCameraPutNum
- {
- get { return _In_UpCameraPutNum; }
- set { SetProperty(ref _In_UpCameraPutNum, value); }
- }
- private PlcAddress _In_UpCameraPutExe = new PlcAddress();
- /// <summary>
- /// 上相机锁附/组装拍照触发
- /// </summary>
- public PlcAddress In_UpCameraPutExe
- {
- get { return _In_UpCameraPutExe; }
- set { SetProperty(ref _In_UpCameraPutExe, value); }
- }
- private PlcAddress _In_UPCameracheckNum = new PlcAddress();
- /// <summary>
- /// 上相机检测拍照编号
- /// </summary>
- public PlcAddress In_UPCameracheckNum
- {
- get { return _In_UPCameracheckNum; }
- set { SetProperty(ref _In_UPCameracheckNum, value); }
- }
- private PlcAddress _In_UPCameracheckExe = new PlcAddress();
- /// <summary>
- /// 上相机检测拍照触发
- /// </summary>
- public PlcAddress In_UPCameracheckExe
- {
- get { return _In_UPCameracheckExe; }
- set { SetProperty(ref _In_UPCameracheckExe, value); }
- }
- private PlcAddress _In_FixedCameraPickNum = new PlcAddress();
- /// <summary>
- /// 固定相机取料拍照编号
- /// </summary>
- public PlcAddress In_FixedCameraPickNum
- {
- get { return _In_FixedCameraPickNum; }
- set { SetProperty(ref _In_FixedCameraPickNum, value); }
- }
- private PlcAddress _In_FixedCameraPickExe = new PlcAddress();
- /// <summary>
- /// 固定相机取料拍照触发
- /// </summary>
- public PlcAddress In_FixedCameraPickExe
- {
- get { return _In_FixedCameraPickExe; }
- set { SetProperty(ref _In_FixedCameraPickExe, value); }
- }
- private PlcAddress _In_FixedCameraPutNum = new PlcAddress();
- /// <summary>
- /// 固定相机锁附/组装拍照编号
- /// </summary>
- public PlcAddress In_FixedCameraPutNum
- {
- get { return _In_FixedCameraPutNum; }
- set { SetProperty(ref _In_FixedCameraPutNum, value); }
- }
- private PlcAddress _In_FixedCameraPutExe = new PlcAddress();
- /// <summary>
- /// 固定相机锁附/组装拍照触发
- /// </summary>
- public PlcAddress In_FixedCameraPutExe
- {
- get { return _In_FixedCameraPutExe; }
- set { SetProperty(ref _In_FixedCameraPutExe, value); }
- }
- private PlcAddress _In_FixedCameracheckNum = new PlcAddress();
- /// <summary>
- /// 固定相机检测拍照编号
- /// </summary>
- public PlcAddress In_FixedCameracheckNum
- {
- get { return _In_FixedCameracheckNum; }
- set { SetProperty(ref _In_FixedCameracheckNum, value); }
- }
- private PlcAddress _In_FixedCameracheckExe = new PlcAddress();
- /// <summary>
- /// 固定相机检测拍照触发
- /// </summary>
- public PlcAddress In_FixedCameracheckExe
- {
- get { return _In_FixedCameracheckExe; }
- set { SetProperty(ref _In_FixedCameracheckExe, value); }
- }
- private PlcAddress _In_QrCodePhotoRequest = new PlcAddress();
- /// <summary>
- /// 二维码拍照请求
- /// </summary>
- public PlcAddress In_QrCodePhotoRequest
- {
- get { return _In_QrCodePhotoRequest; }
- set { SetProperty(ref _In_QrCodePhotoRequest, value); }
- }
- private PlcAddress _In_ProductNum = new PlcAddress();
- /// <summary>
- /// 正在锁附/组装编号
- /// </summary>
- public PlcAddress In_ProductNum
- {
- get { return _In_ProductNum; }
- set { SetProperty(ref _In_ProductNum, value); }
- }
- private PlcAddress _In_RequestPosition = new PlcAddress();
- /// <summary>
- /// 请求目标位置
- /// </summary>
- public PlcAddress In_RequestPosition
- {
- get { return _In_RequestPosition; }
- set { SetProperty(ref _In_RequestPosition, value); }
- }
- private PlcAddress _In_WorkStart = new PlcAddress();
- /// <summary>
- /// 锁附/组装开始 =1
- /// </summary>
- public PlcAddress In_WorkStart
- {
- get { return _In_WorkStart; }
- set { SetProperty(ref _In_WorkStart, value); }
- }
- private PlcAddress _In_WorkDone = new PlcAddress();
- /// <summary>
- /// 锁附/组装结束 =1OK =2NG
- /// </summary>
- public PlcAddress In_WorkDone
- {
- get { return _In_WorkDone; }
- set { SetProperty(ref _In_WorkDone, value); }
- }
- private PlcAddress _In_PressureValue = new PlcAddress();
- /// <summary>
- /// 压力值
- /// </summary>
- public PlcAddress In_PressureValue
- {
- get { return _In_PressureValue; }
- set { SetProperty(ref _In_PressureValue, value); }
- }
- private PlcAddress _In_ScrewTeachExe;
- /// <summary>
- /// 触发披头视觉矫正
- /// </summary>
- public PlcAddress In_ScrewTeachExe
- {
- get { return _In_ScrewTeachExe; }
- set { SetProperty(ref _In_ScrewTeachExe, value); }
- }
- private PlcAddress _In_PickINC;
- /// <summary>
- /// 取一颗螺丝出发信号
- /// </summary>
- public PlcAddress In_PickINC
- {
- get { return _In_PickINC; }
- set { SetProperty(ref _In_PickINC, value); }
- }
- private PlcAddress _ScrewProvide1;
- /// <summary>
- /// 螺丝供料器1到位信号
- /// </summary>
- public PlcAddress ScrewProvide1
- {
- get { return _ScrewProvide1; }
- set { _ScrewProvide1 = value; }
- }
- private PlcAddress _ScrewProvide2;
- /// <summary>
- /// 螺丝供料器1到位信号
- /// </summary>
- public PlcAddress ScrewProvide2
- {
- get { return _ScrewProvide2; }
- set { _ScrewProvide2 = value; }
- }
- private PlcAddress _In_Throw;
- /// <summary>
- /// 抛料信号
- /// </summary>
- public PlcAddress In_Throw
- {
- get { return _In_Throw; }
- set { SetProperty(ref _In_Throw, value); }
- }
- private PlcAddress _RunMode;
- /// <summary>
- /// 自动运行模式
- /// </summary>
- public PlcAddress RunMode
- {
- get { return _RunMode; }
- set { SetProperty(ref _RunMode, value); }
- }
- private PlcAddress _AutoRunning;
- public PlcAddress AutoRunning
- {
- get { return _AutoRunning; }
- set { SetProperty(ref _AutoRunning, value); }
- }
- /// <summary>
- /// 维修模式
- /// </summary>
- private PlcAddress _ManualMode;
- public PlcAddress ManualMode
- {
- get { return _ManualMode; }
- set { SetProperty(ref _ManualMode, value); }
- }
- private PlcAddress _ClearMode;
- /// <summary>
- /// 流线模式
- /// </summary>
- public PlcAddress ClearMode
- {
- get { return _ClearMode; }
- set { SetProperty(ref _ClearMode, value); }
- }
- private PlcAddress _Fault;
- /// <summary>
- /// 报警
- /// </summary>
- public PlcAddress Fault
- {
- get { return _Fault; }
- set { SetProperty(ref _Fault, value); }
- }
- private PlcAddress _In_FzCameraPixExe = new PlcAddress();
- /// <summary>
- /// 翻转相机触发拍照
- /// </summary>
- public PlcAddress In_FzCameraPixExe
- {
- get { return _In_FzCameraPixExe; }
- set { SetProperty(ref _In_FzCameraPixExe, value); }
- }
- private PlcHotMeltAddress _HotMeltTempPre;
- /// <summary>
- /// 热熔压力和温度地址
- /// </summary>
- public PlcHotMeltAddress HotMeltTempPre
- {
- get { return _HotMeltTempPre; }
- set { SetProperty(ref _HotMeltTempPre, value); }
- }
- #endregion
- public PlcAddressConfig()
- {
- }
- // 初始默认值
- public void SetDefaultValue()
- {
- // 1. PlcNo 默认
- PlcNo = 1;
- // 辅助局部函数:确保 PlcAddress 实例存在
- PlcAddress Ensure(PlcAddress a)
- {
- if (a == null) return new PlcAddress();
- return a;
- }
- // 辅助局部函数:确保 PlcPointAddress 实例存在
- PlcPointAddress EnsurePoint(PlcPointAddress p)
- {
- if (p == null) return new PlcPointAddress();
- return p;
- }
- // 2. 按 JSON 提供的数据设置默认值(以当前属性名为准)
- Out_ProductLoadMode = Ensure(Out_ProductLoadMode);
- Out_ProductLoadMode.Address = "ns=4;s=DB_Communication|FromPC.ProductLoadMode";
- Out_ProductLoadMode.DataType = "int16";
- Out_ProductLoadMode.Description = "产品切换类型";
- Out_WorkMode = Ensure(Out_WorkMode);
- Out_WorkMode.Address = "ns=4;s=DB_Communication|FromPC.WorkMode";
- Out_WorkMode.DataType = "int16";
- Out_WorkMode.Description = Lang.工作模式1拍1打12拍1打所有;
- Out_PickPointNum = Ensure(Out_PickPointNum);
- Out_PickPointNum.Address = "ns=4;s=DB_Communication|FromPC.PickPointNum";
- Out_PickPointNum.DataType = "int16";
- Out_PickPointNum.Description = Lang.取料位置0不需要取料1需要取料;
- Out_DowmCameraNum = Ensure(Out_DowmCameraNum);
- Out_DowmCameraNum.Address = "ns=4;s=DB_Communication|FromPC.DowmCameraNum";
- Out_DowmCameraNum.DataType = "int16";
- Out_DowmCameraNum.Description = Lang.下相机拍照次数0无;
- Out_UpCameraPickNum = Ensure(Out_UpCameraPickNum);
- Out_UpCameraPickNum.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPickNum";
- Out_UpCameraPickNum.DataType = "int16";
- Out_UpCameraPickNum.Description = Lang.上相机取料拍照次数0无;
- Out_UpCameraPutNum = Ensure(Out_UpCameraPutNum);
- Out_UpCameraPutNum.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPutNum";
- Out_UpCameraPutNum.DataType = "int16";
- Out_UpCameraPutNum.Description = Lang.上相机放料拍照次数0无;
- Out_UPCameracheckNum = Ensure(Out_UPCameracheckNum);
- Out_UPCameracheckNum.Address = "ns=4;s=DB_Communication|FromPC.UPCameracheckNum";
- Out_UPCameracheckNum.DataType = "int16";
- Out_UPCameracheckNum.Description = Lang.上相机锁附组装次数0无;
- Out_FixedCameraPickNum = Ensure(Out_FixedCameraPickNum);
- Out_FixedCameraPickNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPickNum";
- Out_FixedCameraPickNum.DataType = "int16";
- Out_FixedCameraPickNum.Description = Lang.取料固定位置拍产品相机数量0无;
- Out_FixedCameraPutNum = Ensure(Out_FixedCameraPutNum);
- Out_FixedCameraPutNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPutNum";
- Out_FixedCameraPutNum.DataType = "int16";
- Out_FixedCameraPutNum.Description = Lang.锁附组装固定位置拍产品相机数量0无;
- Out_FixedCameracheckNum = Ensure(Out_FixedCameracheckNum);
- Out_FixedCameracheckNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameracheckNum";
- Out_FixedCameracheckNum.DataType = "int16";
- Out_FixedCameracheckNum.Description = Lang.固定相机检测锁附组装次数0无;
- Out_PickCamera = EnsurePoint(Out_PickCamera);
- // 3. 为其余 Out_* 设置合理默认(基于注释)
- Out_WorkNum = Ensure(Out_WorkNum);
- Out_WorkNum.Address = "ns=4;s=DB_Communication|FromPC.WorkNum";
- Out_WorkNum.DataType = "int16";
- Out_WorkNum.Description = Lang.锁附组装数量;
- Out_DownCameraStatus = Ensure(Out_DownCameraStatus);
- Out_DownCameraStatus.Address = "ns=4;s=DB_Communication|FromPC.DownCameraStatus";
- Out_DownCameraStatus.DataType = "int16";
- Out_DownCameraStatus.Description = Lang.下相机拍照结果1拍照OK2拍照NG3取图拍照OK;
- Out_UpCameraPickStatus = Ensure(Out_UpCameraPickStatus);
- Out_UpCameraPickStatus.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPickStatus";
- Out_UpCameraPickStatus.DataType = "int16";
- Out_UpCameraPickStatus.Description = Lang.上相机取料拍照结果1拍照OK2拍照NG3取图拍照OK;
- Out_UpCameraPutStatus = Ensure(Out_UpCameraPutStatus);
- Out_UpCameraPutStatus.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPutStatus";
- Out_UpCameraPutStatus.DataType = "int16";
- Out_UpCameraPutStatus.Description = Lang.上相机锁附组装拍照结果1拍照OK2拍照NG3取图拍照OK;
- Out_UPCameracheckStatus = Ensure(Out_UPCameracheckStatus);
- Out_UPCameracheckStatus.Address = "ns=4;s=DB_Communication|FromPC.UPCameracheckStatus";
- Out_UPCameracheckStatus.DataType = "int16";
- Out_UPCameracheckStatus.Description = Lang.上相机检测拍照结果1拍照OK2拍照NG3取图拍照OK;
- Out_FixedCameraPickStatus = Ensure(Out_FixedCameraPickStatus);
- Out_FixedCameraPickStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPickStatus";
- Out_FixedCameraPickStatus.DataType = "int16";
- Out_FixedCameraPickStatus.Description = Lang.固定相机取料拍照结果1拍照OK2拍照NG3取图拍照OK;
- Out_FixedCameraPutStatus = Ensure(Out_FixedCameraPutStatus);
- Out_FixedCameraPutStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPutStatus";
- Out_FixedCameraPutStatus.DataType = "int16";
- Out_FixedCameraPutStatus.Description = Lang.固定相机锁附组装拍照结果1拍照OK2拍照NG3取图拍照OK;
- Out_FixedCameracheckStatus = Ensure(Out_FixedCameracheckStatus);
- Out_FixedCameracheckStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameracheckStatus";
- Out_FixedCameracheckStatus.DataType = "int16";
- Out_FixedCameracheckStatus.Description = Lang.固定相机检测拍照结果1拍照OK2拍照NG3取图拍照OK;
- Out_CameraDone = Ensure(Out_CameraDone);
- Out_CameraDone.Address = "ns=4;s=DB_Communication|FromPC.CameraDone";
- Out_CameraDone.DataType = "int16";
- Out_CameraDone.Description = Lang.相机坐标拟合完成;
- Out_MesStatus = Ensure(Out_MesStatus);
- Out_MesStatus.Address = "ns=4;s=DB_Communication|FromPC.MesStatus[{0}]";
- Out_MesStatus.DataType = "int16";
- Out_MesStatus.Description = Lang.过站信息1允许工作2本站放行3数据上传完成;
- Out_QrCodePhotoResault = Ensure(Out_QrCodePhotoResault);
- Out_QrCodePhotoResault.Address = "ns=4;s=DB_Communication|FromPC.photo_dwon";
- Out_QrCodePhotoResault.DataType = "int16";
- Out_QrCodePhotoResault.Description = "pc发送二维码拍照点位 1=成功 2=失败";
- Check_ScrewTorque = Ensure(Check_ScrewTorque);
- Check_ScrewTorque.Address = "ns=4;s=DB_DriveControl|ScrewCtrl[1].Cmd.ManuStart";
- Check_ScrewTorque.DataType = "Bool";
- Check_ScrewTorque.Description = "电批正转";
- Out_FzCameraPickStatus = Ensure(Out_FzCameraPickStatus);
- Out_FzCameraPickStatus.Address = "ns=4;s=DB_Communication|FromPC.FzCameraPickStatus";
- Out_FzCameraPickStatus.DataType = "int16";
- Out_FzCameraPickStatus.Description = "翻转相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
- //首先到废料桶上方投料
- //有三个示教的地方
- //
- //Machine.OP_AutoManual ns=4;s=DB_Control|Machine.OP_AutoManual 手自动 都是bool
- //ns=4;s=DB_DriveControl|VacCtrl[1].Cmd.ManuToHome 关闭真空 只需要给true就行
- //ns=4;s=DB_DriveControl|VacCtrl[1].Cmd.ManuTOWork 打开真空 只需要给true就行
- //ns=4;s=DB_DriveControl|VacCtrl[1].Status.InWork 真空到位反馈 吸到料
- //ns=4;s=DB_DriveControl|ScrewCtrl[1].Cmd.ManuBackward 电批反转
- //ns=4;s=DB_DriveControl|AxisCtrl[1].Parm.ManuVelocity Manu_Axis_Velocity
- Manu_XAxis_Velocity = Ensure(Manu_XAxis_Velocity);
- Manu_XAxis_Velocity.Address = "ns=4;s=DB_DriveControl|AxisCtrl[1].Parm.ManuVelocity";
- Manu_XAxis_Velocity.DataType = "Float";
- Manu_XAxis_Velocity.Description = "手动设置X轴速度";
- Manu_YAxis_Velocity = Ensure(Manu_YAxis_Velocity);
- Manu_YAxis_Velocity.Address = "ns=4;s=DB_DriveControl|AxisCtrl[2].Parm.ManuVelocity";
- Manu_YAxis_Velocity.DataType = "Float";
- Manu_YAxis_Velocity.Description = "手动设置Y轴速度";
- Manu_ZAxis_Velocity = Ensure(Manu_ZAxis_Velocity);
- Manu_ZAxis_Velocity.Address = "ns=4;s=DB_DriveControl|AxisCtrl[3].Parm.ManuVelocity";
- Manu_ZAxis_Velocity.DataType = "Float";
- Manu_ZAxis_Velocity.Description = "手动设置Z轴速度";
- OP_AutoManual = Ensure(OP_AutoManual);
- OP_AutoManual.Address = "ns=4;s=DB_Control|Machine.OP_AutoManual";
- OP_AutoManual.DataType = "Bool";
- OP_AutoManual.Description = "手自动切换";
- ManuToHome = Ensure(ManuToHome);
- ManuToHome.Address = "ns=4;s=DB_DriveControl|VacCtrl[1].Cmd.ManuToHome";
- ManuToHome.DataType = "Bool";
- ManuToHome.Description = "关闭真空";
- ManuTOWork = Ensure(ManuTOWork);
- ManuTOWork.Address = "ns=4;s=DB_DriveControl|VacCtrl[1].Cmd.ManuToWork";
- ManuTOWork.DataType = "Bool";
- ManuTOWork.Description = "打开真空";
- InWork = Ensure(InWork);
- InWork.Address = "ns=4;s=DB_DriveControl|VacCtrl[1].Status.InWork";
- InWork.DataType = "Bool";
- InWork.Description = "真空到位反馈";
- Screw_OK = Ensure(Screw_OK);
- Screw_OK.Address = "ns=4;s=DB_DriveControl|ScrewCtrl[1].Status.OK";
- Screw_OK.DataType = "Bool";
- Screw_OK.Description = "电批OK";
- Screw_NG = Ensure(Screw_NG);
- Screw_NG.Address = "ns=4;s=DB_DriveControl|ScrewCtrl[1].Status.NG";
- Screw_NG.DataType = "Bool";
- Screw_NG.Description = "电批NG";
- Screw_Backward = Ensure(Screw_Backward);
- Screw_Backward.Address = "ns=4;s=DB_DriveControl|ScrewCtrl[1].Cmd.ManuBackward";
- Screw_Backward.DataType = "Bool";
- Screw_Backward.Description = "电批反转";
- // Out_PickCamera 初始化并赋地址
- Out_PickCamera = EnsurePoint(Out_PickCamera);
- Out_PickCamera.Description = Lang.取料拍照点位参数;
- Out_PickCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].X_Position";
- Out_PickCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].X_Velocity";
- Out_PickCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Y_Position";
- Out_PickCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Y_Velocity";
- Out_PickCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Z_Position_Start";
- Out_PickCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Z_Velocity_Start";
- Out_PickCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Z_Position_Stop";
- Out_PickCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Z_Velocity_Stop";
- Out_PickCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].U_Position";
- Out_PickCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].U_Velocity";
- Out_PickCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].R_Position";
- Out_PickCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].R_Velocity";
- Out_PickCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Torque";
- Out_PickCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].Feeder";
- Out_PickCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_PickCamera[{0}].ScrewProNum";
- // Out_Pick(取料点位)初始化并赋地址
- Out_Pick = EnsurePoint(Out_Pick);
- Out_Pick.Description = Lang.取料点位参数;
- Out_Pick.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].X_Position";
- Out_Pick.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].X_Velocity";
- Out_Pick.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Y_Position";
- Out_Pick.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Y_Velocity";
- Out_Pick.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Z_Position_Start";
- Out_Pick.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Z_Velocity_Start";
- Out_Pick.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Z_Position_Stop";
- Out_Pick.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Z_Velocity_Stop";
- Out_Pick.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].U_Position";
- Out_Pick.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].U_Velocity";
- Out_Pick.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].R_Position";
- Out_Pick.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].R_Velocity";
- Out_Pick.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Torque";
- Out_Pick.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].Feeder";
- Out_Pick.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_Pick[{0}].ScrewProNum";
- // Out_SecPosCamera(下相机二次定位)初始化并赋地址
- Out_SecPosCamera = EnsurePoint(Out_SecPosCamera);
- Out_SecPosCamera.Description = Lang.下相机二次定位点位参数;
- Out_SecPosCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].X_Position";
- Out_SecPosCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].X_Velocity";
- Out_SecPosCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Y_Position";
- Out_SecPosCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Y_Velocity";
- Out_SecPosCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Z_Position_Start";
- Out_SecPosCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Z_Velocity_Start";
- Out_SecPosCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Z_Position_Stop";
- Out_SecPosCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Z_Velocity_Stop";
- Out_SecPosCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].U_Position";
- Out_SecPosCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].U_Velocity";
- Out_SecPosCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].R_Position";
- Out_SecPosCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].R_Velocity";
- Out_SecPosCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Torque";
- Out_SecPosCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].Feeder";
- Out_SecPosCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_SecPosCamera[{0}].ScrewProNum";
- // Out_ScrewCamera(锁附拍照点位)初始化并赋地址
- Out_ScrewCamera = EnsurePoint(Out_ScrewCamera);
- Out_ScrewCamera.Description = Lang.锁附拍照点位参数;
- Out_ScrewCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].X_Position";
- Out_ScrewCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].X_Velocity";
- Out_ScrewCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Y_Position";
- Out_ScrewCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Y_Velocity";
- Out_ScrewCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Z_Position_Start";
- Out_ScrewCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Z_Velocity_Start";
- Out_ScrewCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Z_Position_Stop";
- Out_ScrewCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Z_Velocity_Stop";
- Out_ScrewCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].U_Position";
- Out_ScrewCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].U_Velocity";
- Out_ScrewCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].R_Position";
- Out_ScrewCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].R_Velocity";
- Out_ScrewCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Torque";
- Out_ScrewCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].Feeder";
- Out_ScrewCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_ScrewCamera[{0}].ScrewProNum";
- // Out_Screw(锁附点位)初始化并赋地址
- Out_Screw = EnsurePoint(Out_Screw);
- Out_Screw.Description = Lang.锁附点位参数;
- Out_Screw.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].X_Position";
- Out_Screw.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].X_Velocity";
- Out_Screw.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Y_Position";
- Out_Screw.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Y_Velocity";
- Out_Screw.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Z_Position_Start";
- Out_Screw.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Z_Velocity_Start";
- Out_Screw.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Z_Position_Stop";
- Out_Screw.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Z_Velocity_Stop";
- Out_Screw.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].U_Position";
- Out_Screw.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].U_Velocity";
- Out_Screw.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].R_Position";
- Out_Screw.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].R_Velocity";
- Out_Screw.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Torque";
- Out_Screw.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].Feeder";
- Out_Screw.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_Screw[{0}].ScrewProNum";
- // Out_CheckCamera(复检点位)初始化并赋地址
- Out_CheckCamera = EnsurePoint(Out_CheckCamera);
- Out_CheckCamera.Description = Lang.复检点位参数;
- Out_CheckCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].X_Position";
- Out_CheckCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].X_Velocity";
- Out_CheckCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Y_Position";
- Out_CheckCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Y_Velocity";
- Out_CheckCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Z_Position_Start";
- Out_CheckCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Z_Velocity_Start";
- Out_CheckCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Z_Position_Stop";
- Out_CheckCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Z_Velocity_Stop";
- Out_CheckCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].U_Position";
- Out_CheckCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].U_Velocity";
- Out_CheckCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].R_Position";
- Out_CheckCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].R_Velocity";
- Out_CheckCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Torque";
- Out_CheckCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].Feeder";
- Out_CheckCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_CheckCamera[{0}].ScrewProNum";
- // Out_QrCodeCamera(二维码拍照点位)初始化并赋地址
- Out_QrCodeCamera = EnsurePoint(Out_QrCodeCamera);
- Out_QrCodeCamera.Description = Lang.二维码拍照点位参数;
- Out_QrCodeCamera.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].X_Position";
- Out_QrCodeCamera.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].X_Velocity";
- Out_QrCodeCamera.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].Y_Position";
- Out_QrCodeCamera.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].Y_Velocity";
- Out_QrCodeCamera.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].Z_Position_Start";
- Out_QrCodeCamera.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].Z_Velocity_Start";
- Out_QrCodeCamera.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].Z_Position_Stop";
- Out_QrCodeCamera.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].Z_Velocity_Stop";
- Out_QrCodeCamera.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].U_Position";
- Out_QrCodeCamera.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].U_Velocity";
- Out_QrCodeCamera.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].R_Position";
- Out_QrCodeCamera.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].R_Velocity";
- Out_QrCodeCamera.Torque.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].Torque";
- Out_QrCodeCamera.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].Feeder";
- Out_QrCodeCamera.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Photo_Positipn[{0}].ScrewProNum";
- // Out_HotMelt(热熔点位)初始化并赋地址
- Out_HotMelt = EnsurePoint(Out_HotMelt);
- Out_HotMelt.Description = "热熔点位参数";
- Out_HotMelt.X_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].X_Position";
- Out_HotMelt.X_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].X_Velocity";
- Out_HotMelt.Y_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].Y_Position";
- Out_HotMelt.Y_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].Y_Velocity";
- Out_HotMelt.Z_Position_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].Z_Position_Start";
- Out_HotMelt.Z_Velocity_Start.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].Z_Velocity_Start";
- Out_HotMelt.Z_Position_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].Z_Position_Stop";
- Out_HotMelt.Z_Velocity_Stop.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].Z_Velocity_Stop";
- Out_HotMelt.U_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].U_Position";
- Out_HotMelt.U_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].U_Velocity";
- Out_HotMelt.R_Position.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].R_Position";
- Out_HotMelt.R_Velocity.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].R_Velocity";
- Out_HotMelt.Torque.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].Torque";
- Out_HotMelt.Feeder.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].Feeder";
- Out_HotMelt.ScrewProNum.Address = "ns=4;s=DB_Communication|FromPC.Point_HotMelt[{0}].ScrewProNum";
- HotMeltTempPre = new PlcHotMeltAddress();
- HotMeltTempPre.Description = "热熔温度压力地址";
- HotMeltTempPre.Shield.Address = "ns=4;s=Auto|Temperature.Shield";
- HotMeltTempPre.Wright_Exe.Address = "ns=4;s=Auto|Temperature.Wright_Exe";
- HotMeltTempPre.CurentTemperature.Address = "ns=4;s=Auto|Temperature.Read[0]";
- HotMeltTempPre.DesTemperature.Address = "ns=4;s=Auto|Temperature.Read[1]";
- HotMeltTempPre.StartTemperature.Address = "ns=4;s=Auto|Temperature.Read[3]";
- HotMeltTempPre.StopTemperature.Address = "ns=4;s=Auto|Temperature.Read[4]";
- HotMeltTempPre.WriteTemperature.Address = "ns=4;s=Auto|Temperature.Wright[0]";
- HotMeltTempPre.CurentPressureN.Address = "ns=4;s=Auto|Pressure.User";
- HotMeltTempPre.CurentPressureKg.Address = "ns=4;s=Auto|Pressure.User_KG";
- HotMeltTempPre.SetPressure.Address = "ns=4;s=Auto|Pressure.DataMax";
- HotMeltTempPre.MaxPressure.Address = "ns=4;s=Auto|Pressure.UserMin";
- HotMeltTempPre.MinPressure.Address = "ns=4;s=Auto|Pressure.UserMax";
- HotMeltTempPre.StopPressureN.Address = "ns=4;s=Auto|Pressure.UserData";
- HotMeltTempPre.StopPressureKg.Address = "ns=4;s=Auto|Pressure.UserData_KG";
- HotMeltTempPre.StableTime.Address = "ns=4;s=Auto|Pressure.Time";
- Out_ScrewTeachNum = Ensure(Out_ScrewTeachNum);
- Out_ScrewTeachNum.Address = "ns=4;s=DB_Communication|FromPC.ScrewTeachNum";
- Out_ScrewTeachNum.DataType = "int16";
- Out_ScrewTeachNum.Description = Lang.披头矫正的模式1初始化时矫正2每个产品矫正一次3每颗螺丝矫正一次;
- Out_ScrewTeachOk = Ensure(Out_ScrewTeachOk);
- Out_ScrewTeachOk.Address = "ns=4;s=DB_Communication|FromPC.ScrewTeachOK";
- Out_ScrewTeachOk.DataType = "int16";
- Out_ScrewTeachOk.Description = Lang.下相机矫正披头的结果1OK2NG;
- Out_ScrewFeederIsChanged = Ensure(Out_ScrewFeederIsChanged);
- Out_ScrewFeederIsChanged.Address = "ns=4;s=DB_Communication|FromPC.PickNumChange";
- Out_ScrewFeederIsChanged.DataType = "int16";
- Out_ScrewFeederIsChanged.Description = Lang.供料器发生改变;
- // 4. In_* 默认(假定从 PLC 读到 PC,使用 ToPC 前缀)
- In_Code = Ensure(In_Code);
- In_Code.Address = "ns=4;s=DB_Communication|FromPC.Code";
- In_Code.DataType = "string";
- In_Code.Description = Lang.产品编码;
- In_MesCheck = Ensure(In_MesCheck);
- In_MesCheck.Address = "ns=4;s=DB_Communication|ToPC.Mes[{0}].Check";
- In_MesCheck.DataType = "int16";
- In_MesCheck.Description = Lang.Mes交互1获取过站信息当站是否生产2上传本站数据;
- In_Result = Ensure(In_Result);
- In_Result.Address = "ns=4;s=DB_Communication|ToPC.Mes[0].Product_Status";
- In_Result.DataType = "int16";
- In_Result.Description = "产品的最终结果,1:OK; 2:NG";
- In_DowmCameraNum = Ensure(In_DowmCameraNum);
- In_DowmCameraNum.Address = "ns=4;s=DB_Communication|ToPC.DowmCameraNum";
- In_DowmCameraNum.DataType = "int16";
- In_DowmCameraNum.Description = Lang.下相机拍照编号;
- In_DowmCameraExe = Ensure(In_DowmCameraExe);
- In_DowmCameraExe.Address = "ns=4;s=DB_Communication|ToPC.DowmCameraExe";
- In_DowmCameraExe.DataType = "int16";
- In_DowmCameraExe.Description = Lang.下相机拍照触发;
- In_UpCameraPickNum = Ensure(In_UpCameraPickNum);
- In_UpCameraPickNum.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPickNum";
- In_UpCameraPickNum.DataType = "int16";
- In_UpCameraPickNum.Description = Lang.上相机取料拍照编号;
- In_UpCameraPickExe = Ensure(In_UpCameraPickExe);
- In_UpCameraPickExe.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPickExe";
- In_UpCameraPickExe.DataType = "int16";
- In_UpCameraPickExe.Description = Lang.上相机取料拍照触发;
- In_UpCameraPutNum = Ensure(In_UpCameraPutNum);
- In_UpCameraPutNum.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPutNum";
- In_UpCameraPutNum.DataType = "int16";
- In_UpCameraPutNum.Description = Lang.上相机锁附组装拍照编号;
- In_UpCameraPutExe = Ensure(In_UpCameraPutExe);
- In_UpCameraPutExe.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPutExe";
- In_UpCameraPutExe.DataType = "int16";
- In_UpCameraPutExe.Description = Lang.上相机锁附组装拍照触发;
- In_UPCameracheckNum = Ensure(In_UPCameracheckNum);
- In_UPCameracheckNum.Address = "ns=4;s=DB_Communication|ToPC.UPCameracheckNum";
- In_UPCameracheckNum.DataType = "int16";
- In_UPCameracheckNum.Description = Lang.上相机检测拍照编号;
- In_UPCameracheckExe = Ensure(In_UPCameracheckExe);
- In_UPCameracheckExe.Address = "ns=4;s=DB_Communication|ToPC.UPCameracheckExe";
- In_UPCameracheckExe.DataType = "int16";
- In_UPCameracheckExe.Description = Lang.上相机检测拍照触发;
- In_FixedCameraPickNum = Ensure(In_FixedCameraPickNum);
- In_FixedCameraPickNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPickNum";
- In_FixedCameraPickNum.DataType = "int16";
- In_FixedCameraPickNum.Description = Lang.固定相机取料拍照编号;
- In_FixedCameraPickExe = Ensure(In_FixedCameraPickExe);
- In_FixedCameraPickExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPickExe";
- In_FixedCameraPickExe.DataType = "int16";
- In_FixedCameraPickExe.Description = Lang.固定相机取料拍照触发;
- In_FixedCameraPutNum = Ensure(In_FixedCameraPutNum);
- In_FixedCameraPutNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPutNum";
- In_FixedCameraPutNum.DataType = "int16";
- In_FixedCameraPutNum.Description = Lang.固定相机锁附组装拍照编号;
- In_FixedCameraPutExe = Ensure(In_FixedCameraPutExe);
- In_FixedCameraPutExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPutExe";
- In_FixedCameraPutExe.DataType = "int16";
- In_FixedCameraPutExe.Description = Lang.固定相机锁附组装拍照触发;
- In_FixedCameracheckNum = Ensure(In_FixedCameracheckNum);
- In_FixedCameracheckNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameracheckNum";
- In_FixedCameracheckNum.DataType = "int16";
- In_FixedCameracheckNum.Description = Lang.固定相机检测拍照编号;
- In_FixedCameracheckExe = Ensure(In_FixedCameracheckExe);
- In_FixedCameracheckExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameracheckExe";
- In_FixedCameracheckExe.DataType = "int16";
- In_FixedCameracheckExe.Description = Lang.固定相机检测拍照触发;
- In_QrCodePhotoRequest = Ensure(In_QrCodePhotoRequest);
- In_QrCodePhotoRequest.Address = "ns=4;s=DB_Communication|ToPC.photo_request";
- In_QrCodePhotoRequest.DataType = "int16";
- In_QrCodePhotoRequest.Description = Lang.二维码拍照请求;
- In_ProductNum = Ensure(In_ProductNum);
- In_ProductNum.Address = "ns=4;s=DB_Communication|ToPC.ProductNum";
- In_ProductNum.DataType = "int16";
- In_ProductNum.Description = Lang.正在锁附组装编号;
- In_RequestPosition = Ensure(In_RequestPosition);
- In_RequestPosition.Address = "ns=4;s=DB_Communication|ToPC.RequestPosition";
- In_RequestPosition.DataType = "int16";
- In_RequestPosition.Description = Lang.请求目标位置;
- In_WorkStart = Ensure(In_WorkStart);
- In_WorkStart.Address = "ns=4;s=DB_Communication|ToPC.WorkStart";
- In_WorkStart.DataType = "int16";
- In_WorkStart.Description = Lang.锁附组装开始1;
- In_WorkDone = Ensure(In_WorkDone);
- In_WorkDone.Address = "ns=4;s=DB_Communication|ToPC.WorkDone";
- In_WorkDone.DataType = "int16";
- In_WorkDone.Description = Lang.锁附组装结束1OK2NG;
- In_PressureValue = Ensure(In_PressureValue);
- In_PressureValue.Address = "ns=4;s=DB_DriveControl|AICtrl[1].Status.UserData";
- In_PressureValue.DataType = "float";
- In_PressureValue.Description = Lang.压力值;
- In_ScrewTeachExe = Ensure(In_ScrewTeachExe);
- In_ScrewTeachExe.Address = "ns=4;s=DB_Communication|ToPC.ScrewTeachExe";
- In_ScrewTeachExe.DataType = "bool";
- In_ScrewTeachExe.Description = Lang.触发披头视觉矫正;
- In_PickINC = Ensure(In_PickINC);
- In_PickINC.Address = "ns=4;s=DB_Communication|ToPC.PickINC";
- In_PickINC.DataType = "int16";
- In_PickINC.Description = Lang.取一颗螺丝触发信号;
- //ns=4;s=DB_HMI|Cam_code_mode 读取plc模式 0普通读取plc寄存器的二维码询问mes 1由上位机拍照获取二维码上传mes
- Cam_code_mode = Ensure(Cam_code_mode);
- Cam_code_mode.Address = "ns=4;s=DB_HMI|Cam_code_mode";
- Cam_code_mode.DataType = "Bool";
- Cam_code_mode.Description = "PLC二维码读取模式";
- ScrewProvide1 = Ensure(ScrewProvide1);
- ScrewProvide1.Address = "ns=4;s=DB_Input|X16_螺丝供料器1螺丝到位";
- ScrewProvide1.DataType = "Bool";
- ScrewProvide1.Description = "螺丝供料器1螺丝到位";
- ScrewProvide2 = Ensure(ScrewProvide2);
- ScrewProvide2.Address = "ns=4;s=DB_Input|X17_螺丝供料器2螺丝到位";
- ScrewProvide2.DataType = "Bool";
- ScrewProvide2.Description = "螺丝供料器1螺丝到位";
- In_Throw = Ensure(In_Throw);
- In_Throw.Address = "ns=4;s=DB_Communication|Throw[0]";
- In_Throw.DataType = "Bool";
- In_Throw.Description = "抛料信号";
- RunMode = Ensure(RunMode);
- RunMode.Address = "ns=4;s=DB_Control|Mode.Status.RunMode";
- RunMode.DataType = "Bool";
- RunMode.Description = "自动运行模式";
- AutoRunning = Ensure(AutoRunning);
- AutoRunning.Address = "ns=4;s=DB_Control|Mode.Status.AutoRunning";
- AutoRunning.DataType = "Bool";
- AutoRunning.Description = "生产模式";
- ManualMode = Ensure(ManualMode);
- ManualMode.Address = "ns=4;s=DB_Control|Mode.Status.ManualMode";
- ManualMode.DataType = "Bool";
- ManualMode.Description = "维修模式";
- ClearMode = Ensure(ClearMode);
- ClearMode.Address = "ns=4;s=DB_Control|Mode.Status.ClearMode";
- ClearMode.DataType = "Bool";
- ClearMode.Description = "流线模式";
- Fault = Ensure(Fault);
- Fault.Address = "ns=4;s=DB_Control|Mode.Status.Fault";
- Fault.DataType = "Bool";
- Fault.Description = "报警";
- In_FzCameraPixExe = Ensure(In_FzCameraPixExe);
- In_FzCameraPixExe.Address = "ns=4;s=DB_Communication|ToPC.In_FzCameraPickExe";
- In_FzCameraPixExe.DataType = "Bool";
- In_FzCameraPixExe.Description = "翻转相机检测拍照触发";
- //ns=4;s=DB_Input|X16_螺丝供料器1螺丝到位
- //ns=4;s=DB_Input|X17_螺丝供料器2螺丝到位
- // 说明:若项目中 PlcAddress 的实际属性名或类型与此不同(例如使用枚举、不同字段名),
- // 请根据实际类型调整赋值。本方法主要提供合理的默认字符串地址、数据类型及描述,便于后续从配置覆盖。
- }
- }
- }
|