?
Solved

Application with two Comport

Posted on 2003-11-20
3
Medium Priority
?
405 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 150 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 150 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 200 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

765 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