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?
stop-watch using Vb
Page 1 of 13 Replies - 3234 Views - Last Post: 28 August 2010 - 03:28 AM
Replies To: stop-watch using Vb
#2
Re: stop-watch using Vb
Posted 26 August 2010 - 06:44 AM
Moved to VB6 from the VB Tutorials Section.
#3
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
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
#4
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.
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.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote








|