Results 1 to 6 of 6

Thread: Serial Connection is not stable

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Serial Connection is not stable

    I am dealing with Serial connections between two system for testing my project.

    Here's the implementation of the serial object:

    (it is attached)

    Here are the problem which are making me crazy, I would thank if you could also change the code for a better understanding:

    1) Packets get lost, if I write a packet to the serial port, I may sometimes miss the ACK pakcet and I ReadData() fails.
    the more packets I append and emit to the serial port the less probable the chance of success.
    I tried to delay for quite some moments before sending or receiving another packets, but I came to the point now, that when I use delay between sending packet as you see in the object ReceiveData() SLOT, the chance of
    success fails. When i removed it was better.

    consider this:
    Qt Code:
    1. if(data.at(4) == 0x01)
    2. {
    3. qDebug() << "Lower Sensor= 0x01";
    4. qDebug() << "STARTING PUMP..";
    5. command_startPump.append(FUEL_SYSTEM);
    6. command_startPump.append(FUEL_PUMP);
    7. command_startPump.append(0x01);
    8.  
    9. emit DSLFL_SendToRS485(command_startPump);
    10.  
    11. qDebug() << "OPENING SV_15";
    12.  
    13. command_SV15.append(FUEL_SYSTEM);
    14. command_SV15.append(DSLFL_ST_SV_15);
    15. command_SV15.append(0x01);
    16.  
    17. emit DSLFL_SendToRS485(command_SV15);
    18. }
    To copy to clipboard, switch view to plain text mode 
    Here, if I send the first packet using a function like start_pump() and then send the second packets, the code would not work, But, when I pasted the code from the function here without using any delay between the two emits, it works, though ReadData often fails.!

    2) When I use the singleShot function, it does not execute the SLOTS, it doesn't work at all!

    I would thank if you could show me how to make this Object work correctly without any data loss, and with timer slots and serperate codes work.

    Yours
    Attached Files Attached Files

Similar Threads

  1. Qt stable version
    By prady in forum Newbie
    Replies: 1
    Last Post: 7th June 2012, 09:25
  2. Qt 4.7-stable build - errors...
    By rickbsgu in forum Installation and Deployment
    Replies: 0
    Last Post: 5th November 2010, 03:43
  3. QFile write isn't stable
    By ruben.rodrigues in forum Newbie
    Replies: 2
    Last Post: 8th July 2010, 21:14
  4. Fop MiniScribus XSL-FO stable
    By patrik08 in forum Qt-based Software
    Replies: 0
    Last Post: 11th October 2007, 18:34
  5. Want a stable install
    By pshah.mumbai in forum Installation and Deployment
    Replies: 9
    Last Post: 10th October 2007, 07:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.