Example #1
0
 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);
 }
Example #2
0
 public void SetMValueOFF2ON(DTPlcInfoSimple p)
 {
     SetMValueOFF(p);
     // ConstantMethod.Delay(1000);
     SetMValueON(p);
 }
Example #3
0
 public void SetMValueOFF2ON(DTPlcInfoSimple p)
 {
     SetMValueOFF(p);
     SetMValueON(p);
 }
Example #4
0
        void upScHy(DataGridView dgv, int id)
        {
            try
            {
                if (dgv == null)
                {
                    return;
                }
                for (int i = 0; i < dgv.Rows.Count; i++)
                {
                    DTPlcInfoSimple dtScLight = evokWork.getDtPlcSimple(id, Constant.scLight + (i + 1).ToString() + Constant.Read);
                    DTPlcInfoSimple dtScData  = evokWork.getDtPlcSimple(id, Constant.scData + (i + 1).ToString() + Constant.Read);

                    if (dtScLight != null)
                    {
                        #region 锁槽工位显示
                        if (dtScLight.ShowValue == 1)
                        {
                            if (dgv.Rows[i].Cells[1].Style.BackColor != Color.Red)
                            {
                                dgv.Rows[i].Cells[1].Style.BackColor = Color.Red;
                            }
                        }
                        else
                        {
                            if (dgv.Rows[i].Cells[1].Style.BackColor != Color.LightGray)
                            {
                                dgv.Rows[i].Cells[1].Style.BackColor = Color.LightGray;
                            }
                        }
                    }

                    if (dtScData != null)
                    {
                        if (dtScData.ShowValue < Constant.schyStrLst.Length)
                        {
                            if (evokWork.DtScHyShow.Rows[i][1] != null && !evokWork.DtScHyShow.Rows[i][1].ToString().Equals(Constant.schyStrLst[dtScData.ShowValue]))
                            {
                                evokWork.DtScHyShow.Rows[i][1] = Constant.schyStrLst[dtScData.ShowValue];
                            }
                            else
                            {
                                if (evokWork.DtScHyShow.Rows[i][1] != null)
                                {
                                    evokWork.DtScHyShow.Rows[i][1] = Constant.schyStrLst[dtScData.ShowValue];
                                }
                            }
                        }
                    }

                    #endregion


                    #region 合页工位显示

                    DTPlcInfoSimple dtHyLight = evokWork.getDtPlcSimple(id, Constant.hyLight + (i + 1).ToString() + Constant.Read);
                    DTPlcInfoSimple dtHyData  = evokWork.getDtPlcSimple(id, Constant.hyData + (i + 1).ToString() + Constant.Read);
                    if (dtHyLight != null)
                    {
                        if (dtHyLight.ShowValue == 1)
                        {
                            if (dgv.Rows[i].Cells[2].Style.BackColor != Color.Red)
                            {
                                dgv.Rows[i].Cells[2].Style.BackColor = Color.Red;
                            }
                        }
                        else
                        {
                            if (dgv.Rows[i].Cells[2].Style.BackColor != Color.LightGray)
                            {
                                dgv.Rows[i].Cells[2].Style.BackColor = Color.LightGray;
                            }
                        }
                    }
                    if (dtHyData != null)
                    {
                        if (dtHyData.ShowValue < Constant.schyStrLst.Length)
                        {
                            if (evokWork.DtScHyShow.Rows[i][2] != null && !evokWork.DtScHyShow.Rows[i][2].ToString().Equals(Constant.schyStrLst[dtHyData.ShowValue]))
                            {
                                evokWork.DtScHyShow.Rows[i][2] = Constant.schyStrLst[dtHyData.ShowValue];
                            }
                        }
                        else
                        {
                            if (evokWork.DtScHyShow.Rows[i][2] == null)
                            {
                                evokWork.DtScHyShow.Rows[i][2] = Constant.schyStrLst[dtHyData.ShowValue];
                            }
                        }
                    }

                    #endregion
                }
            }
            catch (Exception ex)
            {
            }
        }