public byte[] ReadStationInfoBy90(int stationno) { CRLOPCItem ci = ItemInfo.Find( delegate(CRLOPCItem co) { return(co.groupname == "RFID" && co.length == stationno); } ); if (ci != null) { byte[] buffer = new byte[962]; byte[] byt = new byte[962]; //mPLC.Connect(); //if (mPLC.Read(ci.DBAddress, ci.start, 962, ref buffer)) if (PLCList[ci.ipaddress].Read(ci.DBAddress, ci.start, 962, ref buffer)) { Array.Copy(buffer, 0, byt, 0, 962); } //else //{ // mPLC.DisConnect(); // mPLC.Connect(); //} return(byt); } return(null); }
private void OtherInit(DataRow dt) { CRLOPCItem co = new CRLOPCItem(); co.groupname = dt["groupname"].ToString(); co.ipaddress = dt["userid"].ToString(); co.DBAddress = int.Parse(dt["objects"].ToString()); co.start = int.Parse(dt["value"].ToString()); co.length = int.Parse(dt["stationno"].ToString()); ItemInfo.Add(co); }