PCSDK - Writing a configuration value using RobotStudio jobs to pass in IP Address

Hello,

I'm trying to use the "Run external tool" option in RobotStudio jobs to run a application created by the SDK to write a cfg parameter to each controller. The code I have is not working and I don't know why. I am new to this and I am trying to follow the examples given in the documentation but have been unsuccessful so far. Here's what I have so far. Could someone help me out please?

using System;
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.ConfigurationDomain;

namespace SimulateMenuDisabler
{
    class Disable
    {
        static string sysID = "A0DFFC2B-F6CE-48C4-AC91-D3A6F1F54799";
        static void Main(string[] args)
        {
            //sysID = "";
            try
            {
                Controller controller = new Controller(ControllerFactory.FormatControllerId(new Guid(sysID)));
                Mastership master;
                ConfigurationDatabase cfg = controller.Configuration;

                using (master = Mastership.Request(controller.Configuration))
                {
                    string[] path = { "SYS", "SYS_MISC", "SimulateMenu", "Value" };
                    cfg.Write("0", path);
                }
            }
            catch (System.InvalidOperationException ex)
            {
              
                //
            }

        }
    }
}

Comments

Sign In or Register to comment.