Hello, I’,m starting witn Pc SDk for Rw5.13, and I’m doing the samples that you can find on manual.
So I did the sample until the networkwatcher. My application compiles with no problem. But the networkwatch never lunchs the event OnFound (found controller). I testing it on Virtual controller (RobotStudio 5.13).
Here is my code:
private void Form1_Load(object sender, EventArgs e)
{
this.scanner = new NetworkScanner();
this.scanner.Scan();
ControllerInfoCollection controllers = scanner.Controllers;
ListViewItem item = null;
foreach (ControllerInfo controllerinfo in controllers)
{
item = new ListViewItem(controllerinfo.IPAddress.ToString());
item.SubItems.Add(controllerinfo.Id);
item.SubItems.Add(controllerinfo.Availability.ToString());
item.SubItems.Add(controllerinfo.IsVirtual.ToString());
item.SubItems.Add(controllerinfo.SystemName);
item.SubItems.Add(controllerinfo.Version.ToString());
item.SubItems.Add(controllerinfo.ControllerName);
listView1.Items.Add(item);
}
this.networkwacther = new NetworkWatcher(controllers);
networkwacther.Found += new EventHandler(HandleFoundEvent);
networkwacther.Lost += new EventHandler(networkwacther_Lost);
}
private void HandleFoundEvent (object sender, NetworkWatcherEventArgs e)
{
//throw new Exception(“The method or operation is not implemented.”);
//I put a stop here
Invoke(new EventHandler(AddControllerToListView), new Object { this, e });
}
What’s happen?.
Thanks
/Jorge