RobotStudio event

write a file in the Controller from FlexPendant

Hello,

I'm trying to write a file from the flexpendant SDk 6.06 to the controller of the robot.
This works only for a virtual controller, for a real controller this is the error message:
"Could not find a part of the path \hd0a\Temp\temp.mod"
My method is this one:

public void CreateModule() {

            string fileWrite = "\\temp.mod";
            string path = this._ctrl.FileSystem.GetEnvironmentVariableValue("TEMP");
            this._ctrl.FileSystem.RemoteDirectory = path;
            StreamWriter wr = new StreamWriter(path + fileWrite);
         
            for (int i = 0; i < ModuleText.Length; i++)
            {
                wr.WriteLine(ModuleText[i]);
            }
            wr.Close();
        }

Any Idea?

Thank you

Comments

  • Micky
    Micky ✭✭✭
    Hello,

    if you write a file with the FlexPendant -SDK the file is located on the local filesystem (Memory) of the Flexpendant.

    As soon as you have completed the writing of the file, you have to copy the file onto the robot controller by using the method "PutFile")

    Example:
                    //copy the log file to the selected folder
                    _abbCtrl.FileSystem.PutFile(strTempFile, _saveFileDialog.FileName);

    If you want to read the data of a file which is located on the robot controller you have to copy the file to the local filesystem (Method GetFile) before you can read the data.

    The reading and writing on a VC is working because you are the same storage device

    BR
    Micky