From: BeeJ on
VB6
I have two timers running.
In each timer routine I need to have a variable delay (10 mSec to 1000
mSec). The delay only needs to be accurate to a few mSecs but should
be consistent each time it is encountered.
What is the best way to do these "simultaneous" delays so they do not
interfere with each other?
Is for example Sleep 10& acceptable or do I have to write a class with
a CreateWaitableTimer and instantiate one for each timer subs?
This is a hardware interface.


From: Dee Earley on
On 20/07/2010 03:13, BeeJ wrote:
> VB6
> I have two timers running.
> In each timer routine I need to have a variable delay (10 mSec to 1000
> mSec). The delay only needs to be accurate to a few mSecs but should be
> consistent each time it is encountered.
> What is the best way to do these "simultaneous" delays so they do not
> interfere with each other?
> Is for example Sleep 10& acceptable or do I have to write a class with a
> CreateWaitableTimer and instantiate one for each timer subs?
> This is a hardware interface.

If they can't interfere, then they should really be in separate threads
(and not on a multitasking OS :)

For the consistency, you will probably need to use multimedia timers,
but then you get problems if they occur at the same time.
What tasks is it doing in the event?

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
From: BeeJ on
Dee Earley brought next idea :
> On 20/07/2010 03:13, BeeJ wrote:
>> VB6
>> I have two timers running.
>> In each timer routine I need to have a variable delay (10 mSec to 1000
>> mSec). The delay only needs to be accurate to a few mSecs but should be
>> consistent each time it is encountered.
>> What is the best way to do these "simultaneous" delays so they do not
>> interfere with each other?
>> Is for example Sleep 10& acceptable or do I have to write a class with a
>> CreateWaitableTimer and instantiate one for each timer subs?
>> This is a hardware interface.
>
> If they can't interfere, then they should really be in separate threads (and
> not on a multitasking OS :)
>
> For the consistency, you will probably need to use multimedia timers, but
> then you get problems if they occur at the same time.
> What tasks is it doing in the event?

Writing data to different addresses on the same USB port. It is the
same hardware device that has three output ports and three input ports.
I am also polling the input ports for changes and raising an event on
change.
It only has to look like things are happening simultaneously and
smoothly so I am not expecting the much more than 20 mSec (worst case)
granularity and hoping for 2 to 4 mSec (worst case) regularity.
This is all happening in an ActiveX EXE.


From: David Kaye on
BeeJ <nospam(a)nowhere.com> wrote:

>What is the best way to do these "simultaneous" delays so they do not
>interfere with each other?

Run separate apps out of process.

From: BeeJ on
David Kaye was thinking very hard :
> BeeJ <nospam(a)nowhere.com> wrote:
>
>> What is the best way to do these "simultaneous" delays so they do not
>> interfere with each other?
>
> Run separate apps out of process.

I am writing ActiveX EXEs for each device; however, each device several
simultaneous delays.

I am only looking for the best that can be done on a non-real-time OS.