Notices
Non Scooby Related Anything Non-Scooby related

Visual Basic Gurus

Thread Tools
 
Search this Thread
 
Old 04 October 2001, 12:10 AM
  #1  
IWatkins
Scooby Regular
Thread Starter
 
IWatkins's Avatar
 
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes on 0 Posts
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
Old 04 October 2001, 12:18 AM
  #2  
kryten
Scooby Regular
 
kryten's Avatar
 
Join Date: May 2000
Posts: 869
Likes: 0
Received 0 Likes on 0 Posts
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++!!
Old 04 October 2001, 11:07 AM
  #3  
BigGT3Fan
Scooby Regular
 
BigGT3Fan's Avatar
 
Join Date: Jul 2001
Posts: 464
Likes: 0
Received 0 Likes on 0 Posts
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
Old 04 October 2001, 02:24 PM
  #4  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

In almost any other language actually, it's called a non-blocking read. Still, if you use a Windows extension language ...
Old 04 October 2001, 03:50 PM
  #5  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
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
Old 04 October 2001, 05:26 PM
  #6  
Neil Micklethwaite
Scooby Regular
 
Neil Micklethwaite's Avatar
 
Join Date: Dec 1998
Posts: 1,046
Likes: 0
Received 0 Likes on 0 Posts
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
Old 04 October 2001, 05:46 PM
  #7  
IWatkins
Scooby Regular
Thread Starter
 
IWatkins's Avatar
 
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes on 0 Posts
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
Old 04 October 2001, 05:52 PM
  #8  
Neil Micklethwaite
Scooby Regular
 
Neil Micklethwaite's Avatar
 
Join Date: Dec 1998
Posts: 1,046
Likes: 0
Received 0 Likes on 0 Posts
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
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Frizzle-Dee
Essex Subaru Owners Club
13
01 December 2015 09:37 AM
crazyspeedfreakz
Wanted
17
05 October 2015 07:19 PM
Davalar
General Technical
19
30 September 2015 08:54 PM
Pro-Line Motorsport
Car Parts For Sale
2
29 September 2015 07:36 PM



Quick Reply: Visual Basic Gurus



All times are GMT +1. The time now is 02:00 AM.