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.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings