Notices
Non Scooby Related Anything Non-Scooby related

Visual Basic Gurus

Thread Tools
 
Search this Thread
 
Old Oct 4, 2001 | 12:10 AM
  #1  
IWatkins's Avatar
IWatkins
Thread Starter
Scooby Regular
 
Joined: Mar 2000
Posts: 4,531
Likes: 0
From: Gloucestershire, home of the lawnmower.
Post

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
Reply
Old Oct 4, 2001 | 12:18 AM
  #2  
kryten's Avatar
kryten
Scooby Regular
 
Joined: May 2000
Posts: 869
Likes: 0
Post

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++!!
Reply
Old Oct 4, 2001 | 11:07 AM
  #3  
BigGT3Fan's Avatar
BigGT3Fan
Scooby Regular
 
Joined: Jul 2001
Posts: 464
Likes: 0
Post

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
Reply
Old Oct 4, 2001 | 02:24 PM
  #4  
stevencotton's Avatar
stevencotton
Scooby Regular
 
Joined: Jan 2001
Posts: 2,710
Likes: 1
From: behind twin turbos
Post

In almost any other language actually, it's called a non-blocking read. Still, if you use a Windows extension language ...
Reply
Old Oct 4, 2001 | 03:50 PM
  #5  
David_Wallis's Avatar
David_Wallis
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?
Post

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
Reply
Old Oct 4, 2001 | 05:26 PM
  #6  
Neil Micklethwaite's Avatar
Neil Micklethwaite
Scooby Regular
 
Joined: Dec 1998
Posts: 1,046
Likes: 0
Wink

Jesus what is it with C++ Programmers.

I do remember a headline back in the early 90's in Computer Weekly.

It read something along the lines 'C Programmers make inadequate human beings'

See nothings changed
Reply
Old Oct 4, 2001 | 05:46 PM
  #7  
IWatkins's Avatar
IWatkins
Thread Starter
Scooby Regular
 
Joined: Mar 2000
Posts: 4,531
Likes: 0
From: Gloucestershire, home of the lawnmower.
Post



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
Reply
Old Oct 4, 2001 | 05:52 PM
  #8  
Neil Micklethwaite's Avatar
Neil Micklethwaite
Scooby Regular
 
Joined: Dec 1998
Posts: 1,046
Likes: 0
Cool

Do you know what you get if you type C++ in word , change to 72 size and the to Wingdings.

BTW VB.Net is the New Religion and you now have a Fatwah Fortran

BBTW - Pascal is much better than Fortran
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Frizzle-Dee
Essex Subaru Owners Club
13
Dec 1, 2015 09:37 AM
crazyspeedfreakz
Wanted
17
Oct 5, 2015 07:19 PM
Davalar
General Technical
19
Sep 30, 2015 08:54 PM
Pro-Line Motorsport
Car Parts For Sale
2
Sep 29, 2015 07:36 PM




All times are GMT +1. The time now is 01:49 PM.