Have you read Chapter 13 of GFK1504? That's the manual for the MDD841.
You connect your A and B signals from the encoder to teminals B1 and B3 on the module carrier. I hope the encoder is a 24 VDC model because that's what the module needs. You'll also need to connect the DC- to terminal B17.
Most of what you need to do to set up the module is done in hardware configuration. That's where you set it up for 1 Type B (quadrature) and two Type A (Pulse/direction) operation. Default setup is 4 Type A operation. It's also where you set the timebase for the rate data.
The accumulated count value will show up in the sixth of thirteen %AI words assigned to the counter in hardware configuration. The count rate will show up in the second %AI word.