Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue receiving data weighing scale Ohaus aviator 7000
QtWS25 Last Chance

Issue receiving data weighing scale Ohaus aviator 7000

Scheduled Pinned Locked Moved Solved General and Desktop
qserialportc++
3 Posts 2 Posters 337 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yina
    wrote on 14 Dec 2021, 16:56 last edited by
    #1

    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

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yina
      wrote on 18 Dec 2021, 13:17 last edited by
      #3

      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 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 14 Dec 2021, 19:13 last edited by
        #2

        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 ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • Y Offline
          Y Offline
          Yina
          wrote on 18 Dec 2021, 13:17 last edited by
          #3

          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 Reply Last reply
          0

          1/3

          14 Dec 2021, 16:56

          • Login

          • Login or register to search.
          1 out of 3
          • First post
            1/3
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved