private void InitDevices() { string[] port = SerialPort.GetPortNames(); if (port.Length <= 0) { return; } adamDevices = new ADAM4150(port[0]); adamDevices.Open(); }
/// <summary> /// 初始化设备 /// </summary> private void InitDevices() { //string[] port = SerialPort.GetPortNames(); //if (port.Length <= 0) //{ // return; //} adamDevices = new ADAM4150("COM4"); adamDevices.Open(); }
private void checkBox_Click(object sender, RoutedEventArgs e) { if (checkBox.IsChecked.Value) { zigBee.Open(); isZ = true; adam.Open(); isA = true; } else { isZ = false; zigBee.Close(); isA = true; adam.Close(); } }