public bool SetMValueON(DTPlcInfoSimple p) { int value0 = 1; if (p != null && p.BelongToDataform != null) { WriteSingleMData(p.Addr, value0, p.Area, p.Mode); } ConstantMethod.DelayWriteCmdOk(Constant.XJConnectTimeOut, ref value0, ref p); if (value0 == p.ShowValue) { return(true); } else { return(false); } }
Thread CutThread; //需要引入System.Threading命名空间 public void SetEvokDevice(EvokDTDevice evokDevice0) { evokDevice = evokDevice0; if (evokDevice.DataFormLst.Count > 1 && evokDevice.DataFormLst[1].Rows.Count > 0) { psLstHand.Clear(); foreach (DataRow dr in evokDevice.DataFormLst[1].Rows) { if (dr == null) { continue; } string name = dr["bin"].ToString(); if (!string.IsNullOrWhiteSpace(name)) { DTPlcInfoSimple p = new DTPlcInfoSimple(name); psLstHand.Add(p); } } } }
public bool SetMultiPleDValue(DTPlcInfoSimple stDTPlcInfoSimple, int[] value0) { if (stDTPlcInfoSimple != null && stDTPlcInfoSimple.BelongToDataform != null) { WriteMultiPleDMData( stDTPlcInfoSimple.Addr, value0, stDTPlcInfoSimple.Area, stDTPlcInfoSimple.Mode); ConstantMethod.DelayWriteCmdOk(Constant.WriteCommTimeOut, ref value0[0], ref stDTPlcInfoSimple); //可能时间太久 要等下 if (value0[0] == stDTPlcInfoSimple.ShowValue) { return(true); } else { return(false); } } return(false); }
public void SetMValueOFF2ON(DTPlcInfoSimple p) { SetMValueOFF(p); SetMValueON(p); }