Solved

Application with two Comport

Posted on 2003-11-20
3
404 Views
Last Modified: 2010-04-01
Hi,

I would like to open two Comport in my Borland C++ Builder 6 programme to communicate with a GPS receiver for receive and a GSM module for send and receive data. Actually I have realised the GPS comport with a Thread who manages the incoming data(ASCII). This part works fine.

How can I add the second comport? Can I use the existing thread to receive and send data or do I need a second thread? If yes how can I do it? I guess multitreading is not that easy!!!

I have downloaded the Comport component from http://www.winsoft.sk. I think I can do all this with it? Is there anything I should think about it before I start?

Thanks,
Ronald

 
0
Comment
Question by:rsch1973
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Assisted Solution

by:SteH
SteH earned 75 total points
ID: 9786050
If you realised the GPS with a thread I understand that you already have an additional thread for this purpose. Plus the main thread gives 2 threads: you are multithreading already. Adding another thread is not too difficult then. I would go that way unless you need some execution order fro GPS and GSM. In that case a single thread for both of them could be easier.

No idea about the last option. I wrote serial communications myself. Have you done your attempt with that component already?
0
 
LVL 16

Assisted Solution

by:George Tokas
George Tokas earned 75 total points
ID: 9786062
Using the  Comport component you can use 2,3,4,5.... comports and control them indepentently.
there are some examples along with the component.
Initialization is very easy...
try it first using both your comports connected and send/receive ASCII data..
After that communication with the modems will be easy...

gtokas.
0
 

Accepted Solution

by:
jayesh_j_patel earned 100 total points
ID: 9786868
It is better idea to keep same thread for sending data also. So you can synchronize incoming and outgoing data when ever you needed. Generally it is a same comport to send and recieve the data, I mean duplex or half duplex. But as you said you have two different comport to get and send data. So just open another comport with proper details and handle send and recieve with two different handles in the same thread.
Hope will help
Jayesh
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question