Presenting a Robot’s Work Progress

February 16, 2018 | Robotics

Robots Work Progress 1

Often while running their workflow, a robot will perform some processing in the background. When background processing takes a long time, it may be beneficial for the operator to have information about the volume of transactions already processed by the robot.
Presenting a Robot’s “progress” can be done in various ways (e.g. The robot opening a notepad and writing a new line for each transaction or step).

In this article we are presenting a more refined way to approach this: the Robot is using a named pipe communication to “broadcast” a structured message to a potentially listening server. The Robot will try to connect, but fall-back gracefully if no server is listening. For this purpose, we will develop a custom activity that receives progress information (e.g. Min, Max and Current progress bar values, text to be displayed). All parameters are structured as a JSON string that is sent to the server.

    public class ShowProgress : CodeActivity

    {

        [Category(“Input”)]

        [RequiredArgument]

        public InArgument<String> Label { get; set; }

        [Category(“Input”)]

        [RequiredArgument]

        public InArgument<Int32> Bar_Min { get; set; }

        [Category(“Input”)]

        [RequiredArgument]

        public InArgument<Int32> Bar_Max { get; set; }

        [Category(“Input”)]

        [RequiredArgument]

        public InArgument<Int32> Bar_Value { get; set; }

        protected override void Execute(CodeActivityContext context)

        {

            string label = Label.Get(context);

            Int32 bar_min = Bar_Min.Get(context);

            Int32 bar_max = Bar_Max.Get(context);

            Int32 bar_value = Bar_Value.Get(context);

            String msg = String.Format(“{{\”label\”:\”{0}\”,\”bar_min\”:{1},\”bar_max\”:{2},\”bar_value\”:{3}}}”,

                label,

                bar_min,

                bar_max,

                bar_value

            );

            NamedPipeClientStream pipeClient = new NamedPipeClientStream(“.”, “TImpactUiPath”,

                PipeDirection.InOut, PipeOptions.None,

                TokenImpersonationLevel.Impersonation);

            try

            {

                pipeClient.Connect(250);

                StreamString ss = new StreamString(pipeClient);

                ss.WriteString(msg);

                pipeClient.Close();

            }

            catch

            {

            }

        }

    }

The Robot will calculate the Min. and Max. values and will call the custom activity passing those parameters together with the current value of the background processing’s progress.

StreamString class details are presented in the article “How to: Use Named Pipes for Network Interprocess Communication” (link in References section)

In the next article we are going to present a sample Windows Forms application that will instantiate a named pipe server and display any received messages as visual representation of a “loading/filling/….” Progress bar.

Related Articles

Introducing Our Robots

January 02, 2019 | Robotics

Good morning and a Happy New Year to all our readers. T-Impact are back in 2019 with a brand new website and we’re looking forward to lighting the way for more successful digital transformations and robotics implementations across the globe. When developing our new site that our old website never answered one important question. Have you […]

LawNet 2018 – Congratulations!

November 29, 2018 | Robotics

Last week, T-Impact had the pleasure of presenting the LawNet Enterprise Award to Gardner Leader LLP at the 2018 Lawnet Annual Conference and Awards Evening Gala at the Hinckley Island hotel in Leicester.

Take advantage of T-Impact & UiPath’s Black Friday & Cyber Monday offer!

November 21, 2018 | Digital Transformation | Robotics

NOW EXTENDED FOR CYBER MONDAY! Black Friday is always a popular time to shop for technology, but rather than buying an extra coffee machine, why not future-proof your organisation, greatly enhance your survival prospects and begin to reap the benefits of automation across your business? Take advantage of T-Impact’s unique Black Friday offer and get three […]