Gearmotors EMG30 encoder with MD25

i need help on programming a EMG30 gear motor with a MD25 drive

am using the sample code made by James Henderson "MD25 RD02 Motor Controller Serial" from the robot-electronics.co.uk website

but i have no idea why it doesn't work. actually most of the codes for the EMG30 which are on blogs are out data or have error when uploading them. some help would be great.

link below look at "MD25 RD02 Motor Controller Serial" setup:
http://www.robot-electronics.co.uk/htm/arduino_examples.htm#MD25%20RD02%20Motor%20Controller

code:
http://www.robot-electronics.co.uk/files/arduino_md25_serial.ino