problems with serial interfacing 
Author Message
 problems with serial interfacing

 i wish to serial interface a process(which use
microcontroller) to the pc. i have problem with the source
code of the Visual Basic. i already set in Mscomm.ocx
control n some necessary codes.but, it seem doesnt work. i
have an example of output data from pc. the examples show
that to configure port as output, there is a source code
as follow:

MScomm1.Output="CPA00000000" + Chr(13)

(1) what does CPA stand for?
(2) i need to configure port as input, what should i add  
in the source code?
(3) is there any examples of serial interfacing that i can
refer to?

  that's all my question, thanks!



Wed, 18 May 2005 23:20:15 GMT  
 problems with serial interfacing
yan yaan,

re 1:  The line of source code you listed is sending a string out of the
serial port.
         The device in the receiving end will know what "CPA" is good for...
         You would probably want to replace the output string with something
specific for the device you're trying to communicate with ?!?
re 2:  Standard serial ports are always full-duplex, i.e. you do not need to
configure the port for output.
re 3:  Google:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=VB6+MSCOMM+SAMPLE

Cheers
Michael.


Quote:
> i wish to serial interface a process(which use
> microcontroller) to the pc. i have problem with the source
> code of the visual basic. i already set in Mscomm.ocx
> control n some necessary codes.but, it seem doesnt work. i
> have an example of output data from pc. the examples show
> that to configure port as output, there is a source code
> as follow:

> MScomm1.Output="CPA00000000" + Chr(13)

> (1) what does CPA stand for?
> (2) i need to configure port as input, what should i add
> in the source code?
> (3) is there any examples of serial interfacing that i can
> refer to?

>   that's all my question, thanks!



Thu, 19 May 2005 01:18:31 GMT  
 problems with serial interfacing
Hi,

I have lots of examples of this sort of thing in my book.  See below.

You ask:

(1) what does CPA stand for?
<<

This will be documented by your microcontroller manufacturer.  There isn't
anything standard about this.

(2) i need to configure port as input, what should i add
in the source code?

Once the port is open (MSComm1.PortOpen = True), and the Settings property
is set correctly, you are ready to receive data.  All you have to do is to
wait until there is data to receive, then use the Input property to assign
it to a variable.

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



Thu, 19 May 2005 04:05:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Control of Serial Interface by VBA

2. VBA interface to serial RS232 port

3. Serial Interface

4. REQ: Serial Port Interface

5. detecting non-working serial interface

6. serial interfacing

7. Universal Serial Bus interface programming

8. SERIAL PORT INTERFACE

9. Need Serial CommPort interface code!!

10. Serial Port Interface

11. Anyone ever serial interfaced with a radio scanner?

12. Serial Interface

 

 
Powered by phpBB® Forum Software