Ejemplo n.º 1
0
 public void On_Connection_Connected(object Msg)
 {
     this._IsConnected = true;
     this.Status       = "Connected";
     ChangeNodeConnectionStatus("Connected");
     _ReportTarget.On_Controller_State_Changed(DeviceName, "Connected");
     _ReportTarget.On_Message_Log("CMD", DeviceName + " " + "Connected");
 }
Ejemplo n.º 2
0
        public void Start(object state)
        {
            _ReportTarget.On_Controller_State_Changed(DeviceName, "Connecting");
            switch (this.ConnectionType.ToUpper())
            {
            case "SOCKET":

                conn = ModbusIpMaster.CreateIp(new TcpClient(this.IPAdress, this.Port));
                _ReportTarget.On_Controller_State_Changed(DeviceName, "Connected");
                break;

            case "COMPORT":
                SerialPort serialPort = new SerialPort();     //Create a new SerialPort object.
                serialPort.PortName = this.PortName;
                serialPort.BaudRate = this.BaudRate;
                serialPort.DataBits = 8;
                serialPort.Parity   = Parity.None;
                serialPort.StopBits = StopBits.One;
                serialPort.Open();
                conn = ModbusSerialMaster.CreateRtu(serialPort);
                _ReportTarget.On_Controller_State_Changed(DeviceName, "Connected");
                break;
            }
        }
Ejemplo n.º 3
0
 public void On_Connection_Connected(string Msg)
 {
     _ReportTarget.On_Controller_State_Changed(_Config.DeviceName, "Connected");
 }
Ejemplo n.º 4
0
 public void On_Connection_Connected(object Msg)
 {
     this._IsConnected = true;
     this.Status       = "Connected";
     _ReportTarget.On_Controller_State_Changed(_Config.DeviceName, "Connected");
 }