This might seam like a strange question, but I am quite new to PC-SDK.
I have no problems with creating a controller with controllerFactory if I have made a scan and then look through the list of found controllers.
But in my case I know the IP of my three controllers, and would like to directly connect to them with ControllerFactory. I’ve tried this in several ways also using the Optional argument for IP. But it still seams like I need to have the ControllerInfo for that particular controller.
After I wrote my question I have done something similar to what you show. I Make a scan, and then look through the found controllers to find the IP numbers I know that my controllers will have. Like this:
After this I can continue and log on to the controllers as I wish. I will change the IP# into string variables so that they can be changed by the user.
This actually works fine.
It would however be nice if it would be possible to create a controller instance with “ControllerFactory” directly from the IP# or the Controller ID as a string, without having to do a scan.
It is possible to create a Controller instance without performing a scan operation.
All .NET Winform applications read configuration data from an App.config file in the application directory. It is not mandatory to use an App.config file in a PC SDK application, but it is sometimes a convenient way to add application flexibility. Therefore, an App.config file that you can use is included in the RAB installation.
Start by copying the App.config file at C:Program FilesABB Industrial ITRobotics ITRobot Application BuilderPC SDK to the application directory. Then add the file to the project by right-clicking the project icon, pointing to Add and selecting Existing Item. To modify application behavior you thus need to change the values of the attributes of this file.
If there is a controller in the network that you connect to often (or if the PC application is supposed to work with a single controller) it can be specified in the tag. It has an id attribute containing a GUID string embraced by curly brackets.
Using this mechanism enables you to use the default constructor to create a Controller object for the specified controller:
There is a few “?” that pops up when I read the above.
The GUID, “{xxxx…}”? Do I have to do a scan and then read the GUID’s of the found controllers(Manually once, I mean)? Or can I get it in the real controller? Or have I missunderstood the GUID completely ??
In my case it is always three controllers available, they are always to be logged on to. Can I still use this tecnique? In that case how?
The way I do now works, so this is not critical, but it would be nice to understand how to do.
Maybe I was too quick to answer the question. You actually do need to perform a scan operation by using NetworkScanner.Scan in your application. The PC SDK uses it to log you on to the controller. The NetworkScanner.Find(Guid) method should be possible to use as well.
The GUID belongs to the system. You can read it from the system.guid file in the INTERNAL folder of the robot system file system.
The defaultSystem id tag is used to specify ONE system as the default one (created with parameterless constructor). If you need to log on to three different controllers there is an overloaded Controller constructor method, which takes a GUID.