How to send the encoder/ pulses over serial port of 8051

I want to send the real time data of Manual pulse generator (CNC Handwheel pulse generator which generate two different square pulses)  through 8051 uart port, is it possible? 

I have two 8051, one used for getting signal from MPG(manual pulse generator) and sending that data through UART and another 8051 used for receiving the serial Data from previous 8051 and send that data to PORT1.

Please help!!

Thanks in Advance

Vignesh VSG