Results 1 to 5 of 5

Thread: RS232 communication

  1. #1
    Join Date
    Sep 2010
    Location
    Bangalore
    Posts
    169
    Thanks
    59
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question RS232 communication

    hi everyone!
    We are doing serial communication between a linux and windows P.C using rs232. The server programm is written in Qt while the client programme is in VB.net. In the server we have 1lakh records in the database. And we need to display all the 1lakh records in client side. While sending, we are not having any problem. But in the client side, the buffer that is meant to receive the data is able to store only upto 4k of data. After that data is lost. So can any one tell me, what to do in this case? Whether we have to modify the server programme or else is there any method to increase client side buffer size or some thing like that?
    thanks in advance,

    with regards,

  2. #2
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: RS232 communication

    I don't know much about RS232 protocol, but at the very least you can send certain amount of data(4K) and wait until you get feedback from client that the data is consumed and then send another data.
    If this slows down the application, you can write a thread which takes the data from buffer on client side and puts into a bigger buffer so that server can keep on sending data.

  3. The following user says thank you to dpatel for this useful post:

    sattu (23rd September 2010)

  4. #3
    Join Date
    Sep 2010
    Location
    Bangalore
    Posts
    169
    Thanks
    59
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: RS232 communication

    Quote Originally Posted by dpatel View Post
    I don't know much about RS232 protocol, but at the very least you can send certain amount of data(4K) and wait until you get feedback from client that the data is consumed and then send another data.If..........................
    Well, we are thinking of doing these, but here 4k means we are only able to send maximum of 260 records(with fields id,name,address). That seems a vary small amount when compared to 1lakh records which we actually have to sent, so isn't there any option of increasing the buffer size or reading the data before the buffer is full? can you help regarding these?

  5. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: RS232 communication

    This 4k buffer is in RS232 driver as I think. You must have in Yours application a buffer for all data. Or create more intelligent protocol ie. read data from server partially depend on necessity. And of course You must use some method of RS232 synchronisation to not overwrite data in receiver.

  6. The following user says thank you to Lesiok for this useful post:

    sattu (25th September 2010)

  7. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: RS232 communication

    This seems like a .Net question rather than a Qt question. There must be some method of allocating a buffer in .Net that can grow to accept data you read in small chunks as it becomes available at the serial port. Given your 260 records per 4096 bytes, the 100000 records you are talking about will need a 1.5 MB buffer to hold everything.

    You should consider building a more formal data structure on-the-fly as you receive complete records into a small ring buffer (say about three times the largest record size).

  8. The following user says thank you to ChrisW67 for this useful post:

    sattu (25th September 2010)

Similar Threads

  1. Replies: 1
    Last Post: 16th June 2009, 09:09
  2. PenMount DMC9000 rs232 touchscreen Qt/E 4.5
    By mquinteiro in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 8th April 2009, 22:14
  3. Replies: 7
    Last Post: 29th August 2008, 10:24
  4. how to write RS232,give me some advice?
    By hiuao in forum Qt Programming
    Replies: 2
    Last Post: 23rd February 2007, 08:33
  5. Communication Help Pls
    By munna in forum Newbie
    Replies: 1
    Last Post: 25th May 2006, 13:22

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.