X axis not moving at all the signal get cut of

First of all have a magical day dear inventable team I had never experienced anything like this during my previous work. job almost done end of the work at this time didn’t go back to home position and after stop to move when I check it out I figure out something was going wrong and I couldn’t solve this problem with xcarve, x controller so please I want you to help me with this problem When I do the Direction Trial test, the X Axis stepper motor is get disabled when the signal is gone and it does not move any more I tried it in the machine settings also but didn’t work
I changed the cables with the Z Axis just to see if X Axis stepper motor works or not thanks god was in good condition, When I connect another motor to this output it starts to move but in a different direction so I try many way to fix it but I don’t know what to do more than that,
What can you suggest me to do? Thank you in advance for your help sincere greetings.