How to get the RobotStudio Error Code from EventLogDomain in PC SDK?

I would like to get the Error code “50050” from Robotstudio and perform some operations in RAPID via PC SDK.
From the EventLogMessage class, I can access only limited information about the message.
The number and sequence number properties are not unique to process.

How can I get the error code ?

Thanks in advance.

Hi, im nearly on the same problem. What informationen you get out with the EventLogMessage class?

Hello,
I’ve used RobotStudio.API.Internal.EventLogMessage

With that, you can get .Msg.Domain and .Msg.Number.

You can found an example here:
https://github.com/DenisFR/RSDrawGraphics/blob/master/RSDrawGraphics/RSDrawGraphics.cs#L669

Hello @DenisFR,
I have problem using the assembly that you shared. From the message number, I could see the last two digits map to the Error Code from Robotstudio.
Please correct me if I am wrong,

Hello peterj,
Here is the information from the EventLogMessage for an error in Singularity

I would like to have your inputs as well if this is correct.
Thanks in advance.

Yes.
In your case you will have:
(eventLogMessage.Msg.Domain == 5) && (eventLogMessage.Msg.Number == 26)

You have problem to compile it or to run it from RobApps?

Hello @DenisFR

I did not have any problem in compiling my application.
I just wanted to extract the error code and do some operations in my application based on the error code.
I got the answer from you.
Thanks a lot.

Msg.Number is not the same as error code, Can anyone tell me how to get the error code such as “50050”

I got, the error code is error type * 10000 + number