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.:o
Re: Protocol Implementation. ?
Is your question oriented on the protocol itself or how to physically send data through the serial port?
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. :o
Thanks a Lot
Re: Protocol Implementation. ?
If you want to use the serial port, I suggest you google for QExtSerialPort - it's probably http://qextserialport.sourceforge.net
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
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?
1 Attachment(s)
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.:confused: 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
Code:
1>LINK : fatal error LNK1181: cannot open input file 'qextserialportd.lib'
Pls Help me out in installing the lib wysota :)
Thank You
Regards
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.
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.:confused: wysota
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?
1 Attachment(s)
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
Re: Protocol Implementation. ?
Why did you call "qmake -project"? By doing that you ruined the existing project file.
1 Attachment(s)
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
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.
1 Attachment(s)
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
Re: Protocol Implementation. ?
Use the stable release of QExtSerialPort, not the alpha one.
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. :crying:. Pls help me out.
Thank You wysota
Re: Protocol Implementation. ?
What is the contents of those lines mentioned above?
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::postEvent(this, new MessageEvent::MessageEvent(qmsg));
with this comments it's work fine but when I delete them I get the same errors as you
Re: Protocol Implementation. ?
Hi wysota
The first error takes me to this part of the code.
Code:
void MessageWindow
::customEvent(QEvent* event
) {
if (static_cast<MessageWindow::EventType>(event->type()) == MessageWindow::MessageEvent)
msgTextEdit.append(dynamic_cast<MessageEvent::MessageEvent* >(event)->msg); // '{ctor}' Error takes me to this line
}
the second error takes me to this line.