@OSM:
I don't understand how they are encoded
Depends how good your coding skills are but take a look at: https://github.com/nckstwrt/CM0102Pa.../master/CM2.cs (specifically functions like ConvertShortToCM2Format - the code I wrote for this is awful - but does work at least )