예제 #1
0
        public void readerSingnal(string ip, string adr)
        {
            var m_FanucRobotDevice = new FanucRobotModbus(ip);
            var ret = m_FanucRobotDevice.Read(new FanucRobotDataConfig()
            {
                DataType = FanucRobotDataTypeEnum.DO, DataAdr = adr
            });

            Clients.Client(Context.ConnectionId).getSignalrRes(ret);
        }
예제 #2
0
        /// <summary>
        /// 获得订单允许下发信号状态
        /// </summary>
        /// <param name="allow">false→true 上升沿时下发订单; 其他:等待</param>
        /// <returns>true:读取正常; false:读取异常</returns>
        public bool GetOrderAllow(ref bool allow)
        {
            var ret = m_FanucRobotDevice.Read(m_OrderAllowConfig);

            if (ret.IsSuccess == false)
            {
                return(false);
            }

            bool temp = false;
            var  pret = bool.TryParse(ret.Content, out temp);

            if (pret == false)
            {
                return(false);
            }

            allow = temp;
            return(true);
        }
예제 #3
0
        /// <summary>
        /// 获得原料输入请求
        /// </summary>
        /// <param name="raw_in">false→true:请求生效</param>
        /// <returns>true:读取正常; false:读取异常</returns>
        public bool GetRawInRequireState(ref bool raw_in)
        {
            var ret = m_FanucRobotDevice.Read(m_RawInRequireStateConfig);

            if (ret.IsSuccess == false)
            {
                return(false);
            }

            bool temp = false;
            var  pret = bool.TryParse(ret.Content, out temp);

            if (pret == false)
            {
                return(false);
            }

            raw_in = temp;
            return(true);
        }