RobotStudio event

PCSDK robot netscan don't find controllers

Hi,

I am making PCSDK sw and I have problems to find real controller from network.
the VC my sw find 100% of times, no problems there.
but with real controllers I have less than 50% change that netscan find the controller. PC and RC are in same subnet (198.168.0.xxx)
So, sometimes the controller is found and sometimes not.
The firewall is off in PC.

It help little bit if I kill ABB robot communication and discovery server processes with Task manager before starting my sw, but this isn't 100% either, anyway with this trick it finds controller better

I have this problem also with RS online, there the availability is sometimes not found and sometimes available. But when Try connect anyway connects to the controller allways.
How I can make this connect anyway functionality to my sw? and how to make netscan scanning more robust?

Regards,
Mika

Comments

  • Hi,

    without source code its impossible to know what is going on.
    the ABB example for the network scanner AND watcher is self explanatory and so far i haven't had any troubles with the function.
    Though I must say the PC SDK is more of an hobby project and not implemented in the company i work for (so it isn't fully tested)

    I expect the problem you experience is probably an event that is not properly raised or is deactivated in either the network scanner or the network watcher
    another problem might be the GUI list with controllers that is created doesn't update

    Hope this helps
  • Hello.

    I also had the same issue with not getting connection on first try, had to close application and start again a couple of times before it worked.
    Solved this by making 5 (or any number) of retries in code.

    It's not an elegant solusion but works for me. 

        public class RobotScanner
        {
            public int NumberOfRetries { get; set; } = 5;
            public bool RobConnected { get; set; } = false;
            public string RobSystemName { get; set; }
            public Controller RobController { get; set; }

            /// <summary>
            /// Scans network for available controllers and connects if get a match from string "RobSystemName"
            /// </summary>
            public bool ScanNetworkForRobot()
            {
                var retryCount = 0;
                var Scanner = new NetworkScanner();
                while (RobController == null && retryCount < NumberOfRetries)
                {
                    retryCount++;
                    Scanner.Scan();

                    foreach (ControllerInfo controllerInfo in Scanner.Controllers)
                    {
                        if (controllerInfo.SystemName.ToString() == RobSystemName)
                        {
                            if (RobController == null)
                            {
                                RobController = ControllerFactory.CreateFrom(controllerInfo);
                                RobController.Logon(UserInfo.DefaultUser);
                                RobConnected = true;
                                return RobConnected;
                            }
                            break;
                        }
                    }

                }
                RobConnected = false;
                return RobConnected;
            }
        }