diff --git a/libEDSsharp/CanOpenXDD.cs b/libEDSsharp/CanOpenXDD.cs index bd8398b9..165036ca 100644 --- a/libEDSsharp/CanOpenXDD.cs +++ b/libEDSsharp/CanOpenXDD.cs @@ -517,10 +517,8 @@ public ISO15745ProfileContainer convert(EDSsharp eds) AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].edseditor_extension_notifyonchange = subod.prop.CO_flagsPDO; - if (od.objecttype == ObjectType.ARRAY && count != 0) - bytes = BitConverter.GetBytes((UInt16)od.datatype); - else - bytes = BitConverter.GetBytes((UInt16)subod.datatype); + bytes = (subod.datatype == DataType.UNKNOWN && od.parent != null) ? BitConverter.GetBytes((UInt16)od.parent.datatype) : BitConverter.GetBytes((UInt16)subod.datatype); + Array.Reverse(bytes); // hack - special handling for rrw / rww access type