When the app is launched, the operator presses the "home" button to home the motor (Case 0 of code). The motor position is reset to 0 after homing. Then a specimen is loaded into the fixture, the "Run test" button is pushed (Case 1), the motor rotates to 45 degrees, then returns to the 0 position (Case 2). Everything worked well.
Then someone noticed a problem.
When the motor is at home, the fixture is not perpendicular to the load cell. Using MAX I found that it is -1600 motor steps off. (The home switch is not mechanically adjustable. Not my design)
Simple enough (I thought), I'll just have a case that runs after homing (Case 0) to move the motor -1600 steps. (Case 3).
What happens is, after homing is complete (Case 0), the motor rotates until a forward limit is reach and the expected error pops up. Conclusion: Case 3 does not run consecutively after case 0.
If I "Home" (and do not execute Case 3) then hit "Run Test" (Case 1) the test runs and returns home as intended. THEN if I run case 3 to move the motor -1600 steps, the motor move the -16600 steps no problem.
What do I need to do to perform two moves (home then move another -1600 steos) by pressing only one button?
Note: If I "Home" then try to move -1600 steps, the motor rotates until the forward limit and errors.