Ejemplo n.º 1
0
        /// <summary>
        /// 设置Y0-Y7->D817A
        /// </summary>
        /// <param name="addr"></param>
        /// <param name="Y"></param>
        /// <param name="wOnOff"></param>
        /// <param name="er"></param>
        /// <returns></returns>
        public bool SetIO(int addr, EFMB_Y Y, int wOnOff, out string er)
        {
            er = string.Empty;

            try
            {
                int val = 0;

                int Y_Val = (int)Y;

                if (wOnOff == 1)
                {
                    val = (1 << Y_Val * 2);
                }
                else
                {
                    val = (1 << (Y_Val * 2 + 1));
                }

                if (!Write(addr, ERegType.D, 0x817A, val, out er))
                {
                    return(false);
                }

                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 设置Y0-Y7
 /// </summary>
 /// <param name="addr"></param>
 /// <param name="Y"></param>
 /// <param name="wOnOff"></param>
 /// <param name="er"></param>
 /// <returns></returns>
 public bool SetIO(int addr, EFMB_Y Y, int wOnOff, out string er)
 {
     return(_devFCMB.SetIO(addr, Y, wOnOff, out er));
 }