Exemple #1
0
        private void StartSimPort(String connectString)
        {
            ModbusSimulatorSlave.FormMBSimSlave sim = new ModbusSimulatorSlave.FormMBSimSlave();
              String[] pieces = connectString.Split(':');
              if (pieces.Length == 2)
              {
            sim.IP = pieces[0];
            sim.Port = Convert.ToUInt16(pieces[1]);
              }
              else if (pieces.Length == 1)
              {
            sim.IP = pieces[0];
              }
              else
              {
            sim.Dispose();
            StartSim();
            return;
              }

              sim.Name = GetNextSimName();
              this.m_openWindows.Add(sim.Name);

              sim.Show();
        }