RobotStudio event

My Journey with User Login and Login tracking

Options

Good Morning,

I am writing this in hopes that it may help others in their programming ventures

 

A small amount of background here.

I was called into the plant that I work at to bring their robots up to a more functioning and persistent operational capability. That was six months ago if not a little more. Over the previous months, prior to my arrival, there had been some six knuckles replaced on one of the IRB 6700’s that are located on the site. The first thing on my agenda was to lock everyone out of the teach pendants. So many challenges started to arise and take shape into the real issues occurring on the floor. Since properly training personnel and taking the time to clean up the RAPID, there have been zero knuckles changed and the robots here are running a normal 97 percent up time with 100 percent quality per part cut.

A true challenge this was to get to this point.

Now, part of our process here requires that a properly trained technician change a saw blade out and there is a VERY defined number for when that saw blade should be swapped out for a new blade.

 

We then found that having people do the job properly was an even bigger task than we had faced as of yet.

After finding that people were just not changing the blades and running them into the next shift, I decided that it was time to have the Robot track the blade change.

What an interesting journey this has been….

First issue.

I called a few, very educated and experienced, programmers and each of them had just about the same thing to say. “Joey, I am not sure if RAPID can even do that”.

Here is how I am doing it. Although, it is not completely full proof it is however a start.

The Robot is cutting and reaches the number desired in the counters.

IF ((counterPart1+CounterPart2)>=5)

            OR (counterPart1>=5)

            OR (counterPart2>=5) THEN           

            ErrWrite "Blade Change Requested","The Blade is past its LifeSpan"; 

            Operator_Login;                       

        ENDIF

 

Once the ErrWrite occurs The program then shifts to The Operator Login ProCall

 

MODULE Blade_Caller 

    PROC Operator_Login() 

        WaitUntil Technician=TRUE; 

        ErrLog 4800,"The Blade was changed","The Saw Blade","was changed","at this time","Something written in here";

        Stop;       

        !After you change the bool data for your name YOU MUST PP TO MAIN!!!!! 

    ENDPROC

 

ENDMODULE

 

I named it “Blade Caller’ just to have a name there. It has no bearing on the Program.

 

The Technician must login under their username to change the VAR bool that is in the data of the program.

 

Once that occurs there will be an Event Logged and that person then will have ownership of the Blade Swap.

 

THIS IS VERY IMPORTANT.

IN THE UAS YOU MUST MAKE SURE THAT YOU, AS THE ADMIN, ARE THE ONLY PERSON WHO CAN DELETE ERROR LOGS. IF THAT IS NOT ADHEARED TOO THAN YOU ARE SETTING YOURSELF UP FOR FAILURE AND LOGS CAN JUST BE DELTED BY ANYONE.

 

I hope everyone has a wonderful day and please let me know if you have any questions or maybe even better advice than what I have here.



God Bless,


Joey

Comments

  • soup
    soup ✭✭✭
    Options
    Seems like @lemster68's suggestion to use UIAlphaEntry would be a lot easier and better than having a Technician logging in, going to Program Data, flipping a bool, PP to Main, etc.
  • I fought with UIAlphaEntry on this for a few days and was unable to get it to work. Ill take all the advice I can get if you have any.

    My trouble was in the tests and cases. That and no matter what I read or tried I still never could get the test or cases to work properly.

    Thank you so much.

  • soup
    soup ✭✭✭
    Options
    Sorry for coming late to the discussion. Example below. I just wrote and ran it virtually this morning, so needs to be tested and tweaked.

    A few notes:
    • NOVIEW probably good enough, but could hide the UserData in a different module and/or encrypt that module
    • WHILE loop locks them in to keep trying until successful, PP to Main gets them out, but Count still left high so call CheckCount before next run
    • background ErrLog: the datetime of request so can see how long it took to get a Technician to show-up
    • background ErrLog: logs user's name so you know who approved it
    • ExitCycle is PP to Main, but could be taken to any procedure from here
    • unique user codes required or will just use the name of the first match found in the array
    -----
    MODULE mLogin(SYSMODULE, NOVIEW)

        RECORD UserData
            string Name;
            string Code;
        ENDRECORD

        CONST num CountMax:=5;
        CONST UserData Tech{5}:=[["Name1", "123a"],["Name2", "234a"],["Name3", "345a"],["Name4", "456a"],["Name5", "567a"]];
        PERS num Count:=0;
       
        PROC CheckCount()
            VAR string answer;
            WHILE Count>CountMax DO
                ErrLog 4801\I, "Login Requested", "Technician login was", "requested.", " ", "Count="+NumToStr(Count,0);
                answer:=UIAlphaEntry(
                    \Header:="Technician Login",
                    \Message:="A Technician needs to login to continue."
                    \Icon:=iconInfo);
                FOR i FROM 1 TO Dim(Tech,1) DO
                    IF answer=Tech{i}.Code THEN
                        ErrLog 4801\I, "Login Successful", Tech{i}.Name+" logged in", "to approve", "blade change.", " ";
                        Count:=0;
                        ExitCycle;
                    ENDIF
                ENDFOR
                ErrLog 4801\I, "Login Failed", "Technician login was", "attempted and failed.", " ", " ";
            ENDWHILE
        ENDPROC
       
        ! TEST ONLY -- manually call this procedure to see login script above work
        PROC TestLogin()
            Count:=UINumEntry(
                \Header:="Change Count Here"
                \Message:=">"+NumToStr(CountMax,0)+" will trigger login, <="+NumToStr(CountMax,0)+" won't."
                \Icon:=iconInfo
                \InitValue:=CountMax+1
                \AsInteger);
            CheckCount;
        ENDPROC
       
    ENDMODULE


  • My goodness, please do not apologize for being late, this is amazing. Thank you so much for taking the time to look at this. I cant tell you how much I appreciate this.


    Thank you so much and God Bless,

    Joey

  • This was just amazing. I did have to tweak it but that is only due to our process here. I hope to grow up to be this good one day

  • The only question I have now is NOVIEW and how to encrypt the module. I have researched it but have only run into very vague descriptions.

  • soup
    soup ✭✭✭
    Options
    I'd create a module with only "CONST UserData Tech{5}:=[["Name1", "123a"],["Name2", "234a"],["Name3", "345a"],["Name4", "456a"],["Name5", "567a"]];" in it and only encrypt that module.

    I can't remember if or how that data type is displayed on the pendant under Program Data. It's possible that it'd show the passwords even though the module is encrypted.

    I still use the encryption script provided in this thread. It worked the last time I used it -- about a year ago.
  • soup
    soup ✭✭✭
    Options
    I just encoded a module with only the UserData and unfortunately it was able to be seen clearly from Program Data.

    Not sure how secure you need, but could do a letter swap (decoder ring style) for the password.
  • lemster68
    Options
    I think you might be able to set it up in your system parameters to be a hidden module.
    Lee Justice
  • soup
    soup ✭✭✭
    Options
    I had NOVIEW on the module. Willing to try some settings...