Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 11th, 2005, 03:08 PM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 741 Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 9 h 29 m 50 sec
Reputation Power: 22
Accessing Com Port

I have a few questions which I hope you all can help point me in the right direction.

A little background is in order. What I am trying to accomplish is Read the NMEA string passed to the Com Port 1 of a laptop from a Trimble GPS Unit. Once I have the string I need to parse it ang place the Lat Long in a couple fields in my Access Database. First off I have to capture the string from the Com Port.

Does anyone have any suggestions of where I can start to learn the code needed to read the Com Port 1 to retrieve the NMEA String pushed from the GPS Unit?

How can I do this from within an Access Database?

If I can get the string returned to a variable that would be great. From what I heard other people were writing this to a file?

Any help would be appreciated.

Thanks,

Jay

Reply With Quote
  #2  
Old August 11th, 2005, 03:12 PM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
Hi Jay,
here is a short extract form an app I wrote that gets the input from a siemens cellphone Modem:
Code:
 Private Sub MSComm1_OnComm()
 	Select Case MSComm1.CommEvent
 		   
 			Case comEvReceive
 				buffer = MSComm1.Input
 				    MsgBox StrConv(buffer, vbUnicode)
 			Case Else
 			    MsgBox "Unknown error or event"		
 	End Select
 End Sub
 

I hope this helps in some way, I don't have much experience with this either, but this works for me, hope it does for you
__________________
Look! Its a ShemZilla



Reply With Quote
  #3  
Old August 12th, 2005, 09:26 AM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 741 Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 9 h 29 m 50 sec
Reputation Power: 22
Accessing Com Port

That helps a little....dont really understand the syntax needed to hit the com port. I have been looking for other example and have nto found any. I think if I can get the msgBox to return the string on will be well on my way.

Thanks for your help and IO look forward to any other helpfull suggestions or tid bits of code........

Reply With Quote
  #4  
Old August 12th, 2005, 09:35 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
Hi Jay,

the MSComm1_OnComm() is the event that fires when there is something happening on the
Unit and it then I use the case statement to check if its a ComEvReceive(Comm Event Received)
then I use a buffer (normal string variable) to get the input from the Commport using MSComm1.Input
Then I convert that buffer to vbUnicode, so that I can read it.

You you will have something like "AT+CGMS=1" in that variable(in my case I used AT Commands to talk
to the modem)

you just need to know what interupt is sent from the unit for each type of command, and then use that
to direct the program further.

do you have a list of commands/interupts of that unit?

hope this helps

Reply With Quote
  #5  
Old August 12th, 2005, 10:06 AM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 741 Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 9 h 29 m 50 sec
Reputation Power: 22
Accessing Com Port

First off let me thank you for you help. This is the first time I have tried something like this. That is returning something from an outside source.

The GPS Unit sends NMEA Strings such as:

$GPRMC, 02451221,021441,w, ETC ETC

$GPGSV ETC ETC

I know the one I am looking for and will have to test for that before I return the string as well. Is this what you are refering to when you say interupt?

I figure if I can get a return of all of them I will be well on my way. I have to get the GPS unit back in my ofice to test. I am going to first hook it up to the HyperTerminal in Windows to make sure i am getting a string passed to the Port. Then get the code running to return the string inside Access.

Is the MSComm1.input specific for your cell phone modem?

Is this what you are erfering to when you talk about interupt.

Reply With Quote
  #6  
Old August 12th, 2005, 10:41 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
Hi Jay,
the MSComm1.Input will give a result, no watter what is connected on the other side
You just need to desifer the incomming stream(interupt) but it seems that you already now what you are looking for($GPGSV)
You can just hook it up to the port and use the onCom event to get the input
Let me know if you need anything else
Cheers
Jako
AKA noFriends

Reply With Quote
  #7  
Old August 12th, 2005, 11:25 AM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 741 Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 9 h 29 m 50 sec
Reputation Power: 22
Accessing Com Port

I need to get the GPS Unit in house and give this a try....thank you much for your help....and if I do have any other issues I will be posting them here....

THanks again.....

Reply With Quote
  #8  
Old August 12th, 2005, 12:40 PM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1Folding Points: 107973 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
no problem, and good luck

Reply With Quote
  #9  
Old August 19th, 2005, 11:14 AM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 741 Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 9 h 29 m 50 sec
Reputation Power: 22
Accessing Com Port

I have been trying to get the NMEA to read in the hyper terminal on my lap top. I have an output beign displayed but it is all coded text...I cant read it. I made sure the settings in the Trimble Unit were set in the hyper terminal:

Baud 9600
Data bits 8
Stop Bits 1
Parity Odd

In the hyper terminal there are other settings......What about the:
Transfer Protocol?
Emulation / Terminal?

Thanks

Jay

Reply With Quote
  #10  
Old August 19th, 2005, 03:01 PM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 741 Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 9 h 29 m 50 sec
Reputation Power: 22
I ahve the Hyper Terminal reading now....starting to work on the coding....thanks for your help so far.....

Jay

Reply With Quote
  #11  
Old August 19th, 2005, 04:39 PM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 741 Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 9 h 29 m 50 sec
Reputation Power: 22
If I place your code with the one modification ($GPGGA) it should pop me a message box right?

I placed this code in an Access Database at the end of my code in a form.

I am sucessfully getting the NMEA strings at the Comm Port. I can see them in the Hyper Terminal. Now I just need to grab that string and bring it into Access.....


CODE:

Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent

Case "$GPGGA"
buffer = MSComm1.Input
MsgBox StrConv(buffer, vbUnicode)
Case Else
MsgBox "Unknown error or event"
End Select
End Sub

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Accessing Com Port


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |