Click or drag to resize

TaskLoadProgramFromFile Method

Loads a RAPID program into the robot controller program memory.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public void LoadProgramFromFile(
	string filePath,
	RapidLoadMode mode
)

Parameters

filePath
Type: SystemString
Path to the file containing the RAPID program. Valid extension for a RAPID program file is .pgf.
mode
Type: ABB.Robotics.Controllers.RapidDomainRapidLoadMode
Specifies the RapidLoadMode of the operation.
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
ArgumentExceptionThefilePath isn't recognized as a RAPID program file. File extension has to be .pgf.
Examples
This example loads a RAPID program to a RAPID task.
private void _gtpuopendialog_Closed(object sender,EventArgs e)
{
    try
    {
        // If OK was selected in SaveDialog
        if (_gtpuopendialog.DialogResult == System.Windows.Forms.DialogResult.OK)
        {
            // Get filename
            string stFileName = _gtpusavedialog.FileName;

            // Load program
            myTask.LoadProgramFromFile(stFileName,LoadMode.Replace);
        }
    }
    catch (GeneralException ee)
    {
        // TODO: Add error handling
    }
    catch (System.Exception ee)
    {
        // TODO: Add error handling
    }
    finally
    {
        // Release resources
    }
}
See Also