Hi,
The KStep Opto Inputs require a small amount of time (a few time slices) to be fully configured and to begin updating. So the inputs should not be tested until a short time after KFLOP is informed that a KStep is present. KStep Opto Inputs will be 0 after power up until updated which is your condition for EStop. Try adding a 10 millisecond delay after setting KStepPresent such as:
Code:
KStepPresent=TRUE;
Delay_sec(0.01);
We don't recommend Flashing anything to KFLOP. See here. You can restore KFLOP to its original state by re-Flashing New Version.
Note this code is not indented properly and confusing using double NOTs.
Code:
// if ESTOP present disable any enabled Axis ??
if (!ReadBit(ESTOP_BIT)!=0)
Simpler would be:
Code:
// if ESTOP present disable any enabled Axis ??
if (ReadBit(ESTOP_BIT)==0)
HTH