Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QModbus how to drive RS485 TX direction
Forum Updated to NodeBB v4.3 + New Features

QModbus how to drive RS485 TX direction

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 298 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.
  • C Offline
    C Offline
    Cornelio
    wrote on last edited by
    #1

    As for Chai18 in this topic
    Re: Using 485 for QmodbusServer library
    I'm working on a custom yocto linux embedded board that acts as modbus master by the use of QModbusRtuSerialMaster.
    The code below works fine with direct access to the RS485 port:
    void gpio::WriteData(QString stringa, int baud)
    {
    if(WaitFdWriteable(fd232))
    {
    setPin(uart1_dir,ON);
    write(fd232,stringa.toLatin1().data(),stringa.length());
    //tcdrain(fd232);
    tcflush(fd232, TCIFLUSH);
    QThread::usleep(10000000*stringa.length()/baud);
    setPin(uart1_dir,OFF);
    }
    }
    How can I drive the hardware "uart1_dir" GPIO pin for TX - RX direction in a similar way in QModbus libraries?
    Thanks

    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