Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

How to run a program that is on the ABB controller

#1
Hello,
Once we generate a milling program and transfer it to the ABB IRC5 controller (using FTP), it there a easy way to start the program running from the Python API?  It looks like the driver understands a RUNPROG command but I do not see a way to send that command.  Or... should I just invest the time into learning the REST API that the controller provides and do it that way.

The assumption is that running a milling program right from RoboDK would not be able to send the commands (and move the simulation) fast enough.  Does that match your experience?

Thanks for the insight,
Henry
#2
You should be able to select what program for robot machining you want to run from the teach pendant. Otherwise, the ABB controller chooses the program called main to start.

One trick you can find in our documentation is to use a custom main program that will ask what program number you want to run. Example:
Code:
MODULE RoboDK_FTP_Run_Program
   
    CONST string PATH_ROBODK := "/hd0a/120-505004/HOME/RoboDK";
    PERS string ftp_program_loaded := "/hd0a/120-505004/HOME/RoboDK/Prog5.mod";
   
    PROC Main()
        FTP_Run_Program;
    ENDPROC

    PROC FTP_Run_Program()
        var num module_id := -1;
        WHILE module_id <= 0 DO
            TPErase;
            TPReadNum module_id, "Enter the program to run. For example: to run Prog2 in Module Prog2.mod type 2.";
        ENDWHILE
        FTP_Run_Program_ID(module_id);      
    ENDPROC
   
    PROC FTP_Run_Program_ID(num module_id)
        VAR string path_module := "";
        VAR string mod_to_unload;       
        IF module_id <= 0 THEN
            RETURN;
        ENDIF       
       
        path_module := PATH_ROBODK + "/Prog" + NumToStr(module_id, 0) + ".mod";
        IF StrLen(ftp_program_loaded) > 0 THEN
            mod_to_unload := ftp_program_loaded;
            ftp_program_loaded := "";
            UnLoad mod_to_unload; 
        ENDIF       

        Load path_module;
        ftp_program_loaded := path_module;

        TPWrite "Starting program: " + path_module;
       
        ! %"main_RoboDK"%; !call the main program from the module sent and loaded
        %"Prog"+NumToStr(module_id,0)%;
       
        TPWrite "Program completed";      

    ENDPROC

ENDMODULE
In short, when you run the main program, it will ask what program number you want to run and it will execute the program called ProgID. For example, if you want to run program number 4, you should call your robot machining program Prog4 in RoboDK, transfer the program to the robot, run the main program and enter the number 4. 

I attached this main program as a program module.

You can find more information here:
https://robodk.com/doc/en/Robots-ABB.html#FTP-ABB


Attached Files
.mod   RoboDK_FTP_Run_Program.mod (Size: 1.37 KB / Downloads: 20)
#3
Thank you Albert - 

Unfortunately, we can't have people selecting robot programs from the teach pendant.  The program needs to be started by the main application (that has RoboDK embedded).  I'm working through the ABB REST interface solution right now and it seems possible.

The concern that I am hearing from our technical people is that we might not be able to run the milling program while the RoboDK "driver" is running.  I'm not a ABB expert so I am not sure if that is a valid concern or not... but we will have to cross that bridge when we come to it.
#4
You should be able to run your robot machining programs from RoboDK on the real ABB robot once they have been sent to the ABB controller. To do so you should use a program call instruction (using the user interface) or calling RunInstruction (using the API). 

The ABB driver supports calling programs by name (contrary to other drivers which require using an ID and further configuration on the controller side/driver).

You should make sure to follow these steps:
  1. Make sure to change this setting in RoboDK: Select Tools-Options, select the Drivers tab and check the option Trigger program calls on the robot (set to Always). This is only needed if you want to use the user interface.
  2. Send the program to the robot (right click the program in RoboDK and select Send Program to Robot).
  3. Make sure the driver is running (it could have been running before step 1).
  4. Trigger the Run Instruction command using the UI or the API. When using the UI, make sure the program is set to Run on the robot (right click the program and select Run on Robot, then, double click on the program on the instruction). See attached image for an example using the UI. See below for an example using the API.
What it should look like using the UI:
   

Example using the API:
Code:
robot.Connect()
robot.RunInstruction('RobotMachining1', INSTRUCTION_CALL_PROGRAM)
#5
Hello Albert - we tried to follow your instructions without any success.

Using Robot Studio to look at the controller, here is what it looks like when we started.  The RDK driver is running:
   

We confirmed that the Driver setting was correct in the program options:
   

After using the right-click Send Program to Robot, the file looks like it made it to the controller:
   

Changed the Run on Robot for the program
   

Created a temporary program to run the milling program:
   

I did change the temporary program to run on the robot also but forgot to take an image of it.

Double-clicking on the temporary program caused some errors.  Here is the log in RoboDK:
   

Here is the error messages from the ABB software:
   

We probably were not following the instructions, so I tried to take a lot of screen captures.  Eventually we will do this with Python but I would like to make sure it works from the GUI before adding other "unknowns" into the equation.

Thanks again for your help.
#6
All the settings you shared look good.

What error message are you seeing on the robot controller?
Are you using the latest version of RoboDK and the ABB driver?
  




Users browsing this thread:
1 Guest(s)