예제 #1
0
        //public string deviceName;
        //public int deviceAddress;
        //public int deviceValue;
        //public ModbusConnection connection;
        //public SciChartSurface DOChart2D;
        //public Timer updateTimer;


        public DigitalOutputDevice(string name, int address, int value, ModbusConnection connection)
        //SciChartSurface surface
        {
            deviceName      = name;
            deviceAddress   = address;
            deviceValue     = value;
            this.connection = connection;
            //DOChart2D = surface;

            updateTimer          = new Timer();
            updateTimer.Elapsed += new ElapsedEventHandler(Updates);
            updateTimer.Interval = 1000;
            updateTimer.Enabled  = true;
        }
예제 #2
0
        //public List<DigitalOutputDevice> DOlist;
        //public List<DigitalInputDevice> DIlist;
        //public List<AnalogOutputDevice> AOlist;
        //public List<AnalogInputDevice> AIlist;

        public Schema(MainWindow mw)
        {
            //создание экземпляра подключения
            connection = new ModbusConnection();

            //заглушка на подключение к серверу Modbus
            connection.ConnectToServer("127.0.0.10", 502);

            //инициализация списка с устройствами
            MDlist = new List <ModbusDevice>();
            //DOlist = new List<DigitalOutputDevice>();
            //DIlist = new List<DigitalInputDevice>();
            //AOlist = new List<AnalogOutputDevice>();
            //AIlist = new List<AnalogInputDevice>();

            this.mw = mw;
            MDlist  = new List <ModbusDevice>();
        }