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. Manually send XON/XOFF characters

Manually send XON/XOFF characters

Scheduled Pinned Locked Moved General and Desktop
xonxoffqserialport
5 Posts 3 Posters 3.1k 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.
  • S Offline
    S Offline
    syndrome
    wrote on last edited by
    #1

    I have a measuring instrument that works this way:

    • I have to send the XON Character
    • After it receives the XON Character it begin to send continuously the measured value
    • When I have enough data, I send the XOFF Character.

    How can I implement this in QT?
    I don't understand how to manually send over serial port the XON and XOFF character.

    Any suggestion?
    Thank you very much

    K 1 Reply Last reply
    0
    • S syndrome

      I have a measuring instrument that works this way:

      • I have to send the XON Character
      • After it receives the XON Character it begin to send continuously the measured value
      • When I have enough data, I send the XOFF Character.

      How can I implement this in QT?
      I don't understand how to manually send over serial port the XON and XOFF character.

      Any suggestion?
      Thank you very much

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @syndrome
      Hi and welcome to devnet

      XON and XOFF characters are defined in the ASCII table.

      You do not give details on the interface, but the only explanation would be that you are communicating to a fairly old device which uses only displayable characters in its communication otherwise.

      You are right it sounds odd nowadays.

      Vote the answer(s) that helped you to solve your issue(s)

      S 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Isn't that handle for you when setting the flow control to QSerialPort::SoftwareControl ?

        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
        0
        • K koahnig

          @syndrome
          Hi and welcome to devnet

          XON and XOFF characters are defined in the ASCII table.

          You do not give details on the interface, but the only explanation would be that you are communicating to a fairly old device which uses only displayable characters in its communication otherwise.

          You are right it sounds odd nowadays.

          S Offline
          S Offline
          syndrome
          wrote on last edited by
          #4

          @koahnig thank you very much for your answer.
          Yes, it is a very old device. Is it possible with the QSerialPort to send an ascii character? How? I'm sorry if maybe it is "stupid" question.

          @SGaist thank you for your answer too. I have to set it manually, so no, I can't set the flowcontrol to QSerialPort::SoftwareControl. I can use it if the device send the XON / XOFF Character, but in my case I have to send it.

          K 1 Reply Last reply
          0
          • S syndrome

            @koahnig thank you very much for your answer.
            Yes, it is a very old device. Is it possible with the QSerialPort to send an ascii character? How? I'm sorry if maybe it is "stupid" question.

            @SGaist thank you for your answer too. I have to set it manually, so no, I can't set the flowcontrol to QSerialPort::SoftwareControl. I can use it if the device send the XON / XOFF Character, but in my case I have to send it.

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            @syndrome

            QSerialPort serial;
            ...
            // some stuff for initialisation and more 
            char xon ( 17 );   
            char xoff ( 19 );
            
            
            serial.writeData ( &xon, 1 );  // will send XON 
            
            serial.writeData ( &xoff, 1 );  // will send XOFF
            
            

            Check out writeData . Do you know how send the rest?

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0

            • Login

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