?
Solved

MScomm is missing events

Posted on 2012-09-03
5
Medium Priority
?
477 Views
Last Modified: 2012-09-10
Hello,

I have C++ Application using MScomm  control  with 300 baud-rate External Modem connected to external device.
Our device send message every 20 seconds, when PC receives the message it replay with Acknowledge .

Problem description,
MScomm is not firing event for every message send by our device, sometimes it take 2 to 4 messages  until MSComm fire event,
When getting the input buffer I see all the messages in MSComm buffer (few messages).

The qeustion is why MScomm is not fire event for each message ? instead it keep few messages and then fire event to all of them.

My App. settings

m_comm.SetInBufferCount( 0 );
m_comm.SetRThreshold(1);  
m_comm.SetInputLen(0);  
m_comm.SetRTSEnable(TRUE);
0
Comment
Question by:Yigal123
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 38363493
I don't know for sure about the modern C++ world, but I learned the hard way back in VB6 "don't use the MSComm object".  At least the VB version, I found were some of the features didn't work as documented (like a "ready" flag that was always "TRUE" no matter what") and that the control would drop its connection to an open port from time to time, and would not reestablish without rebooting the OS.

While there are not many people I've personally known that needed Comm interfaces in a professional setting, but those I have known have all avoided MScomm control and just learned to access the ports directly with the API.
0
 

Author Comment

by:Yigal123
ID: 38366829
Is there more experts that experience the problem as I described and can advice there way of solving the problem ?
0
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 38367914
If you want to follow up on the idea of using the API directly, here's an how-to I've found:
http://www.robbayer.com/files/serial-win.pdf

Here's just one example of some of the things you can find if you google "problems with MSComm control": http://comm32.com/mscomm32.html

I wish I could be specifically more help, but I don't have extended experience attempting to utilize the com ports... just one major program I tried to write in VB years ago that was a dismial failure at staying active over long periods of time trying to use MSComm
0
 

Accepted Solution

by:
Yigal123 earned 0 total points
ID: 38367959
After a lots of testing I found that setting the port "Reciever Buffer" to "1" from device manager and then reset the PC (otherwise it will not work), solve the problem.

Thanks a lot.
0
 

Author Closing Comment

by:Yigal123
ID: 38382394
My solution is the one that solve the problem.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question