RobotStudio event

LoadModuleFromFile return error





I try to load a module to robot and
get an error<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />



First I put a the file to robot file
system at HOME :



GetABBRobot().FileSystem.PutFile("C:/TEMP/OPTITILE_PATH.mod",
"OPTITILE_PATH.mod", true);



 



Then I try to load it to robot using
:



bool
loadResult = task.LoadModuleFromFile("C:/Avi/Offline/Ecm/Abb/BMW3/bmw4/HOME/OPTITILE_PATH.mod",
ABB.Robotics.Controllers.RapidDomain.RapidLoadMode.Replace);



and get false at loadResult,
when I am working with real robot



if I run the same code
using simulator its work ok



Any one can help ?

thanks Avi



Comments

  • Hi Avi,


     

    After copying file to robot can you load that module directly from robot's home directory?

     

    bool loadResult = task.LoadModuleFromFile("HOME:/OPTITILE_PATH.mod",ABB.Robotics.Controllers.RapidDomain.RapidLoadModule.Replace);

     

    BR.
    charon2012-09-13 15:14:39
    Erdem Karaçeper


  • i tried it same problem,
    What i find out that the function return false but the module was load in the robot ?
     

  • Hii avicohen,

    Remember to write out which SDK you are using. This so that users only interested in one SDK doesn't have to read about all the other ones. LOL

     

    As Charon pointed out, your problem is that you are using a path to the C: drive and there is no C: drive on the controller, its root paths usually start with hd0a. Why that works on the VC is because it resides on a PC.

     

    This is why if you use both virtual and real controllers its better to use relative environment handles. For instance look how it is handled in the Backup and Restore chapter.

     By using the "string backupDir = "(BACKUP)$" + backupDirName;" line you would get different paths if its virtual or real, but it would both be pointing to the Backup folder on the controller. Same thing with HOME as per the File System Domain topic.

     





  • Hi John,<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />



    Thanks for the support.



    I am working with PC SDK 5.14



     



    What I am doing is : GetABBRobot().FileSystem.RemoteDirectory;



    For that string I add
    : + "/" + modulename;



    For real robot the
    directory is :
    /hd0a/66-70153_limpio/HOME



     



    And for that path I try
    to do LoadModuleFromFile



     



    What I find out that
    the module is loaded to robot, if the module contain new procedure I can see
    them on the robot



    But the bool the the
    function return is "false" and I don?_Tt understand why ?



     



    I tried to something
    like LoadModuleFromFile("HOME:/" + modulename,
    ABB.Robotics.Controllers.RapidDomain.RapidLoadMode.Replace);



     



     



    And get the same
    results, (module was loaded but the function return error)



     



    Do you know something
    about it ?



    Regards



    Avi