Пример #1
0
 public void TurnOnConsumersAndGenerators()
 {
     for (int i = 0; i < 40; i++)
     {
         mdbClient.WriteSingleCoil((ushort)i, true);
     }
 }
Пример #2
0
        public bool CommandDiscreteValues(long gid, bool value)
        {
            var discLoc = listOfDiscretes.Find(p => p.Discrete.PowerSystemResource == gid);
            var anLoc   = listOfAnalog.Find(p => p.Analog.PowerSystemResource == gid);

            if (discLoc != null)
            {
                modbusClient.WriteSingleCoil((ushort)(discLoc.StartAddress - 1), value);
                modbusClient.WriteSingleRegister((ushort)((anLoc.StartAddress - 1) * 2), 0f);
            }

            Console.WriteLine("SendDataToSimulator executed...\n");

            return(true);
        }