diff options
Diffstat (limited to 'Software/Stubs Collection/Procedures/Winder Calibration.txt')
| -rw-r--r-- | Software/Stubs Collection/Procedures/Winder Calibration.txt | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Software/Stubs Collection/Procedures/Winder Calibration.txt b/Software/Stubs Collection/Procedures/Winder Calibration.txt index a06e94e31..722284f91 100644 --- a/Software/Stubs Collection/Procedures/Winder Calibration.txt +++ b/Software/Stubs Collection/Procedures/Winder Calibration.txt @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; @@ -32,26 +32,28 @@ public class Program MotorHomingRequest motorHomingRequest = new MotorHomingRequest(); motorHomingRequest.MotorType = Tango.PMR.Hardware.HardwareMotorType.MotoScrew; motorHomingRequest.Speed = 800; - motorHomingRequest.Direction = Tango.PMR.Diagnostics.MotorDirection.Backward; + motorHomingRequest.Direction = Tango.PMR.Diagnostics.MotorDirection.Forward; offset = context.GetInput<int>("Initial Offset"); StubMotorMovRequest stubMotorMovRequest = new StubMotorMovRequest(); stubMotorMovRequest.MotorID = SCREW_MOTOR; - stubMotorMovRequest.Direction = true; + stubMotorMovRequest.Direction = false; while (Located == false) { context.Send<MotorHomingResponse>(motorHomingRequest); - Thread.Sleep(3000); - stubMotorMovRequest.Position = (uint)(offset + Calibration_Offset); + Thread.Sleep(2000); + stubMotorMovRequest.Position = (uint)((offset + Calibration_Offset)*16); + //stubMotorMovRequest.Direction = context.Send<StubMotorMovResponse>(stubMotorMovRequest); - Thread.Sleep(3000); + Thread.Sleep(1000); + Located = context.RequestUserInputFor<bool>(Located,"Is Winder located well?","Please fill in the form"); - Located = context.GetInput<bool>("Is Winder located well?"); + if (Located == false) { - offset = context.GetInput<int>("Enter new value for calibration offset (15 steps = 1mm. minus - toward the machine"); + Calibration_Offset = context.RequestUserInputFor<int>(Calibration_Offset,"Enter new value for calibration offset"," (15 steps = 1mm. minus - toward the machine"); } } @@ -59,7 +61,7 @@ public class Program progressRequest.Amount = 0xB20; progressRequest.Delay = Calibration_Offset; context.Send<ProgressResponse>(progressRequest); - box_msg = "Writing new winder offset " + Calibration_Offset+ "to the main card EEPROM"; + box_msg = "Writing new winder offset " + Calibration_Offset+ " to the main card EEPROM"; MessageBox.Show(box_msg); } |
