3 Replies - 4222 Views - Last Post: 28 August 2010 - 03:28 AM Rate Topic: -----

#1 maada  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-August 10

stop-watch using Vb

Posted 26 August 2010 - 06:41 AM

i'm designing a program using vb requiring a clock display that starts when a certain switch is closed in an external circuit and stops when the switch is opene.how do i go about it?
Is This A Good Question/Topic? 0
  • +

Replies To: stop-watch using Vb

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10567
  • View blog
  • Posts: 39,113
  • Joined: 27-December 08

Re: stop-watch using Vb

Posted 26 August 2010 - 06:44 AM

Moved to VB6 from the VB Tutorials Section.
Was This Post Helpful? 0
  • +
  • -

#3 parbipin  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 95
  • Joined: 23-August 10

Re: stop-watch using Vb

Posted 26 August 2010 - 11:48 AM

"how do i go about it?"

this is pretty vague; tell us what do you want to do and how do you plan to do it? and then post a sample of your code.

A hint: however will be:

1) get a timer
2) on the switch close event enable the timer
3) on the switch open event disable the timer & record time elapsed
Was This Post Helpful? 0
  • +
  • -

#4 bytelogik  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 212
  • Joined: 06-October 09

Re: stop-watch using Vb

Posted 28 August 2010 - 03:28 AM

Which port are you using to connect your "external circuit"
1) LPT : You need to use io.dll to get data from the status pins of LPT port. Search on-line for VB6 LPT port interfacing. Once you get the ON/OFF signal from the port, you can Enable / Disable the Timer in your project.

2) Serial port : Use MS Comm control to read serial port data.

3) USB port : You need PIC18F...micro-controller or dedicated USB IC , or USB to Serial adapter to read the USB port.

4) Sound port : Difficult, noisy and crude. Need to modify your circuit to generate audio signal for the switch.

Thus, it all depends on how you get the ON/OFF signal from the external circuit to your VB6 project.
Once you get the value, it's the same as using simple boolean variable to enable/disable the timer control.
Also, if analog clock design a little more math.

Good Luck.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1