Hi again,
I’m just full of questions now a days..
Now I’m baching my head against the wall trying to copy files from the controller to the pc. I’m trying to use the GetFile() method, but I get an exception “File not found on the remote filesystem” thrown at me all the time. Here is what I do:
using( ABB.Robotics.Controllers.Mastership master = ABB.Robotics.Controllers.Mastership.Request( m_controller.Rapid ) )
{
using( ABB.Robotics.Controllers.RapidDomain.Task task = m_controller.Rapid.GetTask( “T_ROB1” ) )
{
using( ABB.Robotics.Controllers.RapidDomain.Module mod = task.GetModule(module) )
{
string dir = m_controller.FileSystem.RemoteDirectory;
mod.SaveToFile( dir );
using( ABB.Robotics.Controllers.FileSystemDomain.FileSystem fs = m_controller.FileSystem )
{
string tmpFile = System.IO.Path.GetTempFileName();
m_tracer.WriteLine(dir + “/” + module + “.mod” );
ABB.Robotics.Controllers.FileSystemDomain.ControllerFileSystemInfo[] inf = fs.GetFilesAndDirectories( “FinaBox.mod” );
m_tracer.WriteLine( "Length: " + inf.Length.ToString() );
if( inf.Length > 0 )
{
m_tracer.WriteLine( "Will try to fetch: "+ inf[0].FullName );
m_tracer.WriteLine( "And place it in: "+ tmpFile );
fs.GetFile( inf[0].FullName, tmpFile );
m_tracer.WriteLine( “Done” );
}
}
}
}
}
The GetFilesAndDirectories search is only there to verify that the file was created, I did use " dir + “/” + module + “.mod” " at first but when that did not work I did the search just to be sure. The search do find the file I’m looking for, but the GetFile method does not I’m afraid.
The tracer prints out:
[1332] C:/p/TestPCSDK/HOME/FinaBox.mod
[1332] Length: 1
[1332] Will try to fetch: C:/p/TestPCSDK/HOME/FinaBox.mod
[1332] And place it in: C: emp mpD5.tmp
and then the exception is trown.
Anyone got any idea why this does not work? Any problems with the format of my paths? Both the file on the VC and the temporary file do exist on my computer.
BR
Mikael