Hi,
i have build a win32 application in C# with some methods that allow me to perform many operations on a controller. But i have a problem about implement a method that can load a RAPID program that stored on hardisk device on robot controller.
I know and i think that i must use “Task.LoadProgramFromFile(string Path, RapidLoadMode)” of PC SDK, but for use this method i must to know previos the name of my RAPID program and where it is located on controller hardisk. So i would to do a broswing of hardisk, select a program and load it.
I know that we can only access on controler hardisk by FTP protocol so i builded a method using this:
…
using (Mastership mc = Mastership.Request(controller.Configuration),
mr = mastership.Request(controller.Rapid))
{
Task tasks = controller.Rapid.GetTasks();
System.Windows.Forms.OpenFileDialog file = new OpenFileDialog();
file.Filter = “Old stile (.prg)|.prg|IRC5|.pgf|All File |.*”;
file.Title = “Load Robot Program from robot”;
file.CheckPathExists = false;
file.ValidateNames = false;
file.CheckFileExists = false;
file.RestoreDirectory = true;
file.InitialDirectory = “ftp://” + controller.FileSystem.RemoteDirectory;
if(file.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string s = file.FileName;
int pos = s.LastIndexOf(‘/’);
s = s.Remove(0, pos + 1);
try
{
tasks[0].LoadProgramFromFile(file.FileName, RapidLoadMode.Replace);
}
catch(System.Exception ex)
{
MessageBox.Show(ex.Message, “Error 0018:”, MessageBoxButtons.OK, MessageBoxIcon.Error);
mr.Release();
mc.Release();
}
}
mr.Release();
mc.Release();
}
}
…
Now when i start this method it’s all ok, i can broswe into controller hardisk and select the file that i want, but when i click on “Open” button of this “OpenFileDialog” it don’t work also in the near tetxbox appear my selected file… :grinning:
What is the problem?? is maybe .net?? somebody can help me??
How i can load a RAPID program directly on controller without must know the file name?? is it possibile to do a file broswing into controller hardisk without ftp or http protocol??
best regard Emanuele