public void GoTo(MotionSystemMotorPosition[] positions) { SerialOutMessage cmd = new SerialOutMessage(); foreach (var pos in positions) { cmd.Add(pos.Channel, pos.Value, pos.StepSize); } Send(cmd); }
private void Send(SerialOutMessage data) { if (_serialPort != null && _serialPort.IsOpen) { lock (_lockObject) { //var seroutbytes = data.Data; //_serialPort.Write(seroutbytes, 0, seroutbytes.Length); //_timer.Change(5000, 5000); _sendBuffer.Add(data); } } else { LogOutput?.Invoke(this, new LogOutputEventArgs { Text = "Send failed since Serial Port is not open." }); } }