Get an exception when trying to load txt file using PutFile
 
            
                
                    egor                
                
                     ✭                
            
                        
            Hi, 
I'm trying to load listbox items names from database.txt, which is located in the HOME/Database directory on real robot controller.
I get an exception "SYS_CTRL_E_FILE_NOT_FOUND" (File not found or could not be opened for reading). What am I doing wrong?
//Creating controller object
I'm trying to load listbox items names from database.txt, which is located in the HOME/Database directory on real robot controller.
I get an exception "SYS_CTRL_E_FILE_NOT_FOUND" (File not found or could not be opened for reading). What am I doing wrong?
//Creating controller object
        public static Controller aController = new Controller();
                        //Loading listbox items from txt
        private void TpsViewDatabase_Load(object sender, EventArgs e)
        {
            //Accessing files and directories
            FileSystem aFileSystem = aController.FileSystem;
            //Creating  remote directory
            aController.FileSystem.RemoteDirectory = "HOME/Database";
            string remoteDir = aController.FileSystem.RemoteDirectory;
            aController.FileSystem.LocalDirectory = "c:/temp";
            //Saving txt to controller remote directory
            aController.FileSystem.PutFile("database.txt", remoteDir);
                using (StreamReader sw = new StreamReader(remoteDir + "/database.txt"))
                {
                    listViewItem1.Text = sw.ReadLine();
                    listViewItem2.Text = sw.ReadLine();
                    listViewItem3.Text = sw.ReadLine();
                    ...
                }
            }
        }
        //Exiting
        private void button1_Click(object sender, EventArgs e)
        {
            //this.Hide();
            this.CloseMe();
            if (aController != null)
            {
                aController.Dispose();
                aController = null;
            }
        }
Regards
Regards
0  
            Categories
- All Categories
- 5.6K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 15 RobotApps
- 306 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.9K Robot Controller
- 363 IRC5
- 80 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 853 RAPID Programming
- 31 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 110 Collaborative Robots
- 5 Job listings