First thing is you do not have Step/Dir inputs on the drives, they will be analogue +/-10v, that is why you will need to use an IP-A controller.
The TG will be Tacho Generator, basically a means of the drive knowing the rotational speed of the motor and will be integral to the motor and will come out on two wires.
In the above drawing it looks like you have an encoder also on the motor, the B A C D E F wires, can you find them in the cabinet as they likely go to the drive and could well be Encoder signals. I would assume C and D are the power to the encoder and A and B are the A and B channels of the encoder but not sure about E and F. If there had been another wire I would have said it was hall signals, maybe the manual will shed some more light on it.
This seems to be the standard drives manual
http://www1.yaskawa.com/site/dmservo.nsf/link2/TKUR-5EJQ5Z/$file/TSE-C717-13E.pdf
I have not had a chance to look at it yet.
Hood