1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367:
| public class Form1 : Form { private ToolStrip toolStrip1; private ToolStripComboBox toolStripComboBox1;
public Form1() { Label lbl_ServoMotoren = new Label(); lbl_ServoMotoren.Text = "Servo-Motoren"; lbl_ServoMotoren.Size = new Size(150, 20); lbl_ServoMotoren.Location = new Point(1000, 240); this.Controls.Add(lbl_ServoMotoren); lbl_ServoMotoren.Click += new EventHandler(ServoMotoren_Einblenden); } void ServoMotoren_Einblenden(object sender, EventArgs e) { Label InitServo1Achse1, FahrenPosServo1Achse1, SendeDaten, Enable_Servo1Achse1, SoftStop_Servo1Achse1, HardStop_Servo1Achse1, StartMov_Servo1Achse1, ClearWarning_Servo1Achse1, ClearAlarm_Servo1Achse1, PositionEingabe_Servo1Achse1, GeschwindigkeitEingabe_Servo1Achse1;
Label EmpfangeneDaten, HomingDone_Servo1Achse1, TargetPosition_Servo1Achse1, WarningPresent_Servo1Achse1, AlarmPresent_Servo1Achse1, AktPosition_Servo1Achse1, WarnCode_Servo1Achse1, AlarmCode_Servo1Achse1;
Button btnInitServo1Achse1, btnFahrenPosServo1Achse1, btnEnableServo1Achse1, btnSoftStopServo1Achse1, btnHardStopServo1Achse1, btnStartMovServo1Achse1, btnClearWarningServo1Achse1, btnClearAlarmServo1Achse1;
Button btnHomingDoneServo1Achse1, btnTargetPositionServo1Achse1, btnWarningServo1Achse1, btnAlarmServo1Achse1; TextBox tbxPosEingabe_Servo1Achse1, tbxGeschwEingabe_Servo1Achse1, tbxAktPosBerechnung_Servo1Achse1, tbxWarnCodeAnzeige_Servo1Achse1, tbxAlarmCodeAnzeige_Servo1Achse1;
toolStrip1 = new System.Windows.Forms.ToolStrip(); toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox(); toolStrip1.SuspendLayout(); SuspendLayout(); toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripComboBox1}); toolStrip1.Location = new System.Drawing.Point(1200, 150); toolStrip1.Name = "Servomotor-Auswahl"; toolStrip1.Size = new System.Drawing.Size(140, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; toolStripComboBox1.AutoCompleteCustomSource.AddRange(new string[] { "Servo1 - Achse1", "Servo2 - Achse2", "Servo3 - Achse3", "Servo4 - Achse4", "Servo5 - Achse5", "Servo6 - Achse6", "Servo7 - Achse7", "Servo8 - Achse8", "Servo9 - Achse9", "Servo10 -Achse10", "Servo1 - AchseSäge1", "Servo2 - AchseSäge2", "Servo3 - AchseAbdeckkeder1" }); toolStripComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; toolStripComboBox1.DropDownHeight = 110; toolStripComboBox1.DropDownWidth = 122; toolStripComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard; toolStripComboBox1.IntegralHeight = false; toolStripComboBox1.Items.AddRange(new object[] { "Servo1 - Achse1", "Servo2 - Achse2", "Servo3 - Achse3", "Servo4 - Achse4", "Servo5 - Achse5", "Servo6 - Achse6", "Servo7 - Achse7", "Servo8 - Achse8", "Servo9 - Achse9", "Servo10 - Achse10", "Servo1 - AchseSäge1", "Servo2 - AchseSäge2", "Servo3 - AchseAbdeckkeder1" }); toolStripComboBox1.MaxDropDownItems = 9; toolStripComboBox1.MergeAction = System.Windows.Forms.MergeAction.Insert; toolStripComboBox1.Name = "toolStripComboBox1"; toolStripComboBox1.Size = new System.Drawing.Size(121, 25); toolStripComboBox1.Sorted = true; toolStripComboBox1.SelectedIndex = 0; Servomotor = toolStripComboBox1.SelectedItem.ToString();
toolStripComboBox1.SelectedIndexChanged += new EventHandler(toolStripComboBox1_selectedIndexServoMotorChanged);
this.Controls.Add(toolStrip1); toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout();
InitServo1Achse1 = new Label(); InitServo1Achse1.Location = new Point(1200, 200); InitServo1Achse1.Name = "Initialisierung Servo"; InitServo1Achse1.Size = new Size(60, 20); InitServo1Achse1.Text = "Init Servo"; this.Controls.Add(InitServo1Achse1);
btnInitServo1Achse1 = new Button(); btnInitServo1Achse1.Location = new Point(1270, 200); btnInitServo1Achse1.Name = "Button Init Servo1Achse1"; btnInitServo1Achse1.Size = new Size(20, 20); btnInitServo1Achse1.Text = ""; this.Controls.Add(btnInitServo1Achse1); btnInitServo1Achse1.Click += new EventHandler(btn_InitServo1Achse1_Click);
FahrenPosServo1Achse1 = new Label(); FahrenPosServo1Achse1.Location = new Point(1300, 200); FahrenPosServo1Achse1.Name = "Fahren auf Pos"; FahrenPosServo1Achse1.Size = new Size(80, 20); FahrenPosServo1Achse1.Text = "Fahren auf Pos"; this.Controls.Add(FahrenPosServo1Achse1);
btnFahrenPosServo1Achse1 = new Button(); btnFahrenPosServo1Achse1.Location = new Point(1390, 200); btnFahrenPosServo1Achse1.Name = "Button FahrenPos Servo1Achse1"; btnFahrenPosServo1Achse1.Size = new Size(20, 20); btnFahrenPosServo1Achse1.Text = ""; this.Controls.Add(btnFahrenPosServo1Achse1); btnFahrenPosServo1Achse1.Click += new EventHandler(btn_FahrenPosServo1Achse1_Click);
SendeDaten = new Label(); SendeDaten.Location = new Point(1200, 250); SendeDaten.Name = "Daten senden"; SendeDaten.Size = new Size(80, 20); SendeDaten.Text = "Sende Daten"; this.Controls.Add(SendeDaten);
Enable_Servo1Achse1 = new Label(); Enable_Servo1Achse1.Location = new Point(1200, 280); Enable_Servo1Achse1.Name = "Enable Servo1Achse1"; Enable_Servo1Achse1.Size = new Size(80, 20); Enable_Servo1Achse1.Text = "Enable"; this.Controls.Add(Enable_Servo1Achse1);
btnEnableServo1Achse1 = new Button(); btnEnableServo1Achse1.Location = new Point(1290, 280); btnEnableServo1Achse1.Name = "Button Enable Servo1Achse1"; btnEnableServo1Achse1.Size = new Size(20, 20); btnEnableServo1Achse1.Text = ""; this.Controls.Add(btnEnableServo1Achse1); btnEnableServo1Achse1.Click += new EventHandler(btn_EnableServo1Achse1_Click);
SoftStop_Servo1Achse1 = new Label(); SoftStop_Servo1Achse1.Location = new Point(1200, 310); SoftStop_Servo1Achse1.Name = "SoftStop Servo1Achse1"; SoftStop_Servo1Achse1.Size = new Size(80, 20); SoftStop_Servo1Achse1.Text = "Soft Stop (F)"; this.Controls.Add(SoftStop_Servo1Achse1);
btnSoftStopServo1Achse1 = new Button(); btnSoftStopServo1Achse1.Location = new Point(1290, 310); btnSoftStopServo1Achse1.Name = "Button SoftStop Servo1Achse1"; btnSoftStopServo1Achse1.Size = new Size(20, 20); btnSoftStopServo1Achse1.Text = ""; this.Controls.Add(btnSoftStopServo1Achse1); btnSoftStopServo1Achse1.Click += new EventHandler(btn_SoftStopServo1Achse1_Click);
HardStop_Servo1Achse1 = new Label(); HardStop_Servo1Achse1.Location = new Point(1200, 340); HardStop_Servo1Achse1.Name = "HardStop Servo1Achse1"; HardStop_Servo1Achse1.Size = new Size(80, 20); HardStop_Servo1Achse1.Text = "Hard Stop (F)"; this.Controls.Add(HardStop_Servo1Achse1);
btnHardStopServo1Achse1 = new Button(); btnHardStopServo1Achse1.Location = new Point(1290, 340); btnHardStopServo1Achse1.Name = "Button HardStop Servo1Achse1"; btnHardStopServo1Achse1.Size = new Size(20, 20); btnHardStopServo1Achse1.Text = ""; this.Controls.Add(btnHardStopServo1Achse1); btnHardStopServo1Achse1.Click += new EventHandler(btn_HardStopServo1Achse1_Click);
StartMov_Servo1Achse1 = new Label(); StartMov_Servo1Achse1.Location = new Point(1320, 280); StartMov_Servo1Achse1.Name = "StartMoving Servo1Achse1"; StartMov_Servo1Achse1.Size = new Size(60, 20); StartMov_Servo1Achse1.Text = "Start Mov"; this.Controls.Add(StartMov_Servo1Achse1);
btnStartMovServo1Achse1 = new Button(); btnStartMovServo1Achse1.Location = new Point(1390, 280); btnStartMovServo1Achse1.Name = "Button StartMoving Servo1Achse1"; btnStartMovServo1Achse1.Size = new Size(20, 20); btnStartMovServo1Achse1.Text = ""; this.Controls.Add(btnStartMovServo1Achse1); btnStartMovServo1Achse1.Click += new EventHandler(btn_StartMovServo1Achse1_Click);
ClearWarning_Servo1Achse1 = new Label(); ClearWarning_Servo1Achse1.Location = new Point(1320, 310); ClearWarning_Servo1Achse1.Name = "ClearWarning Servo1Achse1"; ClearWarning_Servo1Achse1.Size = new Size(60, 20); ClearWarning_Servo1Achse1.Text = "Clear War."; this.Controls.Add(ClearWarning_Servo1Achse1);
btnClearWarningServo1Achse1 = new Button(); btnClearWarningServo1Achse1.Location = new Point(1390, 310); btnClearWarningServo1Achse1.Name = "Button Clear Warning Servo1Achse1"; btnClearWarningServo1Achse1.Size = new Size(20, 20); btnClearWarningServo1Achse1.Text = ""; this.Controls.Add(btnClearWarningServo1Achse1); btnClearWarningServo1Achse1.Click += new EventHandler(btn_ClearWarningServo1Achse1_Click);
ClearAlarm_Servo1Achse1 = new Label(); ClearAlarm_Servo1Achse1.Location = new Point(1320, 340); ClearAlarm_Servo1Achse1.Name = "ClearAlarm Servo1Achse1"; ClearAlarm_Servo1Achse1.Size = new Size(60, 20); ClearAlarm_Servo1Achse1.Text = "Clear Alarm"; this.Controls.Add(ClearAlarm_Servo1Achse1);
btnClearAlarmServo1Achse1 = new Button(); btnClearAlarmServo1Achse1.Location = new Point(1390, 340); btnClearAlarmServo1Achse1.Name = "Button Clear Alarm Servo1Achse1"; btnClearAlarmServo1Achse1.Size = new Size(20, 20); btnClearAlarmServo1Achse1.Text = ""; this.Controls.Add(btnClearAlarmServo1Achse1); btnClearAlarmServo1Achse1.Click += new EventHandler(btn_ClearAlarmServo1Achse1_Click);
PositionEingabe_Servo1Achse1 = new Label(); PositionEingabe_Servo1Achse1.Location = new Point(1430, 280); PositionEingabe_Servo1Achse1.Name = "Position Servo1Achse1"; PositionEingabe_Servo1Achse1.Size = new Size(80, 20); PositionEingabe_Servo1Achse1.Text = "Position [mm]"; this.Controls.Add(PositionEingabe_Servo1Achse1);
tbxPosEingabe_Servo1Achse1 = new TextBox(); tbxPosEingabe_Servo1Achse1.Location = new Point(1520, 280); tbxPosEingabe_Servo1Achse1.Name = "EingabePosition Servo1Achse1"; tbxPosEingabe_Servo1Achse1.Text = "0,000"; tbxPosEingabe_Servo1Achse1.Size = new Size(50, 20); this.Controls.Add(tbxPosEingabe_Servo1Achse1);
GeschwindigkeitEingabe_Servo1Achse1 = new Label(); GeschwindigkeitEingabe_Servo1Achse1.Location = new Point(1430, 310); GeschwindigkeitEingabe_Servo1Achse1.Name = "Geschwingkeit Servo1Achse1"; GeschwindigkeitEingabe_Servo1Achse1.Size = new Size(80, 20); GeschwindigkeitEingabe_Servo1Achse1.Text = "Speed [mm/s]"; this.Controls.Add(GeschwindigkeitEingabe_Servo1Achse1);
tbxGeschwEingabe_Servo1Achse1 = new TextBox(); tbxGeschwEingabe_Servo1Achse1.Location = new Point(1520, 310); tbxGeschwEingabe_Servo1Achse1.Name = "EingabeGeschwindigkeit Servo1Achse1"; tbxGeschwEingabe_Servo1Achse1.Text = "0,00"; tbxGeschwEingabe_Servo1Achse1.Size = new Size(50, 20); this.Controls.Add(tbxGeschwEingabe_Servo1Achse1);
EmpfangeneDaten = new Label(); EmpfangeneDaten.Location = new Point(1200, 380); EmpfangeneDaten.Name = "Daten empfangen"; EmpfangeneDaten.Size = new Size(120, 20); EmpfangeneDaten.Text = "Empfangene Daten"; this.Controls.Add(EmpfangeneDaten);
HomingDone_Servo1Achse1 = new Label(); HomingDone_Servo1Achse1.Location = new Point(1200, 410); HomingDone_Servo1Achse1.Name = "HomingDone Servo1Achse1"; HomingDone_Servo1Achse1.Size = new Size(80, 20); HomingDone_Servo1Achse1.Text = "Homing Done"; this.Controls.Add(HomingDone_Servo1Achse1);
btnHomingDoneServo1Achse1 = new Button(); btnHomingDoneServo1Achse1.Location = new Point(1290, 410); btnHomingDoneServo1Achse1.Name = "Button HomingDone Servo1Achse1"; btnHomingDoneServo1Achse1.Size = new Size(20, 20); btnHomingDoneServo1Achse1.Text = ""; this.Controls.Add(btnHomingDoneServo1Achse1); btnHomingDoneServo1Achse1.Click += new EventHandler(btn_HomingDoneServo1Achse1_Click);
TargetPosition_Servo1Achse1 = new Label(); TargetPosition_Servo1Achse1.Location = new Point(1200, 440); TargetPosition_Servo1Achse1.Name = "TargetPosition Servo1Achse1"; TargetPosition_Servo1Achse1.Size = new Size(80, 20); TargetPosition_Servo1Achse1.Text = "Target Position"; this.Controls.Add(TargetPosition_Servo1Achse1);
btnTargetPositionServo1Achse1 = new Button(); btnTargetPositionServo1Achse1.Location = new Point(1290, 440); btnTargetPositionServo1Achse1.Name = "Button TargetPosition Servo1Achse1"; btnTargetPositionServo1Achse1.Size = new Size(20, 20); btnTargetPositionServo1Achse1.Text = ""; this.Controls.Add(btnTargetPositionServo1Achse1); btnTargetPositionServo1Achse1.Click += new EventHandler(btn_TargetPositionServo1Achse1_Click);
WarningPresent_Servo1Achse1 = new Label(); WarningPresent_Servo1Achse1.Location = new Point(1200, 470); WarningPresent_Servo1Achse1.Name = "Warning Servo1Achse1"; WarningPresent_Servo1Achse1.Size = new Size(80, 20); WarningPresent_Servo1Achse1.Text = "Warning"; this.Controls.Add(WarningPresent_Servo1Achse1);
btnWarningServo1Achse1 = new Button(); btnWarningServo1Achse1.Location = new Point(1290, 470); btnWarningServo1Achse1.Name = "Button Warning Servo1Achse1"; btnWarningServo1Achse1.Size = new Size(20, 20); btnWarningServo1Achse1.Text = ""; this.Controls.Add(btnWarningServo1Achse1); btnWarningServo1Achse1.Click += new EventHandler(btn_WarningPresentServo1Achse1_Click);
AlarmPresent_Servo1Achse1 = new Label(); AlarmPresent_Servo1Achse1.Location = new Point(1200, 500); AlarmPresent_Servo1Achse1.Name = "Alarm Servo1Achse1"; AlarmPresent_Servo1Achse1.Size = new Size(80, 20); AlarmPresent_Servo1Achse1.Text = "Alarm"; this.Controls.Add(AlarmPresent_Servo1Achse1);
btnAlarmServo1Achse1 = new Button(); btnAlarmServo1Achse1.Location = new Point(1290, 500); btnAlarmServo1Achse1.Name = "Button Alarm Servo1Achse1"; btnAlarmServo1Achse1.Size = new Size(20, 20); btnAlarmServo1Achse1.Text = ""; this.Controls.Add(btnAlarmServo1Achse1); btnAlarmServo1Achse1.Click += new EventHandler(btn_AlarmPresentServo1Achse1_Click);
AktPosition_Servo1Achse1 = new Label(); AktPosition_Servo1Achse1.Location = new Point(1320, 410); AktPosition_Servo1Achse1.Name = "AktuellePosition Servo1Achse1"; AktPosition_Servo1Achse1.Size = new Size(70, 20); AktPosition_Servo1Achse1.Text = "Akt. Pos. [mm]"; this.Controls.Add(AktPosition_Servo1Achse1);
tbxAktPosBerechnung_Servo1Achse1 = new TextBox(); tbxAktPosBerechnung_Servo1Achse1.Location = new Point(1390, 410); tbxAktPosBerechnung_Servo1Achse1.Name = "BerAktPosition Servo1Achse1"; tbxAktPosBerechnung_Servo1Achse1.ReadOnly = true; tbxAktPosBerechnung_Servo1Achse1.Text = "0,000"; tbxAktPosBerechnung_Servo1Achse1.Size = new Size(50, 20); this.Controls.Add(tbxAktPosBerechnung_Servo1Achse1);
WarnCode_Servo1Achse1 = new Label(); WarnCode_Servo1Achse1.Location = new Point(1320, 440); WarnCode_Servo1Achse1.Name = "WarningCode Servo1Achse1"; WarnCode_Servo1Achse1.Size = new Size(80, 20); WarnCode_Servo1Achse1.Text = "Warn. Code [hex]"; this.Controls.Add(WarnCode_Servo1Achse1);
tbxWarnCodeAnzeige_Servo1Achse1 = new TextBox(); tbxWarnCodeAnzeige_Servo1Achse1.Location = new Point(1400, 440); tbxWarnCodeAnzeige_Servo1Achse1.Name = "AnzeigeWarningCode Servo1Achse1"; tbxWarnCodeAnzeige_Servo1Achse1.ReadOnly = true; tbxWarnCodeAnzeige_Servo1Achse1.Text = "00"; tbxWarnCodeAnzeige_Servo1Achse1.Size = new Size(40, 20); this.Controls.Add(tbxWarnCodeAnzeige_Servo1Achse1);
AlarmCode_Servo1Achse1 = new Label(); AlarmCode_Servo1Achse1.Location = new Point(1320, 470); AlarmCode_Servo1Achse1.Name = "AlarmCode Servo1Achse1"; AlarmCode_Servo1Achse1.Size = new Size(80, 20); AlarmCode_Servo1Achse1.Text = "Alarm Code [hex]"; this.Controls.Add(AlarmCode_Servo1Achse1);
tbxAlarmCodeAnzeige_Servo1Achse1 = new TextBox(); tbxAlarmCodeAnzeige_Servo1Achse1.Location = new Point(1400, 470); tbxAlarmCodeAnzeige_Servo1Achse1.Name = "AnzeigeAlarmCode Servo1Achse1"; tbxAlarmCodeAnzeige_Servo1Achse1.ReadOnly = true; tbxAlarmCodeAnzeige_Servo1Achse1.Text = "00"; tbxAlarmCodeAnzeige_Servo1Achse1.Size = new Size(40, 20); this.Controls.Add(tbxAlarmCodeAnzeige_Servo1Achse1);
} } |