I have a PC application that among other things need to display the Flexpendant Eventlog. In the past i used the CategoryType method from the Evenlog class, but apparently that method is now Obsolete along with the entire CategoryType class.
The old way..
Does anyone have an idea how to do it the new way? Because i have tried using the new method GetCategories(). But this gives me an exception(One of the identified items was in an invalid format.)
then enumeration of event log categories was made obsolete as part of an extension to RobotWare which made it possible for applications to add their own categories.
However in FlexPendant SDK the enumeration is still there. Probably the “old built in” categories will never change their id number, and in this case the enum could actually be used anyway. And for the dynamic categorieis you have to use the id number.
Currently the PC SDK and FlexPendant SDK handles this situation in a different way.
I’ve been discussing this with one of our architechts, to decide if the “FP or PC SDK way” is the correct one.
I’ve been using code like the following as a workaround:
Thank you Daniel, you have found a bug. This has been working fine for me before. Does your code execute on a 64-bit OS?
On order to find out which categories exists, PC SDK needs to read an XML file on the controller, and when doing this a exception is thrown. I can see that for example from this line in the callstack:
Yes, I do have a x64 win7 OS, but the target platform under project properties is x86. I reckon using ANY CPU/x64 will generate even bigger problems. I’m installing VS 2008 on a xp 32bit machine beside me right now to see if the same problem occurs.
Allright, I will report this to the robotic support. Please contact me if you find a temporary solution Niklas.
it is correct that the target platform shall be set to x86.
We have found a similar problems in PC-SDK/Virtual Controller where another method, which needed to “download a file to the FlexPendant” threw a similar exception.
That is not related to the code you are building.
Please go ahead and report all those related problems to support.
Basically there are two issues, 1) The CategoryType property which is obsolete, throws an exception while being called. 2) When trying my workaround, using GetCategories() you get an exception from that method, probably related to 64-bit OS.
Besides trying on a 32-bit XP machine you can also try connecting your application to a real controller if you have one available.
I’ll try and move the entire project to an xp machine, and try to connect to a real robot during next week. If I should get a different result I’ll let you know : )
the problem causing the excpetion on 64-bit machines has been found and fixed. It will be available in PC SDK 5.13.02 which is released in a couple of weeks.
The path to program files includes “()” on 64 bit OS. → Program Files (x86).
The “(” and “)” caused the problem. But I guess renaming your “Program Files (x86)” to for example “Program Files x86”, is not a tempting workaround, especially since you do not need to wait long for the fix.