So.. I am using this code to read some informations from a powertek pa4400a, and sometimes I can read it without any problems but sometimes I'm getting weird answers. I'm not even able to understand what does characters mean.
QSerialPort asd;
asd.setBaudRate(QSerialPort::Baud19200);
asd.setDataBits(QSerialPort::Data8);
asd.setFlowControl(QSerialPort::NoFlowControl);
asd.setParity(QSerialPort::NoParity);
asd.setStopBits(QSerialPort::OneStop);
asd.setPortName("ttyUSB0");
asd.open(QSerialPort::ReadWrite);
asd.write(com);
asd.waitForReadyRead(10000);
QString ans = asd.readAll();
The ans string should look like this:
"00.00E+0; 00.00E+0;+00.00E+0; 00.00E+0; 000:00:00;<<END OF DATA>>"
But I am getting things like this:
"\xFB"
Or any other stuff that's not right.
I did get the right answer a lot of times but something happened and I can't read the information anymore.