Пример #1
0
        public void ExecuteReadCommand(RegisterType type, uint index)
        {
            log.Log(new SCADA.Common.Logging.LogEventModel()
            {
                EventType = SCADA.Common.Logging.LogEventType.INFO, Message = $"ReadCommand ({type},{index})"
            });
            DNP3ReadCommandParameters dnp3CommandParam = new DNP3ReadCommandParameters(GetApplicationSequence(), (byte)DNP3FunctionCode.READ, GetTypeField(type),
                                                                                       (byte)Qualifier.PREFIX_2_OCTET_COUNT_OF_OBJECTS_2_OCTET, index, GetTransportSequence());
            IDNP3Function dnp3Fn = DNP3FunctionFactory.CreateReadFunction(dnp3CommandParam);

            this.functionExecutor.EnqueueCommand(dnp3Fn);
        }
Пример #2
0
 /// <summary>
 /// Acquisitor thread logic.
 /// </summary>
 private void Acquisition_DoWork()
 {
     try
     {
         while (true)
         {
             Thread.Sleep(acquisitionInterval);
             processingManager.ExecuteReadClass0Command();
         }
     }
     catch (Exception ex)
     {
         string message = $"{ex.Message}-{ex.StackTrace}";
         log.Log(new SCADA.Common.Logging.LogEventModel()
         {
             EventType = SCADA.Common.Logging.LogEventType.ERROR, Message = message
         });
     }
 }