Is it possible to determine that no motor is connected? I have written a program that will successfully move a linear drive when the motor is connected. However, when I disconnect the motor completely (i.e. nothing attached to OA1, OA2, OB1, or OB2) the code runs as though there were a motor attached, except that this (phantom) motor never stalls. In normal operation it would stall when the drive encounters the limit of travel in either direction. My code checks the following flags:
In addition, the program monitors Motion and ActualPos. I am not checking OVC1 or OVC2, since 1) these flags seem to be used to set ElDef, and 2) I don't expect an open circuit to draw any current at all.
Basically, the program sets up the motor and stall parameters, resets the position so that wherever the motor is at the moment is position 0, then sets up a new position of -32768. This will definitely make the drive hit the left barrier. When the stall is identified, the next position is +32767, so the drive will definitely hit the right barrier. Finally, the drive is positioned half-way between the two barriers, and the limits are reported. This works fine with a motor attached. Without the motor, the program performs the same operation, including reporting the limits, which now correspond to -32768 and +32767. While the motor is running the program is in a tight loop reading FullStatus1 and FullStatus2, and checking the flags mentioned above.