Issue receiving data weighing scale Ohaus aviator 7000
Solved
General and Desktop
-
wrote on 14 Dec 2021, 16:56 last edited by
Hello
I am trying to establisch a serial port connection to my Aviator 7000 weighing scale. The expected result would be a succesfull communication through the use of a byte command.
Sadly I don't receive any bytes back from the scale. below you can find what I tried so far:const int Max_attempts = 5; const int Max_sleep = 125; int attemps; attemps = 0; while (true) { int enq {5}; QByteArray bytes; bytes.setNum(enq); m_serial->write(bytes); m_serial->waitForReadyRead(Max_sleep); if (m_serial->bytesAvailable() !=0) { qDebug() << m_serial->bytesAvailable() ; qDebug() << "connected" << m_serial->readAll(); break; } attemps += 1; if (attemps == Max_attempts) { qDebug() << "no connection established"; break; } }
Kind regards,
Yina -
wrote on 18 Dec 2021, 13:17 last edited by
The issue was that it had to be byte \x05 and QByteArray.setnum(5) will result in \x35 so I had to use QByteArray::append()
-
Hi,
How are you connecting to that scale ?
Physical cable ?
Can you connect to it by another program ?
Which OS are you running ?
Which Qt version are you using ? -
wrote on 18 Dec 2021, 13:17 last edited by
The issue was that it had to be byte \x05 and QByteArray.setnum(5) will result in \x35 so I had to use QByteArray::append()
1/3