Exemple #1
0
        /// <summary>
        /// 获取所有的输出点状态
        /// </summary>
        /// <returns>byte[0]的最低位表示第0个输出点的当前状态</returns>
        public int GetAllAOs(out double[] volts)
        {
            List <double> ret = new List <double>();

            lock (asynLocker)
            {
                if (!IsOpen)
                {
                    volts = new double[] { };
                    return((int)ErrorDef.NotOpen);
                }
                foreach (int index in aoIndex)
                {
                    double volt = 0;
                    if (0 != HTM.GetAO(aoIndex[index], out volt))
                    {
                        volts = new double[] { };
                        return((int)ErrorDef.InvokeFailed);
                    }
                    ret.Add(volt);
                }
                volts = ret.ToArray();
                return((int)ErrorDef.Success);
            }
        }