Beispiel #1
0
        /// <summary>
        /// 获取单个输出点状态
        /// ArgumentOutofRange
        /// </summary>
        /// <param name="index">输出点序号,从0开始</param>
        /// <returns></returns>
        public int GetDO(int index, out bool isON)
        {
            if (index < 0 || index >= DOCount)
            {
                throw new Exception(string.Format("GetDO(index = {0}, isON) index is out of range:0~{1}", index, DOCount - 1));
            }
            isON = false;
            if (!IsOpen)
            {
                return((int)ErrorDef.NotOpen);
            }
            int val;

            val = HTM.ReadDO(doIndex[index]);
            //val = HTM.GetDO(doIndex[index]);
            isON = val != 0;
            return((int)ErrorDef.Success);
        }