示例#1
0
        /// <summary>
        /// 反馈消息至PLC
        /// </summary>
        /// <param name="_session"></param>
        /// <param name="_transData"></param>
        /// <param name="checkR"></param>
        public static void SendMsg(MesSession _session, TransData _transData, CheckResult checkR)
        {
            _transData.Status = checkR.ToString();
            string msg = GlobalData.ToTranString(_transData);

            _session.Send(msg);
            LogInfo log = new SocketService.LogInfo(_session, LogLevel.Info, GlobalData.Pre_Send + msg);
        }
示例#2
0
        /// <summary>
        /// 关键字段为空时处理方法
        /// </summary>
        /// <param name="_session"></param>
        /// <param name="_transData"></param>
        /// <param name="_keyWord"></param>
        public static void KeyWordIsNullRecv(MesSession _session, TransmitData _transData, string _keyWord)
        {
            _transData.CheckResult = "NG";
            _transData.Description = _keyWord + " is null Or white space.";
            string sendTransData = JsonHelper.SerializeObject(_transData);

            _session.Send(sendTransData);
            _session.Logger.Error(_transData.CheckResult + "---" + _transData.Description);
        }