NetworkWatcher Exception

Hi,

I’m tryig to use the NetworkWatcher (using RAB 5.09)

I copied exactly the same example on the manual.

I got this Exception:

System.ArgumentException was caught
Message="
Parameter name: url"
ParamName=“url”
Source=“ABB.Robotics.Controllers”
StackTrace:
at ABB.Robotics.Controllers.Internal.Event2.Unsubscribe(Url url, EventHandler1 handler, Boolean internal)
at ABB.Robotics.Controllers.Internal.Event2.Unsubscribe(IUrlBo undObject urlObject, EventHandler1 handler, Boolean internal)
at ABB.Robotics.Controllers.Internal.NetworkScanner.remove_Chan ged(EventHandler`1 value)
at ABB.Robotics.Controllers.Discovery.NetworkWatcher.set_Enable RaisingEvents(Boolean value)
at ABB.Robotics.Controllers.Discovery.NetworkWatcher..ctor(Bool ean enableRaisingEvents, IEnumerable controllers)
at ABB.Robotics.Controllers.Discovery.NetworkWatcher..ctor(Cont rollerInfoCollection controllers, Boolean enableRaisingEvents)
at ABB.Robotics.SchiappaIF.C_OnLineStatus.Connect(Object RobotIPAddress)

Here my code:

Public Function Connect(ByVal RobotIPAddress) As Boolean

Try

IPAddress = RobotIPAddress

ABBScan = New NetworkScanner

ABBScan.Scan()

Me.ABBNetworkWatcher = New NetworkWatcher(Me.ABBScan.Controllers, False)

AddHandler Me.ABBNetworkWatcher.Found, AddressOf Me.NetworkAddController

AddHandler Me.ABBNetworkWatcher.Lost, AddressOf Me.NetworkRemoveController

Me.ABBNetworkWatcher.EnableRaisingEvents = True

Catch ex As Exception

Parent.DebugLog.Add(1, 0, "Function C_OnLineStatus.Connect: " + ex.Message)

Throw New Exception(“Exception:C_OnLineStatus.Connect:NetworkWatcher:” + ex.Message)

End Try

'…

Any suggestion?

Oscar

Additional Information:

I tested it in Virtual controller and in the real controller.

I got the same behaviour.

Someone is using the networkwatcher with RAB 5.09 with success? can attach the code used?

Hello,

it seems that I have the same problem. Do you already have a solution to this?

BR

Rene

Hi!

There is a bug when creating a NetworkWatcher object with the enableRaisingEvents paramater set to false (which also is the case when using the default constructor). The problem is solved in RAB 5.10.

A workaround that should work is this (in c#), if you want the EnableRaisingEvents disabled:

_watcher = new NetworkWatcher(true); _watcher.EnableRaisingEvents = false;