Page 1 of 2 12 LastLast
Results 1 to 20 of 33

Thread: Protocol Implementation. ?

  1. #1
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Protocol Implementation. ?

    Hi friends. I am using Qt4.3 with VS2005. I am working on a Data Acqusition System. I am using Qt to develop the Application. I need to acquire the data of the selected channels from the Embedded System and Plot Graphs in the Application. For which i need to implement a Protocol. I have the following -

    Format byte -- Service ID -- Data bytes -- Check Sum

    Format Byte is the size of Service ID and Data byte. ,example- 0X03
    Service ID defines which Channel I have selected. ,example - 0XC1
    Data Byte is the parameters i have selected in the Channel.
    Check Sum is the size of Format Byte and Service ID ,example- 0XC4

    I have to send all this on a serial port to the embedded system which has all these defined so it is going to select the required Channel and send the data back to the Application.
    Hey this is the first time i am doing this i have done a some searching on Google but i am not sure about how to implement this. ?? I don't have any one at my work to help me out with this.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    Is your question oriented on the protocol itself or how to physically send data through the serial port?

  3. #3
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Protocol Implementation. ?

    Hi wysota thankx for the reply. I wanted to know how to physically send data through the serial port . I tried the TCP example of Qt but it is not illustrating what i exactly wanted. Can you pls post me some example . I am not able to figure out how i exactly implement sending the Data serially in that format. I am still a novice in this field.

    Thanks a Lot

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    If you want to use the serial port, I suggest you google for QExtSerialPort - it's probably http://qextserialport.sourceforge.net

  5. #5
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Protocol Implementation. ?

    Hey i even tried the Qextserialport lib. But had so much problem installing it. The example programs din't work at all. Hey can u pls tell me how to install this.I will try Qextserialport again. I din't understand the help file installation so i cud't install properly. I am using Qt4.3.3 with VS2005.


    Thank You

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    I had no problems in installing QExtSerialPort on both Windows (with MSVC and MinGW as compilers) and Linux. Could you provide more details on what is going wrong?

  7. #7
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Re: Protocol Implementation. ?

    Hi wysota i copied the Qextserialport precompiled file to my system and tried to run the example program qespta. I got the following error i have attached the Output-Build file . I don know what is wrong. Hey can you pls tell me the proper procedure to install qexternalserialport lib to Qt4.3.3 with VS2005. I did not find any installation file online. I even got qextserialport-1.2win-alpha file unzipped it and tried the example program but i get error saying
    Qt Code:
    1. 1>LINK : fatal error LNK1181: cannot open input file 'qextserialportd.lib'
    To copy to clipboard, switch view to plain text mode 

    Pls Help me out in installing the lib wysota

    Thank You
    Regards
    Attached Files Attached Files

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    You are compiling your application in debug mode and the ext serial port library is compiled in release mode. Either recompile the library in debug mode or compile your application in release mode. As for the file you attached - there seems to be a syntax error in the source code, so the build fails.

  9. #9
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Protocol Implementation. ?

    Hey i did what you said but the same errors. And i have not changed the source code of any example file. But i get these syntax error. What do i have to do. wysota

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    I'm not talking about example files but your project - MessageWindow file. What exactly did you do to build the library and use it?

  11. #11
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Protocol Implementation. ?

    Hey this is what i did

    Unzipped the qextserialport-1.2win-alpha package in C:\qextserialport-1.2win-alpha\qextserialport-1.2win-alpha

    opened Qt command Promt and

    qmake -project

    qmake qextserialport.pro

    nmake qextserialport.pro

    qmake -tp vc qextserialport.pro

    I then found two .pro files. qextserialport-1.2win-alpha.pro and qextserialport.pro .
    I tried debuging both the files in VS2005. But i got errors for both . I am attaching the error log for qextserialport-1.2win-alpha.pro file. I compiled it in Debug mode only. Where am i going wrong wysota. ??

    Thank You
    Attached Files Attached Files

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    Why did you call "qmake -project"? By doing that you ruined the existing project file.

  13. #13
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Protocol Implementation. ?

    Hey sorry i read your before post and again did the same procedure but without "qmake -project"
    .I complied and but as soon as the comp i get a Pop Up telling " Please specify the name of the executable file to be used for the debug session " I have attached the dialog box that pops up just after compliation.

    Thank You
    wysota
    Attached Files Attached Files

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    What debug session? This is a library, there is nothing to debug. Please unpack the sourcecode, open the command line with all environment variables set up, cd to the source code, type in "qmake" followed by "nmake" and you're done. No need to even start visual studio.

  15. #15
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Protocol Implementation. ?

    Hi wysota thank you have helped me so much in trying to get the qextserialport installed. But i still get the errors. I did exactly what you said i took a fresh copy of qextserialport-1.2win-alpha package unzipped it in C:\ drive . Opened Qt command promt cd to the qextserialport-1.2win-alpha folder and did qmake and nmake. The errors are shown in Qt cmd promt. Pls check the error.zip i have attached the snap shot of the error in the cmd promt.

    Thank You so much.
    wysota
    Attached Files Attached Files

  16. #16
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    Use the stable release of QExtSerialPort, not the alpha one.

  17. #17
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Protocol Implementation. ?

    Hi wysota i did every thing possible . I tried all the version's . I unzipped them to the C:\ and did qmake and nmake. And tried to run the example program but still i get the same error when i try to build the qespta example.
    [/CODE]
    1>.\MessageWindow.cpp(93) : error C2061: syntax error : identifier '{ctor}'
    1>.\MessageWindow.cpp(121) : error C2061: syntax error : identifier '{ctor}'
    [/CODE]

    Hey i have to some how make this work my whole project is dependent on serial communication. . Pls help me out.

    Thank You wysota

  18. #18
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Protocol Implementation. ?

    What is the contents of those lines mentioned above?

  19. The following user says thank you to wysota for this useful post:

    dheeraj (30th April 2008)

  20. #19
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Protocol Implementation. ?

    hi, I've got version 1.1 of qextserialport from http://qextserialport.sourceforge.net/ which is differ from this on web, the difference is in example in file meesagewindow.cpp, I've got comments in line 92 and 93
    // if (static_cast<MessageWindow::EventType>(event->type()) == MessageWindow::MessageEvent)
    // msgTextEdit.append(dynamic_cast<MessageEvent::Mess ageEvent* >(event)->msg);
    and in line 121
    // QCoreApplication:ostEvent(this, new MessageEvent::MessageEvent(qmsg));
    with this comments it's work fine but when I delete them I get the same errors as you

  21. #20
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Protocol Implementation. ?

    Hi wysota
    The first error takes me to this part of the code.
    Qt Code:
    1. void MessageWindow::customEvent(QEvent* event)
    2. {
    3. if (static_cast<MessageWindow::EventType>(event->type()) == MessageWindow::MessageEvent)
    4.  
    5. msgTextEdit.append(dynamic_cast<MessageEvent::MessageEvent* >(event)->msg); // '{ctor}' Error takes me to this line
    6. }
    To copy to clipboard, switch view to plain text mode 

    the second error takes me to this line.
    Qt Code:
    1. QCoreApplication::postEvent(this, new MessageEvent::MessageEvent(qmsg));
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Readonly Model implementation requirements for QComboBox
    By DeepDiver in forum Qt Programming
    Replies: 6
    Last Post: 8th November 2007, 18:10
  2. QUdpSocket error
    By mdecandia in forum Qt Programming
    Replies: 8
    Last Post: 25th October 2007, 11:47
  3. UI implementation style
    By goes2bob in forum Qt Tools
    Replies: 2
    Last Post: 16th August 2007, 00:37
  4. RubberBand zoom implementation for images
    By cdemirkir in forum Qt Programming
    Replies: 4
    Last Post: 16th July 2007, 23:55
  5. Qt and Uni-verse Networking Protocol
    By dvmorris in forum Qt Programming
    Replies: 0
    Last Post: 11th April 2007, 10:23

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.