 |
|
|
Topic: Receive one character, then rest of input string after
|
By: Skip | Posted on: Aug 11 2010 at 05:07:45 PM | I bought your control and am using your sample software in Access 2007 on XP. When I input a string through the COM port, the software responds with the first character only, then returns again with the remainder of the string. It still does this even if I increase the .200 second timeout to 2.00 seconds.
HELP!! | |
By: Support | Posted on: Aug 11 2010 at 09:48:40 PM | Hello Skip, We already answered this by email.
That OnComm event in our MSAccess sample is not very elegant. Doing delays, timing loops in the oncomm event is not good practise - we should improve it. Here's two much better ways to do it.
In your email you explained that your data is terminated by CR In that case you should just buffer the data into a global string and process it once CR arrives. Like this.
Create a global string - lets call it buff - then each time OnComm is triggered you simply append the input data into buff and check to see if buff contains CR If it doesn't you exit the oncomm and wait for oncomm to be triggered again. and so on untill you see CR in buff and then you know you have the full string of data.
But that's just one way to do it. Our comm32 ocx has a much more efficient way of doing it. Take a look at the comm32 documentation at the very simple sample code of the evtChar property. Using that you can set evtChar=13 Now the oncomm event will only happen when CR is detected by the serial port. So, you only get one OnComm event and when it happens you know the whole string is waiting for you in the receive buffer.
| |
By: Boštjan | Posted on: Nov 28 2011 at 10:27:27 AM | Hello, I have also problems with receiving data from the port in MSAccess_2007. Is it possible to get the documentation, although the current test my demo and decided to buy it, if you will of course be sufficient to my needs.?
The first impression is good
Thank you | |
By: Support | Posted on: Nov 28 2011 at 01:50:30 PM | Hello,
There is no additional documentation. The website at www.comm32.com shows a list of all properties and functions as well as download of the trial version including sample projects. | |
By: Boštjan | Posted on: Nov 29 2011 at 11:56:16 AM | Hi, I solved the problem .. everything works fine. Thank you | |
|