Example #1
0
        /// <summary> 等待气缸动作感应
        /// 等待气缸动作感应
        /// </summary>
        /// <param name="type">0:轴卡上的4输入通道;1:轴卡扩展的16输入通道;2:7432 IO卡输入</param>
        /// <param name="cardNo">代表第几张卡,从0开始</param>
        /// <param name="pointNo">代表第几个点位,从0开始</param>
        /// <param name="onOff">输出状态,0:Off;1:On</param>
        /// <param name="waitTime">等待输入时间,单位ms</param>
        /// <param name="errorNo">errorcode配置文件的ID</param>
        public static void GeneralClynderMotionSensor(int type, int cardNo, int pointNo, int onOff, int waitTime, int errorNo)//阻挡气缸伸出
        {
            try
            {
                switch (type)
                {
                case 0:
                    GClsMontion.WaitCardInputBit(cardNo, pointNo, onOff, waitTime, errorNo);//轴卡上的4输入通道
                    break;

                case 1:
                    GClsMontion.WaitCardExtendInputBit(cardNo, pointNo, onOff, waitTime, errorNo);//轴卡扩展的16输入通道
                    break;

                case 2:
                    ushort uCardNo  = (ushort)cardNo;
                    ushort uPointNo = (ushort)pointNo;
                    ushort uOnOff   = (ushort)onOff;
                    GClsMontion.WaitIOCard7432InputBit(uCardNo, uPointNo, uOnOff, waitTime, errorNo);//7432 IO卡输入
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }