Serial Comm using MSComm 
Author Message
 Serial Comm using MSComm

I am trying to communicate with a digital camera using VB 4.  While I am
initializing the port, I can get the computer to recognize there is a
connection and I believe I can send a datablock to it.  However, it
seems to only send back " " when my InputLen=6.  Why can't I recieve my
desired 6 characters?

If anyone knows please let me know



Fri, 01 Dec 2000 03:00:00 GMT  
 Serial Comm using MSComm

Hi Brian,

However, it
seems to only send back " " when my InputLen=6.  Why can't I recieve my
desired 6 characters?
<<

You didn't post your code, so I can only guess.  However...

Dim Buffer As String
MSComm1.InputLen = 0    'not 6!
Do Until Len(Buffer) >=6
   Buffer = Buffer & MSComm1.Input
   DoEvents
Loop
For I = 1 to Len(Buffer)
   Debug.Print Asc(Mid$(Buffer, I, 1))
Next I

You may be interested in my book (see below for information).  I have lots
of working examples, details about how serial communications and serial
ports work.  You should find it to be quite helpful.

--
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.
For information, look on my homepage at
http://ourworld.compuserve.com/homepages/richard_grier.
Use the Books link to order from Amazon.com.  For faster service, contact
the publisher at http://www.mabry.com.



Fri, 01 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using serial port without using MSCOMM

2. Serial comm with vb and comm control

3. Using the Win API for serial comm

4. Getting Data from Serial Port using Comm Control

5. Getting Data from Serial Port using Comm Control

6. TImeout in serial port comm using greenleaf

7. Getting Data from Serial Port using Comm Control

8. Serial communication using MSCOMM

9. using MSComm for serial I/O

10. Problems with opening the serial port using MsComm

11. Problems with using the control MSComm for serial port communication

12. Closing Comm Port with Sportster 28.8K (MSCOMM)

 

 
Powered by phpBB® Forum Software