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

            lock (asynLocker)
            {
                if (!IsOpen)
                {
                    isONs = new bool[] { };
                    return((int)ErrorDef.NotOpen);
                }
                foreach (int index in diIndex)
                {
                    int sig = 0;
                    //if (0 != HTM.GetDio(diIndex[index], out sig))
                    //{
                    //    isONs = new bool[] { };
                    //    return (int)ErrorDef.InvokeFailed;
                    //}
                    sig = HTM.GetDI(index);
                    ret.Add(sig != 0);
                }
                isONs = ret.ToArray();
                return((int)ErrorDef.Success);
            }
        }