Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Transmit data through COM port in Visual C++

Reply
Thread Tools

Transmit data through COM port in Visual C++

 
 
Liu Ju
Guest
Posts: n/a
 
      09-13-2004
Dear members:
I need to write a program in Visual C++ platform that trasmit data
through the COM port.
The task would be as follows:
Whenever the peripheral device sents 1 byte to the computer through
the RX pin of the COM Port, the program will send 4 bytes to the TX
pin to peripheral device.

do you know any source or the class in Visual C++ on the Internet that
can reliably transmit data through COM port ?

Thank you very much.

Sincerely
liuju
 
Reply With Quote
 
 
 
 
Karl Heinz Buchegger
Guest
Posts: n/a
 
      09-13-2004
Liu Ju wrote:
>
> Dear members:
> I need to write a program in Visual C++ platform that trasmit data
> through the COM port.
> The task would be as follows:
> Whenever the peripheral device sents 1 byte to the computer through
> the RX pin of the COM Port, the program will send 4 bytes to the TX
> pin to peripheral device.
>
> do you know any source or the class in Visual C++ on the Internet that
> can reliably transmit data through COM port ?


What's wrong with using the web?

http://www.google.com
Search phrase: Visual C++ COM port

The 4-th hit seems like a start to what you are looking for
>
> Thank you very much.
>
> Sincerely
> liuju



--
Karl Heinz Buchegger
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Liu Ju
Guest
Posts: n/a
 
      09-14-2004
Thank you very much for the answer.

However I would like to ask for more specifically. In my program, I
need to wait for a confirmation byte from the peripheral device before
starting sending 4 data bytes. After the peripheral device completes
processing data, it will again require 4 next data bytes. This process
will repeat in the priod of 4 ms.
In DOS, I often used 1 interrupt to know when the peripheral device
requires the tramsmission from the computer. In Visual C++, what
should I do?
Do I have to frequently scan the RxD pin to know whether or not the
peripheral device is sending data? IS there any solution like
interrupt in DOS for this task?

Thank you and look forward to your replies.

Sincerely
LiuJU
 
Reply With Quote
 
Thomas Matthews
Guest
Posts: n/a
 
      09-14-2004
Liu Ju wrote:

> Thank you very much for the answer.
>
> However I would like to ask for more specifically. In my program, I
> need to wait for a confirmation byte from the peripheral device before
> starting sending 4 data bytes. After the peripheral device completes
> processing data, it will again require 4 next data bytes. This process
> will repeat in the priod of 4 ms.
> In DOS, I often used 1 interrupt to know when the peripheral device
> requires the tramsmission from the computer. In Visual C++, what
> should I do?
> Do I have to frequently scan the RxD pin to know whether or not the
> peripheral device is sending data? IS there any solution like
> interrupt in DOS for this task?
>
> Thank you and look forward to your replies.
>
> Sincerely
> LiuJU


You need to ask in a newsgroup specific to your platform.

There are some standard properties (attributes) of a serial port,
but beyond that, they are platform specific.

Read the welcome.txt below to find the proper newsgroup. You
may also want to lurk in news:comp.arch.embedded also.

[Off-Topic]
In general, there are two methods to read from a serial port:
polling and interrupt. With polling, the program is reading
the status register to determine if a character has arrived.
With interrupts, the program is interrupted when a character
has arrived and an Interrupt Service Routine (ISR) is invoked.
Once the character has arrived, the value must be read out
of the Recieve Register. After that, the status may have
to be reset.


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
real life audio data transmit & recive Md Mosfiqur Rahman Ruby 3 04-29-2011 09:13 PM
WG 121 will transmit but not receive armfarm@gmail.com Wireless Networking 0 03-04-2006 01:40 PM
Transmit Discards on Router Anthony Fischer Cisco 2 01-28-2006 03:32 PM
unable to transmit over 4M post data cyberleo80@libero.it ASP General 6 07-12-2005 08:50 AM
How to transmit data on serial port using VC++ .NET under XP? Rasha ASP .Net 0 03-17-2005 11:55 AM



Advertisments