private void button_SendAll_Click(object sender, EventArgs e) { Johnbee_SerialPort.Send_ComData(0, (Johnbee_SerialPort.MyComId)Johnbee_SerialPort.MyComId.ID_SavsFlag); for (byte ii = 0; ii < (byte)Johnbee_SerialPort.MyComId.ID_SavsFlag; ii++) //只发送要设定的变量,监控变量不发送 { Johnbee_SerialPort.Send_ComData(Johnbee_SerialPort.MyComData[ii], (Johnbee_SerialPort.MyComId)ii); } }
private void button_Open_Click(object sender, EventArgs e) { if (button_Open.Text == "Open") { string ss = Johnbee_SerialPort.Open_Com(comboBox_Name.Text, comboBox_Bps.Text); if (ss == "Succed") { button_Open.Text = "Close"; button_Open.BackColor = Color.Lime; } } else { string ss = Johnbee_SerialPort.Close_Com(); if (ss == "Succed") { button_Open.Text = "Open"; button_Open.BackColor = Color.Red; } } }
private void numericUpDown_Loc_Kd3_ValueChanged(object sender, EventArgs e) { Johnbee_SerialPort.SetComData(numericUpDown_Loc_Kd3.Value, Johnbee_SerialPort.MyComId.ID_Loc_Kd3); }
private void numericUpDown_Psi_Ki2_ValueChanged(object sender, EventArgs e) { Johnbee_SerialPort.SetComData(numericUpDown_Psi_Ki2.Value, Johnbee_SerialPort.MyComId.ID_Psi_Ki2); }
private void button_SaveAll_Click(object sender, EventArgs e) { Johnbee_SerialPort.Send_ComData(1, Johnbee_SerialPort.MyComId.ID_SavsFlag); }
private void button_New_Click(object sender, EventArgs e) { comboBox_Name.Items.Clear(); Johnbee_SerialPort.SearchCom(comboBox_Name); }
private void Form1_Load(object sender, EventArgs e) { Johnbee_SerialPort.SerialPort_Init(comboBox_Name, comboBox_Bps); }