« Tech support: Motor positioning | Main | Tech Support: Interval measurement »

Tech Support: Many timers

Kevin asked:

Is there any way to set a PAUSE with a number in W? I have an j indexed program (15 channel) and need to have a pause for each one set by a multitude of parameters.


Hi Kevin, take a look at this:
tmrJTimer       defTIME24    15      ;Set aside 15 timers
fJTargetInterval defFloat    15      ;15 target times

; ......  in jndexed code, want to delay W x 10mS

        fStore          fJTargetInterval   ;Save target interval from W
        STStart         tmrJTimer       ;Capture "now"
jTiming:
        YieldTask
        fSTTimeSince    tmrJTimer       ;How long since STStart
        fRecallQ        fJTargetInterval ;How long we want
        fSUB                            ;Target-Elapsed.
                                        ;Negative if Elapsed > Target
        fGoIfPos        jTiming         ;G/  Elapsed <= Target

;.... delay done
You would include this code in a MultiTrack task, and simply launch 15 instances of the task with J values 0-14. The rest is automatic. In effect you get an array of tasks.

TrackBack

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

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 July 7, 2007 7:26 PM.

The previous post in this blog was Tech support: Motor positioning.

The next post in this blog is Tech Support: Interval measurement.

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