pigangel
asked on
COM port programming
Hi,Experts:
please help me urgently.
I am doing the COM port programming the first time, I had got some articles with example coding for web e.g. codeguru. but I still don't understand completely about data receiveing.
I am doing the test program in order to understand the com port communication. the program including 2 modules, one is to send data, the other is to recieve data.
my program is :
even I make the receive buffer much longer than the length of sent message, I always receive data piece by piece (e.g, I send 28 bytes data, the data recieved is always 8 byte, 8 byte ....).
Is com port transferring data like this way? what should I do so that I can get the whole piece message at one time. please kindly give me any idea, example coding will be very appreciated. thank you very much!
-- pigangel
please help me urgently.
I am doing the COM port programming the first time, I had got some articles with example coding for web e.g. codeguru. but I still don't understand completely about data receiveing.
I am doing the test program in order to understand the com port communication. the program including 2 modules, one is to send data, the other is to recieve data.
my program is :
even I make the receive buffer much longer than the length of sent message, I always receive data piece by piece (e.g, I send 28 bytes data, the data recieved is always 8 byte, 8 byte ....).
Is com port transferring data like this way? what should I do so that I can get the whole piece message at one time. please kindly give me any idea, example coding will be very appreciated. thank you very much!
-- pigangel
The best article on serial programming IMHO is http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp ("Serial Communications in Win32")
Hi,
Why don't you use a timer to get the data in buffer every 1 second.
I worked with the serial port alot but I used ActiveX for that.
If you are interested I can help you with the code for ActiveX.
Pleas post a comment if you want the code with ActiveX.
Regards
Mazen
Why don't you use a timer to get the data in buffer every 1 second.
I worked with the serial port alot but I used ActiveX for that.
If you are interested I can help you with the code for ActiveX.
Pleas post a comment if you want the code with ActiveX.
Regards
Mazen
ASKER
Hi,Mazen, can you please help me with the ActiveX, I am interested in trying any possible solution, thanks.
pigangel
pigangel
Dear pigangel,
You can use your MSComm activeX control came with your visual studio.
You can customise it after adding the class to your project to send and receive data as bytes.
-cvallabhaneni
You can use your MSComm activeX control came with your visual studio.
You can customise it after adding the class to your project to send and receive data as bytes.
-cvallabhaneni
ASKER
Hi,Mazen, can you please help me with the ActiveX, I am interested in trying any possible solution, thanks.
pigangel
pigangel
ASKER
thank you!cvallabhaneni,is this MSComm ActiveX same as that one to be used well in VB application? How to do so that I can add to my project?
-pigangel
-pigangel
Look for the VCTERM Sample in MSDN for the detailed explanation of how to use MSCOMM in VC++.
-chandu
-chandu
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Sorry it took me time to reply.
check the following website for using ActiveX:
http://www.codeguru.com/mfc/comments/9565.shtml
Hope this helps
Regards
Mazen
Sorry it took me time to reply.
check the following website for using ActiveX:
http://www.codeguru.com/mfc/comments/9565.shtml
Hope this helps
Regards
Mazen
ASKER
Thanks a lot, all your comments are very helpful for me, so I understand it quite clearly.and finally I choose to use one clase from Codeproject. I am sorry I can only one comment as answer. again,Thank you very much!
-- Pigangel
-- Pigangel