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. Transmitting commands unsing RS232

Transmitting commands unsing RS232

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 1.2k 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.
  • AnilReddyA Offline
    AnilReddyA Offline
    AnilReddy
    wrote on last edited by
    #1

    I need to send the commands to control robotic arm from workstation(GUI). Commands are in 8 bit stream data. i am unable to understand how to insert bit format in serial->write("") . I am not good at C++ programing. Please can some one explain me how to do it.
    Thanks in advance.

    K kshegunovK 2 Replies Last reply
    0
    • AnilReddyA AnilReddy

      I need to send the commands to control robotic arm from workstation(GUI). Commands are in 8 bit stream data. i am unable to understand how to insert bit format in serial->write("") . I am not good at C++ programing. Please can some one explain me how to do it.
      Thanks in advance.

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

      @AnilReddy

      Hi and welcome to devnet forum

      Did you check out the terminal example?

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

      1 Reply Last reply
      1
      • AnilReddyA AnilReddy

        I need to send the commands to control robotic arm from workstation(GUI). Commands are in 8 bit stream data. i am unable to understand how to insert bit format in serial->write("") . I am not good at C++ programing. Please can some one explain me how to do it.
        Thanks in advance.

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        @AnilReddy
        Hello,
        QSerialPort::write will use QByteArray as an argument, so that's 8bit stream data. Maybe if you provide a command you want to send, it'd be easier to provide assistance? Also, there's the QSerialPort::waitForReadyRead and QSerialPort::waitForBytesWritten you have to take into account (if you're not using the asynchronous API).

        Kind regards.

        Read and abide by the Qt Code of Conduct

        AnilReddyA 1 Reply Last reply
        0
        • kshegunovK kshegunov

          @AnilReddy
          Hello,
          QSerialPort::write will use QByteArray as an argument, so that's 8bit stream data. Maybe if you provide a command you want to send, it'd be easier to provide assistance? Also, there's the QSerialPort::waitForReadyRead and QSerialPort::waitForBytesWritten you have to take into account (if you're not using the asynchronous API).

          Kind regards.

          AnilReddyA Offline
          AnilReddyA Offline
          AnilReddy
          wrote on last edited by AnilReddy
          #4

          @kshegunov
          thank you very much for your reply . the robotic arm which i need to control has 6 stepper motors . It accept 8 bit data in which first bit is for backward action and second bit for forward action and remaining are for engine numbers.
          for example if one stepper motor has to go forward direction we can make bit data as 00000110. Could you please write me program line for this.

          kshegunovK 1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi
            This might be useful
            http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c-c

            There is info for each bit operation.

            1 Reply Last reply
            1
            • AnilReddyA AnilReddy

              @kshegunov
              thank you very much for your reply . the robotic arm which i need to control has 6 stepper motors . It accept 8 bit data in which first bit is for backward action and second bit for forward action and remaining are for engine numbers.
              for example if one stepper motor has to go forward direction we can make bit data as 00000110. Could you please write me program line for this.

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by
              #6

              @AnilReddy
              To add to @mrjj also the QBitArray class might be useful in your case.

              Read and abide by the Qt Code of Conduct

              1 Reply Last reply
              1

              • Login

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