TrakHound / MTConnect.NET

Fully featured .NET library in C# to build MTConnect Agent, Adapter, and Client Applications. Pre-built Agents with Windows Installers. Support for Windows and Linux. Supports MTConnect Versions up to 2.3. Supports .NET Framework 4.6.1 up to .NET 8
http://www.TrakHound.com
MIT License
99 stars 39 forks source link

Message Event is delivered with a wrong structure #51

Closed benaish closed 8 months ago

benaish commented 1 year ago

Hi,

My Device.XML contains the following data item:

<DataItem name="XYZ" id="abc" category="EVENT" type="MESSAGE" />

When running an http agent, it appears as:

<Message dataItemId="abc" name="XYZ" sequence="614" timestamp="2023-08-17T07:57:38.6792431Z" nativeCode="Idle "/>

The expected result was:

<Message dataItemId="abc" name="XYZ"  sequence="614" timestamp="2023-08-17T07:57:38.6792431Z">Idle</Message>

Is this a bug, or am I missing something? I'm using version 5.4.0

Thanks!

PatrickRitchie commented 1 year ago

Moshe,

Looks like some of your comment is not showing up. See if you can edit and I'll look into what the issue is.

Thanks, -Patrick

benaish commented 1 year ago

Moshe,

Looks like some of your comment is not showing up. See if you can edit and I'll look into what the issue is.

Thanks, -Patrick

Updated

PatrickRitchie commented 1 year ago

Is this data coming from a SHDR Adapter? If so, you will need to use the ShdrMessage class instead of the ShdrDataItem class in the Adapter as that will output the correct format for MESSAGE as this has a special NativeCode attribute. If the data is coming from somewhere else (ex. another agent) then this could be an issue that I need to fix.

Thanks, -Patrick