How to Store Multiple data using Serialport in QT
Unsolved
Qt WebKit
-
void MainWindow::readData() // CH1 and CH2 Data Logic implementation
{// int r1,r2,r3,r4 = 0;
//int m,n,x,y = 0;
// int num3, num4 = 0;
// QByteArray RX_Data[6] = {0,0,0,0,0,0};
QByteArray UART_Data[5] = {0,0,0,0,0};
int k;
QByteArray data;for(k=0; k<5; k++) { data= serialPort->readAll(); ui->plainTextEdit_3->insertPlainText(data); UART_Data[k] = data; ui->plainTextEdit_2->insertPlainText(UART_Data[k]); }
// for(k=3; k<5; k++)
// {
// ui->plainTextEdit_3->insertPlainText(UART_Data[k]);
// }// ui->plainTextEdit_3->insertPlainText(UART_Data[4]);
-
Hi and welcome to devnet,
That code won't work as QSerialPort is asynchronous by default.
What is your end goal ?