示例#1
0
        /// <summary>
        /// 获取单点 输入信号
        /// </summary>
        /// <param name="card"></param>
        /// <param name="ioBit">0开始, 0-15</param>
        /// <param name="bStatus"></param>
        /// <returns></returns>
        public short _SR_GetInputBit(short card, short ioBit, out bool bStatus)
        {
            short shrResult = 0;
            int   iioBit    = 0;

            bStatus = false;

            shrResult = (short)adtIO3224.adtIO3224_read_in(card, out iioBit);
            int s = iioBit & (1 << ioBit);

            if (shrResult != 0)
            {
                MessageBoxLog.Show("IO3224控制卡初始化失败!");
                CommandResult("GT_GetExtIoValueGts", shrResult);
                return(shrResult);
            }
            if (s > 0)
            {
                bStatus = false;
            }
            else
            {
                bStatus = true;
            }
            return(shrResult);
        }
示例#2
0
 private void HomeWaitUI_Load(object sender, EventArgs e)
 {
     ThreadPool.QueueUserWorkItem(
         delegate
     {
         int iResult = NewCtrlCardV0.GoHome(_Axis);
         try
         {
             this.Invoke(
                 (MethodInvoker) delegate
             {
                 if (iResult != 0 && _Cancelled == false)
                 {
                     MessageBoxLog.Show("回零失败,请重新回零.");
                 }
                 this.Close();
             }
                 );
         }
         catch (System.Exception ex)
         {
         }
     }
         );
 }