Exemple #1
0
        /// <summary>
        /// 获取单个输出点状态
        /// ArgumentOutofRange
        /// </summary>
        /// <param name="index">输出点序号,从0开始</param>
        /// <returns></returns>
        public int GetAO(int index, out double volt)
        {
            if (index < 0 || index >= AOCount)
            {
                throw new Exception(string.Format("GetAO(index = {0}, isON) index is out of range:0~{1}", index, AOCount - 1));
            }
            volt = 0;
            if (!IsOpen)
            {
                return((int)ErrorDef.NotOpen);
            }
            int opt = HTM.ReadAO(aoIndex[index], out volt);

            if (opt != 0)
            {
                return((int)ErrorDef.InvokeFailed);
            }
            return((int)ErrorDef.Success);
        }