Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

10ms Delay in VB 6.0 ?

Status
Not open for further replies.

SphinX

Advanced Member level 3
Advanced Member level 3
Joined
Jan 25, 2002
Messages
822
Helped
58
Reputation
116
Reaction score
29
Trophy points
1,308
Location
EGYPT
Activity points
7,045
delay in vb 6.0

Hi,

I want a accurate 10ms delay in my program

i use this

Sleep 10

in module i write
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Is that right, my program is not working :-(
I need this delay to erase the AT89C51/52 chip

Thanx
 

delay in vb

hey sphinX u dont have to give a very accurate delay to erase the flash . It should be more than 10ms i guess . So ur sleep should work or else try using a delay based on the getSytemTick concept. Which programmer are u trying to interface..??
 

wait function in vb 6.0

H mcs51,

I try to interface to this programmer

**broken link removed**

SphinX
 

delay in vb 6

Hi ALL Guys,

Thanx for all your help.
I found the mistake , Now i am finishing the program GUI .

It'll available on Elektroda after 2 or 3 days.

:)

Sphinx Of Egypt
 

wait command in vb 6.0

Hi,

You can get very accurate delay using queryperformancetimer and queryperformancefrequency functions, but that's in Visual C++ :)

Cheers !
 

frequency counter by pc vb

Drag a timer into your form, set it at 10...

load up first before anything
form1.text1 = 0

if form1.text1 = 0 Form1.Timer1.Interval = 0
Form1.Timer1.Interval = 10

then on your timer double click it and put in
Form1.text1= 1

well it's something like that anyways

also if anyone knows how to Get rid of the cursor blinking while the program/game is running i'd like to know...
cheers
 

vb 6.0 delay

also if anyone wants to be nice and donate me like 5 points i'd appreciate it :p
actually even if u donate 1 point i'd be happy... just i wanna get something and i'm still a new user :(
but if any of you get to play lands of crom i'll help out with anything i was able to do in there... like say keyboard keypress hotkeys like thing cause i found that was really hard to find code for, for visual basic 6.0 anyways
thanks
 

how to call delay in vb6

hi,

On Pentium class processors, you can use the TSC register witch counts processor's clock cycles from power on. You need to caculate CPU frequency before using TSC register. There is a lot of description on the subject, try a search with google. There is a well done old Intel pdf file on the subject :

h**p://www.math.uwaterloo.ca/~jamuir/rdtscpm1.pdf

* = t
 

visual basic 6 timer interrupt second

valcarni said:
Drag a timer into your form, set it at 10...

load up first before anything
form1.text1 = 0

if form1.text1 = 0 Form1.Timer1.Interval = 0
Form1.Timer1.Interval = 10

then on your timer double click it and put in
Form1.text1= 1

well it's something like that anyways

also if anyone knows how to Get rid of the cursor blinking while the program/game is running i'd like to know...
cheers
That won't help because Timer Activex has overhead of 55mS. So you won't get anything less than 55mS. Even if you set Interval = 1mS it will give a delay of 55mS.
Use API instead. "QueryperformanceTimer" API works best for small delays.
 

vb6 timer problem windows freeze

Hi,

This link gives some advice how to use the API. I have tested some and got good results. By following some of the described rules, you can easily reach 1 to 2 ms delays.

h**p://www.geisswerks.com/ryan/FAQS/timing.html

* = t
 

how to set up a delay timer in vb 6.0

Easy question, easy answer. why? because you want pause code, not timer...

in the attachment you will find related routines.

if you want to gui replying or using events
Call WaitDoeventsX (WaitTimeInMilliseconds)

else use
Call WaitX (WaitTimeInMilliseconds)

look at loops... it can be interesting advantages...

Call WaitX(10) 'will wait 10ms
Call WaitX(1000) 'will wait 1second

Call WaitX(0.5) 'will wait 500 MICRO second

In my computer its resulation 0.3 microseconds (1/3570000).

You can use also timerX function to measure to your code speed.
dim a as double
a= timerx
...
..
debug.print "timerequired=", timerx-a



NOTE:

VB's timer component will not work...
Timer() function will not work...
GetTickCount() will not work for pausing in miliseconds...
because their resulation depends on computer you are using.
it doesnt static ant vary from 16.25ms to 55ms in general...

sleep may not good idea because it cannot guarantee 10ms and your app will freeze completely.
 

delay of 1 second in vb 6

If you want to wait for erasing AT89C51 you have many ways:
- write a subroutine delay 10ms in assembly for AT89C51 (master), after the master erased the slave, it will send announcement to PC to send data for programming slave.
- use Timer component in VB6 on Toolbox page (Clock fig.). put it on your form. Modify properties (Interval property) =10 (unit in miliseconds).
Good luck.
 

delay function in vb 6.0

TRUNGDPHAN,

you can't use VB's timer component to wait/pause 10ms.
also timer function is useless for 10ms.

check your system. Timer Component and timer function's resulation depends on computer you are using.

min resulation is from 16.25ms to 55ms in most systems.
if your system's timer resolation is 16.25 ms then you can use 16.25=17 ms, 16.25*2=33ms, 16.25*3=49 ms.

if set timer1.interval=10 then timer event will be triggered 17 millisecond later...
 

setting delay in vb6

I really agree with you. Do you have any ways to delay that doesn't depend on the system?
 

minimum value of delay using gettickcount in vb6

Hi ben123,
What is the configuration of your computer that gives you a 0.3 microseconds resulation ?
:)
 

vb6 10ms timer interval

Hi

On most recent PC, Performance Counter frequency is 3,579,545 Hz. The period of this clock is 1 / 3,579,545 = 279.3ns. On older PC, the frequency value was 1,193,000 Hz (838.2ns).

To read the Performance Counter Frequency value of your PC, use QueryPerformanceFrequency () API's function.

To read current Performance Counter value, use QueryPerformanceCounter() API's function.

See MSDN's site to get more information about these functions (use search) : h**p://msdn.microsoft.com/

* = t
 

how to set up timer in vb 6.0

I think that CAN NOT use APIs for highly delay timer.

Problem is system share its timer for many programs. In Windows, I tried with some APIs functions, and result is about 18.2 times/second.

I think that you should write your own timer interrupt handler. We can use with 8192 times/second.
 

delay with visual basic 6

Hi,

Have a look at this :

h**p://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconaccessingdllswindowsapi.asp

After that, have a look at that :

h**p://www.geisswerks.com/ryan/FAQS/timing.html

By setting the system sleep to a 1 ms boundary as described in one of the last link example, you can reach the sleep duration you want.

* = t
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top