[ENC0 F0 D12345 ...] this is only part of the function should be [ENCO M10 D8 K3] this decodes the 8 bits from M10 (to M17) & gives a decimal value in D8
i.e. if M13 is on then this being bit 3 (M10 being bit 0) then D8 will have a value of 3 M18 will give a result of 4 etc.
the manual is here: http://www.mitsubishi-automation.co.uk/
This function basically checks a bit on in a range