Example of a BCD conversion for M-code logic in typical machine tools using allen bradley PLC ladder software. PLC ladder