473,473 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Transmit data through COM port in Visual C++

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
Jul 22 '05 #1
3 3920
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
kb******@gascad.at
Jul 22 '05 #2
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
Jul 22 '05 #3
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

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jerry Weinstein | last post by:
Hi, I know about stored procedures and that they can speed up data entry via the SQL 'insert ' statement. However, one drawback to this method is that using the stored procedure still requires...
0
by: QuangPK | last post by:
we have a project to transmit and receive data on serial port (i modify it from VCTERM on MSDN). To transmit text byte I use : void CMainFrame::TxString(CString str) { CString s; VARIANT...
3
by: Rasha | last post by:
Hi, What is the right way for transmitting data on the serial port of a PC using VB.NET (under XP) ? I used to use the ActiveX MSComm under VB6, which becomes obsolete and needs a...
0
by: ken | last post by:
Hi all, I'm using the MS VB example "How to: Receive Strings From Serial Ports in Visual Basic" and would like to see the data being received. I have two virtual serial ports COM5 and COM6 setup...
6
by: john | last post by:
The standard method to transmit a file from an aspx page to a browser is to stream the file to the response then end the response. The HTML code generated by the aspx page is discarded, and the...
0
by: dyc | last post by:
I'm quite new to use the microsoft visuol studio....all the things I need to learn by myself...so hope can get some help from this forum.. My problem is how do I transmit data using VB language...
0
by: zhangke007 | last post by:
Hello, everyone, Currently, I have an simple serial communication application using the serialnet.dll tool from Franson company. What this application does is to read the data through the com...
2
by: Jeff Pang | last post by:
I want to transmit an array via socket from a host to another. How to do it? thank you. --jeff _____________________________________________________________ Largest network of startups. Find...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.