|
|
@@ -7,6 +7,7 @@ |
|
|
|
#include <QString> |
|
|
|
#include <QVector> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <synchapi.h> |
|
|
|
#include "crc.h" |
|
|
|
|
|
|
|
Widget::Widget(QWidget *parent) : |
|
|
@@ -150,6 +151,7 @@ void Widget::on_pushWrite_clicked() |
|
|
|
ui->textEdit_2->append("发送报文"+SendCommand.toHex().toUpper()); |
|
|
|
serialPort->write(SendCommand); |
|
|
|
|
|
|
|
Sleep(100); |
|
|
|
timer.isActive(); |
|
|
|
timer.start(2000); // 2 s 后触发超时 |
|
|
|
|
|
|
@@ -202,6 +204,7 @@ void Widget::on_pushWrite_clicked() |
|
|
|
ui->textEdit_2->append("发送报文"+SendCommand.toHex().toUpper()); |
|
|
|
serialPort->write(SendCommand); |
|
|
|
|
|
|
|
Sleep(100); |
|
|
|
timer.isActive(); |
|
|
|
timer.start(2000); // 2 s 后触发超时 |
|
|
|
|
|
|
@@ -353,6 +356,7 @@ void Widget::on_btn_read_clicked() |
|
|
|
{ |
|
|
|
SendCommand.append(0x03); |
|
|
|
} |
|
|
|
|
|
|
|
SendCommand.append(ui->lineEdit_stratAddress->text().toInt()/256); //加入起始地址 |
|
|
|
SendCommand.append(ui->lineEdit_stratAddress->text().toInt()%256); |
|
|
|
SendCommand.append(ui->lineEdit_length->text().toInt()/256); //加入长度 |
|
|
@@ -367,6 +371,7 @@ void Widget::on_btn_read_clicked() |
|
|
|
ui->textEdit_2->append("发送报文"+SendCommand.toHex().toUpper()); |
|
|
|
serialPort->write(SendCommand); //发送报文 |
|
|
|
|
|
|
|
Sleep(100); |
|
|
|
timer.isActive(); |
|
|
|
timer.start(2000); // 2 s 后触发超时 |
|
|
|
} |