473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Program Flow

So I'm writing an interface for my GPS unit and I've come up with a few
questions 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

Sep 22 '06 #1
3 1224
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.

Sep 22 '06 #2

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

Sep 22 '06 #3
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 ...


<fr**********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.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

Sep 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Albert Ahtenberg | last post by:
Hello, I had some bad experience with code organization and script functionality in writing my php based applications. And as the applications get bigger in scale it gets even worse. Therefore,...
4
by: Bruce W...1 | last post by:
A scripting newbie question... I'm trying to understand some code I found. This script conducts a poll and writes the results to a text file. The following statement is part of the source file. ...
3
by: Kelvin Klein | last post by:
Is there a visualization tool for C program out there? Is there a visualization tool for the language of one of the crossposted newsgroup out there? I am a refuge from comp.lang.c, kicked out...
1
by: Will Stuyvesant | last post by:
I never used the popen or popen2 libraries but it is my understanding that they can capture the output of console based programs. Is it also possible to send keystrokes to console base programs? ...
7
by: jacob navia | last post by:
Suppose that you want to know where your program has passed, i.e. the exact flow of the program. A brute force solution is to make an array of n lines, n being the number of lines in the...
1
by: Brett | last post by:
I'd like to have all of my documentation in one place. I use the following for documenting code: - attributes for certain types of documentation - use of the C# generated inline XML...
7
by: Buck Rogers | last post by:
Hi all! Newbie here. Below is an example from Teach Yourself C in 21 Days. My apologies if it is a bit long. What I don't understand is how the "get_data" function can call the...
8
by: lovecreatesbea... | last post by:
K&R 2, sec 2.4 says: If the variable in question is not automatic, the initialization is done once only, conceptually before the program starts executing, ... . "Non-automatic variables are...
6
by: Crooter | last post by:
Hello colleagues, Could anybody tell me if there are existing open-source solutions to extract the program tree using a program source code? I'm aware that GCC has program flow information and...
3
by: 100grand | last post by:
Modify the Inventory Program to use a GUI. The GUI should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.