Transfer programs via FTP

Programs can be easily transferred via FTP from RoboDK for ABB robots:

1.Right click the robot in RoboDK

2.Select Connect to robot…

3.Enter the IP of the robot

4.Enter the remote FTP path.   
The complete path can be retrieved from the teach pendant or using FileZilla FTP Client.

5.Enter the FTP credentials (anonymous by default)

Once a RoboDK program is ready to be sent to the robot:

1.Right click a program in RoboDK

2.Select Send program to robot (Ctrl+F6)    
This will generate the program and attempt to transfer it to the robot controller. A window will pop up showing if the FTP transfer was successful or not.

Robots ABB - Image 4Robots ABB - Image 5

When programs are transferred through FTP on the fly they need to be loaded using RAPID programming on the robot side. The following example will run the main_RoboDK program from a module called MOD_Pick_and_place:

MODULE RoboDK_FTP_Run_Program

! Enter the path to a folder with write access rights. Example:

CONST string PATH_ROBODK := "/hd0a/robot-serial-num/HOME/RoboDK";

PERS string ftp_program_loaded := ";

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;

    ! call the main program from the module sent and loaded

    ! %"main_RoboDK"%;

    ! call the numbered program (it should have the same effect)

    %"Prog"+NumToStr(module_id,0)%;

    TPWrite "Program completed";

ENDPROC

ENDMODULE