Visual Basic Gurus
Thread Starter
Scooby Regular
Joined: Mar 2000
Posts: 4,531
Likes: 0
From: Gloucestershire, home of the lawnmower.
Alex,
I may not understand the problem correctly, but here is my plan.
Instance 1 runs on a timer, say every 15 seconds (depending on your GPS card I guess). This instance grabs the port, gets what it wants then program it to release the port (this is the bit I hope is possible).
Instance 2 does the same thing but if it fails to grab the port, waits 1 second then trys again.
However, if the OCX doesn't allow programatically releasing and grabbing of the port you will have to go to plan B.
Instance 1 grabs the port at instance startup. It grabs data from the port every 15 seconds. It writes the info out to a temp file that instance 2 can read and act upon.
Erm, just some ideas. Mind you, I've jumped through all these loops with GPS cards myself, so if you have a specific application, let me know, I may be able to help but all my work has been with Delphi.
Cheers
Ian
I may not understand the problem correctly, but here is my plan.
Instance 1 runs on a timer, say every 15 seconds (depending on your GPS card I guess). This instance grabs the port, gets what it wants then program it to release the port (this is the bit I hope is possible).
Instance 2 does the same thing but if it fails to grab the port, waits 1 second then trys again.
However, if the OCX doesn't allow programatically releasing and grabbing of the port you will have to go to plan B.
Instance 1 grabs the port at instance startup. It grabs data from the port every 15 seconds. It writes the info out to a temp file that instance 2 can read and act upon.
Erm, just some ideas. Mind you, I've jumped through all these loops with GPS cards myself, so if you have a specific application, let me know, I may be able to help but all my work has been with Delphi.
Cheers
Ian
But two threads/apps cannot access the _same_ COM port - access has to be exclusive otherwise it doesn't work!
Best solution is as suggested: have an app that reads the port and then connect to that app (using files, named pipes, shared memory) to get the data.
Much easier in C++!!
Best solution is as suggested: have an app that reads the port and then connect to that app (using files, named pipes, shared memory) to get the data.
Much easier in C++!!
Chaps,
Time for the Scoobynet knowledge bank to amaze me again

I am trying to write an application using VB 6 that uses the standard Microsoft Comm OCX to read information from a COM Port...
This app needs to run as two instances on one machine.
The information, as it happens, is coming from a GPS card, though that isn't really important, it just streams NMEA (GPS Standard) text...
The problem is that the OCX control, and all others I have looked at, grab the COM port exclusively, which means the second instance fails to open a connection to the COM port

Anyone know how two applications can share a COM port programatically?

TIA,
Alex
Time for the Scoobynet knowledge bank to amaze me again

I am trying to write an application using VB 6 that uses the standard Microsoft Comm OCX to read information from a COM Port...
This app needs to run as two instances on one machine.
The information, as it happens, is coming from a GPS card, though that isn't really important, it just streams NMEA (GPS Standard) text...
The problem is that the OCX control, and all others I have looked at, grab the COM port exclusively, which means the second instance fails to open a connection to the COM port

Anyone know how two applications can share a COM port programatically?

TIA,
Alex
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Can you not write three apps... one reads the com ports and then the other two apps talk to that??
Sure it can be done quite easy...
What about not using the ocx but reference a dll instead...
David
Sure it can be done quite easy...
What about not using the ocx but reference a dll instead...
David
Thread Starter
Scooby Regular
Joined: Mar 2000
Posts: 4,531
Likes: 0
From: Gloucestershire, home of the lawnmower.
Hey, let's start own our, totally pointless, but nonetheless vitally important, religous war over programming languages.
I'll start: FORTRAN is the best
(most of my work is with this stuff)As an aside, and the main topic of this thread, David also puts forward a valid method.
Cheers
Ian
Trending Topics
Thread
Thread Starter
Forum
Replies
Last Post
crazyspeedfreakz
Wanted
17
Oct 5, 2015 07:19 PM
Pro-Line Motorsport
Car Parts For Sale
2
Sep 29, 2015 07:36 PM



