| | |
| | | |
| | | public override void OnMethodInvoked(IAsyncResult ar) |
| | | { |
| | | MotionCardMonitorSet monitorSet = ar.AsyncState as MotionCardMonitorSet; |
| | | ProcessResponse resValues = monitorSet.Response; |
| | | if (resValues.ResultValue == (int)ReplyValue.IGNORE) |
| | | { |
| | | return; |
| | | } |
| | | //MotionCardMonitorSet monitorSet = ar.AsyncState as MotionCardMonitorSet; |
| | | //ProcessResponse resValues = monitorSet.Response; |
| | | //if (resValues.ResultValue == (int)ReplyValue.IGNORE) |
| | | //{ |
| | | // return; |
| | | //} |
| | | |
| | | Stopwatch sw = new Stopwatch(); |
| | | sw.Start(); |
| | | // 将指定IOItem写入板卡 |
| | | foreach (var replyIOData in monitorSet.ReplyIODatas) |
| | | { |
| | | //写入IO输出 |
| | | if (replyIOData.IOType == IOType.OUTPUT) |
| | | { |
| | | GTSCardAPI.GT_SetDoBit((short)IConfig.CardNum, GTSCardAPI.MC_GPI, (short)replyIOData.IONum, (short)replyIOData.Value); |
| | | } |
| | | // in只读不能写 |
| | | } |
| | | sw.Stop(); |
| | | LogAsync(DateTime.Now, $"{Name}反馈完成,耗时{sw.ElapsedMilliseconds}ms", $"{resValues.GetDisplayText()}"); |
| | | //Stopwatch sw = new Stopwatch(); |
| | | //sw.Start(); |
| | | //// 将指定IOItem写入板卡 |
| | | //foreach (var replyIOData in monitorSet.ReplyIODatas) |
| | | //{ |
| | | // //写入IO输出 |
| | | // if (replyIOData.IOType == IOType.OUTPUT) |
| | | // { |
| | | // GTSCardAPI.GT_SetDoBit((short)IConfig.CardNum, GTSCardAPI.MC_GPI, (short)replyIOData.IONum, (short)replyIOData.Value); |
| | | // } |
| | | // // in只读不能写 |
| | | //} |
| | | //sw.Stop(); |
| | | //LogAsync(DateTime.Now, $"{Name}反馈完成,耗时{sw.ElapsedMilliseconds}ms", $"{resValues.GetDisplayText()}"); |
| | | } |
| | | |
| | | protected void MonitorCheckAndInvoke(List<IOItem> tempNew, List<IOItem> tempOld) |