FPSDK 5.15 - EventLogCategory[ ] GetCategories()
Hi,
I need of automatically write all Event message about the controller where run my FP application on a .csv file.
I using EventLog class and in particular this code to get message event from controller:
{
this.cntrl = new Controller();
System.IO.StreamWriter fileSTRM = new System.IO.StreamWriter(cntrl.FileSystem.RemoteDirectory+"/cLog.csv", false, System.Text.Encoding.Unicode);
fileSTRM.AutoFlush = true;
fileSTRM.WriteLine(WriteColumnHeader());
EventLogCategory[] eCategories = cntrl.EventLog.GetCategories();
foreach (EventLogCategory ev_cat in eCategories)
{
foreach (EventLogMessage ms in ev_cat.Messages)
{
fileSTRM.WriteLine(EventLogMessageToString(ms));
}
}
fileSTRM.Flush();
fileSTRM.Close();
fileSTRM = null;
return false;
}
The problem is that the numers of messages gets from EventLog.GetCategories() is not the same as i get (and save) the message manually from event panel of FlexPendat or Robostudio Online.
I have made many test on virtual controller and always the messages gets from Robostudio Online is much more that
i get from EventLog.GetCategories(). Why this? maybe is a bug?
There is some way to automatically get all event messages from controller and save it (reparsed) on a file by scheduling (for example every week)?
In attachment there is a example code project build with VS2005, the eventLog created from my app. and the .log saved from Robostudio Online of same virtual controller.
webwiz/3572/WriteLogTest.zip
regars
Ecapitanio
I need of automatically write all Event message about the controller where run my FP application on a .csv file.
I using EventLog class and in particular this code to get message event from controller:
{
this.cntrl = new Controller();
System.IO.StreamWriter fileSTRM = new System.IO.StreamWriter(cntrl.FileSystem.RemoteDirectory+"/cLog.csv", false, System.Text.Encoding.Unicode);
fileSTRM.AutoFlush = true;
fileSTRM.WriteLine(WriteColumnHeader());
EventLogCategory[] eCategories = cntrl.EventLog.GetCategories();
foreach (EventLogCategory ev_cat in eCategories)
{
foreach (EventLogMessage ms in ev_cat.Messages)
{
fileSTRM.WriteLine(EventLogMessageToString(ms));
}
}
fileSTRM.Flush();
fileSTRM.Close();
fileSTRM = null;
return false;
}
The problem is that the numers of messages gets from EventLog.GetCategories() is not the same as i get (and save) the message manually from event panel of FlexPendat or Robostudio Online.
I have made many test on virtual controller and always the messages gets from Robostudio Online is much more that
i get from EventLog.GetCategories(). Why this? maybe is a bug?
There is some way to automatically get all event messages from controller and save it (reparsed) on a file by scheduling (for example every week)?
In attachment there is a example code project build with VS2005, the eventLog created from my app. and the .log saved from Robostudio Online of same virtual controller.
webwiz/3572/WriteLogTest.zip
regars
Ecapitanio
0
Comments
-
UP0
-
UP!0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings