@moe-adams9093 If your VFD is similar to mine (typical huanyang VFD...) the forward and reverse pin on it need to be shorted, not sent a signal like you are trying to do with the outputs. For that to work you need to use a relay with the duet output on the command side and the VFD DCom + For/Rev on the other. I used this kind of relays: https://www.amazon.fr/gp/product/B07BVXT1ZK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 and it worked fine for me. Also as there is two outputs (one is NC and the other NO) you don't need to use two outputs on the Duet, you can use just one and write the NC to FOR and NO to REV (or the other way around, I don't remember which one I did, but it's an easy fix).
To control the speed I used a PWM to 10V converter that is plugged to the VFD output of the duet.
My Duet spindle configuration then looks like this:
; Define the Spindle VFD
M950 R0 C"vfd+nil+io4.out" Q2000 L0:24000 K0:1
(the vfd output sets the speed, the output 4 sets the direction).
It took me ages to find the correct setup but now it works beautifully.
PS: I'm on a Duet3 6HC, so there may be differences to what you use.. You can see the rest of my config with a rapid change ATC here: https://github.com/meeloo/Duet3Config