Example #1
0
        private void StartSimChannelSessionId(String sessionId)
        {
            ModbusSimulatorSlave.FormMBSimSlave sim = new ModbusSimulatorSlave.FormMBSimSlave();
              sim.Name = GetNextSimName();
              sim.SessionId = sessionId;

              this.m_openWindows.Add(sim.Name);

              sim.Show();
        }
Example #2
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();
        }
Example #3
0
 private void StartSim()
 {
     Form form = Application.OpenForms["sMBSim"];
       if (form == null)
       {
     this.m_openWindows.Add("sMBSim");
     ModbusSimulatorSlave.FormMBSimSlave sim = new ModbusSimulatorSlave.FormMBSimSlave();
     sim.Show();
       }
       else
       {
     form.Activate();
       }
 }