|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Program Flowquestions about how VB works. This is my first experience with a 'visual' programming language, and it's a little differient than the console style I'm used to. At this point, my interface works to a degree. It was built in VB .NET 2003 and it has a windows form on it with a button and a text field. Whenever you hit the button, the form reads in the data from the GPS, displays it in the appropriate blanks, and then writes that data to a logfile. The form then does nothing until you hit the button again at which point it updates the data and marks a new point in the log. While this does accomplish my original objective (creation of a logfile), I would like the data fields in the form to update themselves in real time. The GPS spits out a data stream every second, and while I do not need all that data logged, it would be useful to have a real time readout of measurement accuracy. If I could begin to update the data in the fields as soon as the application starts, then the button would only need to be pressed when I want to create an entry in the logfile. In pseudo code, this is what I'm trying to do... \\\ Start Init Serial Port Repeat Read GPS Data Update GPS Data in Form If Button Pressed Output data to logfile Until Close End /// I'm a little confused as to how to do this in VB, so any pointers would be very appreciated. Thanks in advance. -Matt > I'm a little confused as to how to do this in VB, so any pointers would Drag and drop a "Timer" component onto your form. Set the timer tick > be very appreciated. > property to around 2000 (2 seconds) and then handle the "Tick" event. The timer will fire the event once every two seconds. In the event you can read your GPS and update the text box. Robinson wrote:
> > I'm a little confused as to how to do this in VB, so any pointers would Thanks a lot... worked like a charm!> > be very appreciated. > > > > Drag and drop a "Timer" component onto your form. Set the timer tick > property to around 2000 (2 seconds) and then handle the "Tick" event. The > timer will fire the event once every two seconds. In the event you can read > your GPS and update the text box. -Matt and now ...
create a second timer ... run it every 10 seconds (or some other realistic interval) to write information to your log file ... that way you do not rely on the user to press a button each time they want to create a log entry ... <freeman.m***@gmail.com> wrote in message Show quoteHide quote news:1158942778.634908.317460@m73g2000cwd.googlegroups.com... > > Robinson wrote: >> > I'm a little confused as to how to do this in VB, so any pointers would >> > be very appreciated. >> > >> >> Drag and drop a "Timer" component onto your form. Set the timer tick >> property to around 2000 (2 seconds) and then handle the "Tick" event. >> The >> timer will fire the event once every two seconds. In the event you can >> read >> your GPS and update the text box. > > Thanks a lot... worked like a charm! > > -Matt >
vbCrLf
Querying a database using vb Get value from nested class using reflection Want to know the power-2 based numbers of x OpenGL Refresh problem using CsGL with VB.NET String Comparision Resolving Type mismatch, HOW How to disable the UAC in Vista? How to keep statusStrip at the bottom of the ToolStripContainer .Zip File |
|||||||||||||||||||||||