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

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