Пример #1
0
        /// <summary>
        /// DO读取
        /// </summary>
        /// <param name="Name"></param>
        /// <returns></returns>
        public static bool getDOState(string Name)
        {
            //读取参数
            int CardNum   = 0;
            int IoID      = 0;
            int IoType    = 0;
            int IoState   = 0;
            int ExtendNum = 0;

            mWDataToolClass.getDataDO(Name, out CardNum, out IoID, out IoType, out IoState, out ExtendNum);
            int mState = mWCardClass.getDOState(CardNum, IoID, IoType, IoState, ExtendNum);

            if (mState == 0)
            {
                return(false);
            }
            else if (mState == 1)
            {
                return(true);
            }
            else if (mState == -1)
            {
                if (MessageBox.Show("“" + Name + "”读取失败,“是”设置为有信号,“否”设置为无信号", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }