Example #1
0
        static void Main(string[] args)
        {
            var sm = new DNP3.Adapter.StackManager();

            sm.AddTCPServer("server", FilterLevel.LEV_INFO, 5000, "192.168.1.201", 20000);
            var config    = new SlaveStackConfig();
            var publisher = sm.AddSlave("server", "slave", FilterLevel.LEV_INFO, new RejectingCommandAcceptor(), config);

            Console.WriteLine("Press <Enter> to randomly change a value");

            Random r = new Random();

            while (true)
            {
                Console.ReadLine();
                int value = r.Next(UInt16.MaxValue);
                System.Console.WriteLine("Change Analog 0 to: " + value);
                publisher.Start();
                publisher.Update(new Analog(value, 1, DateTime.Now), 0);
                publisher.End();
            }
        }
Example #2
0
 private void stackBrowser1_OnTcpServerAdded(TcpSettings s)
 {
     sm.AddTCPServer(s.name, s.level, s.timeout, s.address, s.port);
 }