I'm working on converting my Mach 3 controlled 4 axis mill (XYZA). It has a Break out board which takes Step/Dir signals for the spindle and outputs 10V and on/off signal to control the VFD.

Working: I can get Step and Dir for XYZA to output.

Problem: I cannot get the Dir signal to output for spindle. Step works great in the Console using Jog4=2000, as well as in KmotionCNC using "on CW" and "on CCW"

Settings:

I'm using these programs for spindle:
M3 SpindleOnCWJogV2.c
M4 SpindleOnCWWJogV2.c
M5 SpindleOffJogV2.c
S SpindleMillJogV2.c

Spindle .c file headers:
Code:
#include "KMotionDef.h"

#define SPINDLEAXIS 4
#define FACTOR (1000/60.0) //1000 counts/sec / 1000 counts/rev = 1 RPS = 60 RPM
#define SPINDLECW_BIT 38
#define SPINDLECCW_BIT 39
#define SPEEDVAR 99
#define STATEVAR 98
#define KMVAR 1
Init.c contains:
Code:
	SetBitDirection(38,1); // Set Bit 38 as an Output
	SetBitDirection(39,1); // Set Bit 39 as an Output
I don't see any change when I turn on the spindle while probing J5 pins 3 and 43 (bits 38 and 39)

Right now I am using a simple USB logic analyzer to monitor the outputs of the KFLOP.
I don't think I need pull-ups on J5 since they are LVTTL, correct?

DefineCoordSystem(01234)

I feel like i'm so close to getting it. I don't really know much about coding in C, but can follow most of it.

Anyway any help would be great.

Thanks,

Steven