/// <summary> /// 开启PLC /// </summary> /// <param name="axActUtlType"> AxActUtlType</param> /// <param name="_StationNo"></param> /// <param name="_Password">密码</param> /// <returns></returns> public string Open(Object form, ref AxActUtlType axActUtlType, int _StationNo = 0, string _Password = "") { try { ((Form)form).Controls.Add(axActUtlType); _axActUtlType = axActUtlType; axActUtlType.ActLogicalStationNumber = _StationNo; _axActUtlType.ActPassword = _Password; int rtn = _axActUtlType.Open(); if (rtn == 0) { return("PLC连接成功"); } else { return("PLC连接失败"); } } catch (Exception) { return("PLC连接失败"); } }
public MxComponentCla(AxActUtlType aaut, string MxAddress) //构造函数 { this.aaut = aaut; this.MxAddress = MxAddress; iState = -1; }