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:
  #46  
Old August 29th, 2005, 11:27 AM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 743 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 45 m 27 sec
Reputation Power: 23
NoFriends - I thank you sdo much fro your help....it is very appreciated. As for the strign not showing up complete you have got me. I cannot get it to work.

I push the return to the Text Box and I only get "$".
I push the return to a message box and I get "$GPGGA,"

I use the delay and the message box and I get multiple strign returned. I get "GPGLL", "GPGGA", "GSVRV" etc. It seems that when I use the delay It stops filotering out the "GPGGA" string I am looking for.......

Do you knkow of any other ideas I should research as to why it is not grabbing the particular string I am after?

Thanks Again......

Reply With Quote
  #47  
Old August 29th, 2005, 12:35 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: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 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,
I am at a loss at the moment

I would suggest to research how your specific unit send through the data to the comm port, it my instance, it was only a one line input string, and only one at a time, maybe your unit handles it a bit differently?
Comments on this post
Jaykappy agrees: I would give more repuatation points to nofriends if I could. He or She (dont know which) was an
amazing help to me. I learned a lot with this little application and the support of nofriends.
THANK YOU...
__________________
Look! Its a ShemZilla



Reply With Quote
  #48  
Old August 31st, 2005, 02:15 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: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 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,
thanx for the comments
I am a he if you were wondering

How is it going with the application?

Reply With Quote
  #49  
Old August 31st, 2005, 03:09 PM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 743 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 45 m 27 sec
Reputation Power: 23
Going well.....I have accomplished most of what I set out to do:

Push the NMEA String to the Comm Port.
In Access, write some code that will read the Comm Port
Grab the NMEA String
Split it apart by commas
Write each to a variable
Show said variables in Text Boxes.

Thats 90% of what I set out to do. I have an Access db with a Form in it. It has a ton of Input Boxes that are collecting various data. I am now attampting to join the two applications, in such, adding the GPS coordinates to the database for location inside a GIS Application.

Currently I am not concerned with combining the two applications. I am just trying to get the variables to write to a table in the database rather than the TextBoxes. I know this involves taking a different angle am I am researching that now. I think I have to write some code to connect to the specific table then push the specific variable to that field?

Something along these lines:

Dim rs As DAO.Recordset
Set rs = Me.Recordset

Think this gets me into the recordset but dont know how to specify the table? Nor right each specific variable to the table in that record.....

The Me. terminology is a bit confusing the me

Dont mean to bother you but if have any suggestions please feel free.....again thank you for your help.....
Comments on this post
nofriends agrees: nice work Jay!

Reply With Quote
  #50  
Old August 31st, 2005, 03:35 PM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 743 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 45 m 27 sec
Reputation Power: 23
FOR ANYONE READING THIS....HERE IS WHAT I HAVE SO FAR. ANY QUESTIONS PLEASE FEEL FREE TO ASK.....THIS IS ALL WORKING. I WILL BE ADDING TO THIS IN THE NEAR FURTURE AND WILL AGAIN POST MY CODE FOR ANYONE INTERESTED IN DOIGN THE SAME......


CODE:



Option Compare Database
Dim NMEAString As String
Dim NMEAString2 As String
Dim X As String
Dim Y As String
Dim LongHem As String
Dim LatHem As String
Dim Elev As String
Dim ElevUnit As String
Dim NewCoords As String
Dim TEST As String

'=============================================
'=============================================

Private Sub Command8_Click()

MSComm6.InBufferCount = 0 'Flush the Buffer


If (Not MSComm6.PortOpen) Then

Dim Instring As String ' Buffer to hold input string
MSComm6.CommPort = 1 ' Use COM1.
MSComm6.Settings = "9600,N,8,1" ' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm6.InputLen = 0 ' Tell the control to read entire buffer when Input is used.
MSComm6.PortOpen = True ' Open the port.
MSComm6.Output = "AT" & vbCr ' Send the attention command to the modem. Ensure that the modem responds with "OK".
Buffer$ = Buffer$ & MSComm6.Input ' Wait for data to come back to the serial port.

'MsgBox "SMS Port Open", vbOKOnly, "Port State"

Else
MsgBox "SMS Port Already Open, It is now closing", vbOKOnly, "Port State"
MSComm6.PortOpen = False
End If


End Sub
'=============================================
'=============================================

Public Sub MSComm6_OnComm()

Select Case MSComm6.CommEvent

Case comEvReceive

Dim Buffer As String 'These two lines allow the Buffer variable
Forms!GPS_RETRIEVE!TEXTBOX.SetFocus 'to be passed into TextBox

MSComm6.InputLen = 0 'Set Buffer to zero or delete all in buffer

Call Wait(1, 1)

Buffer = MSComm6.Input
NMEAString = Buffer
NMEAString2 = Buffer

If InStr(Buffer, "$GPGGA") > 0 Then 'See if it has GPGGA in front
TEXTBOX.Text = Buffer 'TEXTBOX.Text = StrConv(Buffer, vbUnicode)
' MsgBox Buffer 'MsgBox StrConv(Buffer, vbUnicode)
MSComm6.PortOpen = False 'Close the Port
End If

Case Else

MsgBox "No NMEA String Found"

End Select

End Sub

'=============================================
'=============================================

Private Sub ClosePort_Click()

If MSComm6.PortOpen Then
MSComm6.PortOpen = False 'Close the Comm Port OnClick
Else
MsgBox "The Communications Port is closed"
End If

End Sub

'=============================================
'=============================================

Public Sub GetString_Click()

Dim s As String, sItems() As String
Dim i As Integer
Dim NMEA As String

NMEA = NMEAString
'''''''''''Sets the Variable from MSComm6 to NMEA
sItems = Split(NMEA, ",")
''''''''''''This splits by a comma. Change if needed","

i = 0
For i = 0 To UBound(sItems)
''''''''''''Sets i to the Upper Bound of sItems or the NMEA String
NewCoords = Trim(sItems(i))
''''''''''''Trims the spaces on either side of the string
If i = 2 Then
'''''''''''''Looks for the 2nd word in the string
X = NewCoords
'''''''''''''Sets the 2nd word to the variable First1
ElseIf i = 3 Then
LongHem = NewCoords
ElseIf i = 4 Then
Y = NewCoords
ElseIf i = 5 Then
LatHem = NewCoords
ElseIf i = 9 Then
Elev = NewCoords
ElseIf i = 10 Then
ElevUnit = NewCoords
ElseIf i = 14 Then
TEST = NewCoords
End If
Next 'Walks through the string

'MsgBox X 'Returns the variables in a message box
'MsgBox LongHem
'MsgBox Y
'MsgBox LatHem
'MsgBox Elev
'MsgBox ElevUnit



Forms!GPS_RETRIEVE!txtXCoord.SetFocus 'to be passed into TextBox
If X = "" Then
txtXCoord.Text = "NO VALUE"
Else
txtXCoord.Text = X
End If

Forms!GPS_RETRIEVE!txtLongHem.SetFocus
If LongHem = "" Then
txtLongHem.Text = "NO VALUE"
Else
txtLongHem.Text = LongHem
End If

Forms!GPS_RETRIEVE!txtYCoord.SetFocus
If Y = "" Then
txtYCoord.Text = "NO VALUE"
Else
txtYCorrd.Text = Y
End If

Forms!GPS_RETRIEVE!txtLatHem.SetFocus
If LatHem = "" Then
txtLatHem.Text = "NO VALUE"
Else
txtLatHem.Text = LatHem
End If

Forms!GPS_RETRIEVE!txtElev.SetFocus
If Elev = "" Then
txtElev.Text = "NO VALUE"
Else
txtElev.Text = Elev
End If

Forms!GPS_RETRIEVE!txtElevUnit.SetFocus
If ElevUnit = "" Then
txtElevUnit.Text = "NO VALUE"
Else
txtElevUnit.Text = ElevUnit
End If

Forms!GPS_RETRIEVE!Text37.SetFocus
If TEST = "" Then
Text37.Text = "NO VALUE"
Else
Text37.Text = TEST
End If

'If TEST <> "" Then
'MsgBox TEST
'End If
'txtXCoord.Text = Test

'Dim Count As Integer
'Dim rs As DAO.Recordset
'Set rs = Me.Recordset
'Count = rs.RecordCount
'MsgBox (Count & " records")



End Sub

'==============================================
'==============================================

Public Sub MSComm6_OnUnload()

MSComm6.PortOpen = False 'Close the Comm Port upon closing of the form

End Sub

'=============================================
'=============================================

Function Wait(Delay As Integer, DispHrglass As Integer)

' This function creates a time delay you must use a call to run it Call Wait(2,1)

Dim DelayEnd As Double
DoCmd.Hourglass DispHourglass
DelayEnd = DateAdd("s", Delay, Now)
While DateDiff("s", Now, DelayEnd) > 0
Wend
DoCmd.Hourglass False

End Function

Reply With Quote
  #51  
Old September 1st, 2005, 02:20 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: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 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,
you can use the docmd.runsql command to insert the values into the database
instead of the text fields
Code:
strSQL = "insert into gpsTable (field1, field2) values(get these from the variables)"

DoCmd.setWarnings False
	DoCmd.RunSQL strSQL
DoCmd.setWarnings True

hope this helps

Reply With Quote
  #52  
Old September 1st, 2005, 03:33 PM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 743 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 45 m 27 sec
Reputation Power: 23
Question:

For the sake of this email...when I say data text boxes I mean the multiple text boxes used for the data collection. These update the database. From App1
When I say XY text boxes I am refering to the app2 that I have been working on to grab the NMEA String

NOTE: I brought the two apps together into one database. They work fine seperatly. I am now tryingto bridge the two...


App 1
I have a bunch of text boxes that are set up in a form that eventually update a database. And as such each of the text boxes has its control source set up to point to the Field in the Table.

App2
Now....I have a few other text boxes set up to grab the XY NMEA string that I have been working on.

If I set the control source of the data text boxes (app1) to the value of the the XY text boxes (app2) I do get the value to populate the app1 text box. Great! But now the control source is not pointing to the field in teh table for update. It reads it but will not update it.

Is there a way to push the value (from App2) to the text box (app1) while maintaining the link to the table. That is keep the control source (text box of app1) pointing to the Table and write additional code to push the valueof the variable the app1 text box

Does any of that make sense?

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Coding String from Com Port into Access


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT