Author |
Message |
Neil Newpor #1 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
I have a problem where MSComm does not receive data even though I have proved all is well by using Hyper Terminal with exactly the same comms settings. The cable we were using only has three wires - transmit, receive and ground. Does any one know if MSComm requires more wires in the cable, or some special settings. Remember Hyper Terminal is working without a problem. Warm Regards Neil
|
Sat, 06 Apr 2002 03:00:00 GMT |
|
 |
Richard Grie #2 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
Hi, No, there is nothing special about MSComm. What code are you using? You don't say. I have lots of working examples in my book (see below), along with details about how things should work (and when you do need special cabling), including everything that you need to do to set MSComm properties correctly for different situations. -- Richard Grier Hard & Software 12962 West Louisiana Avenue Lakewood, CO 80228 303-986-2179 (voice) 303-986-3143 (fax) Author of Visual Basic Programmer's Guide to Serial Communications, 2nd Edition (355 pages). For information look on my homepage at http://www.hardandsoftware.net. Use the Books link to order. For faster service contact the publisher at http://www.mabry.com.
|
Sun, 07 Apr 2002 03:00:00 GMT |
|
 |
David Syrat #3 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
A code example would be useful - David
Quote: > Hi, > No, there is nothing special about MSComm. What code are you using? You > don't say. > I have lots of working examples in my book (see below), along with details > about how things should work (and when you do need special cabling), > including everything that you need to do to set MSComm properties correctly > for different situations. > -- > Richard Grier > Hard & Software > 12962 West Louisiana Avenue > Lakewood, CO 80228 > 303-986-2179 (voice) > 303-986-3143 (fax) > Author of Visual Basic Programmer's Guide to Serial Communications, 2nd > Edition (355 pages). > For information look on my homepage at http://www.hardandsoftware.net. > Use the Books link to order. For faster service contact the publisher at > http://www.mabry.com.
|
Mon, 08 Apr 2002 03:00:00 GMT |
|
 |
VC #4 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
I have a similar problem and here is my code. My send is fine but not my recieve. Private Sub Command2_Click() ' Open the port. MSComm1.PortOpen = True Do Do Dummy = DoEvents() Loop Until MSComm1.InBufferCount = 1024 RichTextBox1.Text = RichTextBox1.Text + MSComm1.Input Loop Until MSComm1.CommEvent = comEvEOF ' Close the serial port. MSComm1.PortOpen = False End Sub Quote:
>A code example would be useful - >David
>> Hi, >> No, there is nothing special about MSComm. What code are you using? You >> don't say. >> I have lots of working examples in my book (see below), along with details >> about how things should work (and when you do need special cabling), >> including everything that you need to do to set MSComm properties >correctly >> for different situations. >> -- >> Richard Grier >> Hard & Software >> 12962 West Louisiana Avenue >> Lakewood, CO 80228 >> 303-986-2179 (voice) >> 303-986-3143 (fax) >> Author of Visual Basic Programmer's Guide to Serial Communications, 2nd >> Edition (355 pages). >> For information look on my homepage at http://www.hardandsoftware.net. >> Use the Books link to order. For faster service contact the publisher at >> http://www.mabry.com.
|
Mon, 08 Apr 2002 03:00:00 GMT |
|
 |
Richard Grie #5 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
Hi, There is a code example furnished with VB Pro and Enterprise Editions. It is called VBTerm. Have you looked at it? The reason that I wrote my book was to give lots more detailed information than is available in the supplied documentation. -- Richard Grier Hard & Software 12962 West Louisiana Avenue Lakewood, CO 80228 303-986-2179 (voice) 303-986-3143 (fax) Author of Visual Basic Programmer's Guide to Serial Communications, 2nd Edition (355 pages). For information look on my homepage at http://www.hardandsoftware.net. Use the Books link to order. For faster service contact the publisher at http://www.mabry.com.
|
Mon, 08 Apr 2002 03:00:00 GMT |
|
 |
David Syrat #6 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
Have a look at Mscomm1.InputLen = x David Quote:
> I have a similar problem and here is my code. My send is fine but not my > recieve. > Private Sub Command2_Click() > ' Open the port. > MSComm1.PortOpen = True > Do > Do > Dummy = DoEvents() > Loop Until MSComm1.InBufferCount = 1024 > RichTextBox1.Text = RichTextBox1.Text + MSComm1.Input > Loop Until MSComm1.CommEvent = comEvEOF > ' Close the serial port. > MSComm1.PortOpen = False > End Sub
> >A code example would be useful - > >David
> >> Hi, > >> No, there is nothing special about MSComm. What code are you using? You > >> don't say. > >> I have lots of working examples in my book (see below), along with > details > >> about how things should work (and when you do need special cabling), > >> including everything that you need to do to set MSComm properties > >correctly > >> for different situations. > >> -- > >> Richard Grier > >> Hard & Software > >> 12962 West Louisiana Avenue > >> Lakewood, CO 80228 > >> 303-986-2179 (voice) > >> 303-986-3143 (fax) > >> Author of Visual Basic Programmer's Guide to Serial Communications, 2nd > >> Edition (355 pages). > >> For information look on my homepage at http://www.hardandsoftware.net. > >> Use the Books link to order. For faster service contact the publisher at > >> http://www.mabry.com.
|
Tue, 09 Apr 2002 03:00:00 GMT |
|
 |
Richard Grie #7 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
Hi,
Loop Until MSComm1.InBufferCount = 1024 << Never do this. Suppose that more than 1024 bytes are in the buffer (between the times that your loop executed -- THIS CAN HAPPEN). Loop Until MSComm1.InBufferCount >= 1024 Do not append data to a TextBox or RichTextBox using the Text property. Use SelText or SelRTF, respectively. These are MUCH faster.
Loop Until MSComm1.CommEvent = comEvEOF << Do not do this. MSComm1.CommEvent will be valid only in the OnComm event -- And, the comEvEOF does not work reliably anyway. Simply test the input data for EOF. For example, Dim Buffer As String Do DoEvents If MSComm1.InBufferCount > 0 Then Buffer = MSComm1.Input RichTextbox1.SelRTF = Buffer If InStr(Buffer, Chr$(26)) Then Exit Do Loop ' Close the serial port. MSComm1.PortOpen = False End Sub -- Richard Grier Hard & Software 12962 West Louisiana Avenue Lakewood, CO 80228 303-986-2179 (voice) 303-986-3143 (fax) Author of Visual Basic Programmer's Guide to Serial Communications, 2nd Edition (355 pages). For information look on my homepage at http://www.hardandsoftware.net. Use the Books link to order. For faster service contact the publisher at http://www.mabry.com.
|
Tue, 09 Apr 2002 03:00:00 GMT |
|
 |
holmeden #8 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
CHECK R + S VALUES ARE SET TO 1 Quote:
> I have a problem where MSComm does not receive data even though I have > proved all is well by using Hyper Terminal with exactly the same comms > settings. > The cable we were using only has three wires - transmit, receive and > ground. > Does any one know if MSComm requires more wires in the cable, or some > special settings. > Remember Hyper Terminal is working without a problem. > Warm Regards > Neil
|
Fri, 12 Apr 2002 03:00:00 GMT |
|
 |
Michel Wals #9 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
Hi, Nice trick, using SelText instead of Text, I would have never though it. Now, I just have to re-read your book, since I have missed it the first time... (was it in the first edition?) Vanderghast, Access MVP.
Quote: > Hi,
(...) Quote: > Do not append data to a TextBox or RichTextBox using the Text property. Use > SelText or SelRTF, respectively. These are MUCH faster.
|
Sun, 14 Apr 2002 03:00:00 GMT |
|
 |
Jeannine Menge #10 / 10
|
 MSComm does not recieve data when Hyper Terminal recieves data OK
Quote:
> I have a problem where MSComm does not receive data even though I have > proved all is well by using Hyper Terminal with exactly the same comms > settings. > The cable we were using only has three wires - transmit, receive and > ground. > Does any one know if MSComm requires more wires in the cable, or some > special settings. > Remember Hyper Terminal is working without a problem. > Warm Regards > Neil
I had this same exact problem. I set my RTSEnable to True and my Handshaking to 3-comRTSXon/Xoff and both Hyperterminal and my program saw the same data. regards Jeannine Menger
|
Mon, 06 May 2002 03:00:00 GMT |
|
|