• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

Application with two Comport

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
rsch1973
Asked:
rsch1973
3 Solutions
 
SteHCommented:
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
 
George TokasCommented:
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
 
jayesh_j_patelCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now