I don't think one encoder will do. To match speed of the axis
(electronic gearing) you will need two encoders, one on your
system (follower) and one on primary axis (master).
The speed difference of two can be used as input to
control the motor of the follower.
I didnt use your card so I cannot help with some code but
manual for the card should have plenty of samples.
Hope this helps