« ModBus Master in VB2005 (.NET) | Main | Tech Support: Converting to MultiTrack #2 »

Tech Support: Converting to MultiTrack

Kelly wrote:

Hi David

I'm converting some older code to multitask.

In subroutines where I have used PAUSE or similar, can I just use the
supertimer and do I need to have all "yieldtask" instructions in the
task itself ?

PAUSE, WaitOnT etc. will work in a MultiTrack task. They hold up that task but no others. You don't have to build a Pause using the supertimers.

The supertimers come in where you need to have a loop waiting for something not covered by an existing timed wait, and/or one of several possible outcomes. For example, this loop will continue until timeout or one of two possible events.

;Wait for something to happen, timeout after 60s

MarkTime ;Capture "now"
WaitLoop YieldTask
GoIfInOn iSwitch,GotSw ;Test 1st condition
GoIfST sOverLoad,OvLd ;Test 2nd condition
LoopIfTiming 6000,WaitLoop ;Keep waiting for 60s
GoTo TimeOut

TrackBack

TrackBack URL for this entry:
http://www.splatco.com/cgi-sys/cgiwrap/microcon/managed-mt/mt-tb.cgi/43

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


About

This page contains a single entry from the blog posted on April 24, 2007 12:45 PM.

The previous post in this blog was ModBus Master in VB2005 (.NET).

The next post in this blog is Tech Support: Converting to MultiTrack #2.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.33