private void button1_Click(object sender, EventArgs e) { var dlg = new OpenFileDialog(); dlg.Filter = "ajinextek motor parameter data files (*.dat)|*.dat|All Files (*.*)|*.*"; dlg.Title = "Open to motor parameter file"; dlg.InitialDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "motion"); DialogResult result = dlg.ShowDialog(); if (result != DialogResult.OK) { return; } if (MotorAjinExtek.LoadParameterFile(dlg.FileName)) { textBox1.Text = dlg.FileName; } }
private void MotionForm_Load(object sender, EventArgs e) { UpdateNames(); var motorParameterFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "motion", "ajinmotorparameterfile.mot"); MotorAjinExtek.LoadParameterFile(motorParameterFile); MotorZ = new MotorAjinExtek(0, "Z Axis"); MotorZ.Initialize(); DigitalInput = new AjinExtekDInput(0, "D.IN"); //DigitalInput = new AdlinkDInput(0, "D.IN", 7230, 0); //DigitalInput = new RtcDInput(rtc, 0, "D.IN"); DigitalInput.Initialize(); DigitalOutput = new AjinExtekDOutput(0, "D.OUT"); //DigitalOutput = new AdlinkDOutput(0, "D.OUT", 7230, 0); //DigitalOutput = new RtcDOutput(rtc, 0, "D.OUT"); DigitalOutput.Initialize(); timer.Enabled = true; }