What PLC? and are you using an analogue module and a counter module for encoder?
Why is the speed not zero when the command is zero?
The balance control on the drive should be adjusted first to achieve zero speed whith zero voltage at analogue input. (jumper input terminals in order to zero).
What type of drive, Velocity (tach F.B.) or Torque Mode?
Are you trying to set up a PID loop? their are dedicated PLC cards for this purpose.