How can I connect an Arduino to modbus to control step motor driver

I need to connect an arduino to step driver. But I need to generate a step & direction or step & step and it needs to be connected to modbus. but it needs to be compatible with mach3

have a look at
https://www.cooking-hacks.com/documentation/tutorials/modbus-module-shield-tutorial-for-arduino-raspberry-pi-intel-galileo/

butt i thought abought some thing like this

butt it doesnt talk how to generate the step & direction