User Tools

Site Tools


jvs:cigal:manual:chapter6:r_repeat

CIGAL Reference Manual, Chapter 6 (RealTime): r_repeat

r_repeat -- Begin a loop of repeated operations

usage: r_repeat opflg eflag ltime NRepeats Interval [Flag IntvlFlag]

R_REPEAT is a REALTIME operator. It indicates the beginning of a block of operations that is to be executed more than once (the end of the block is identified by a corresponding R_END operator).

The number of times the block is repeated is specified by NREPEATS; this is a long value and must be greater than zero or else the block is never executed. If NREPEATS is omitted the REPEAT block will cycle indefinitely. INTERVAL is also a long value; it specifies the amount of time (in 20 usec ticks) that must elapse between the start of one repeat cycle and the start of the next. If INTERVAL is omitted the cycle repeats as fast as possible.

An important feature of R_REPEAT is that blocks of repeated code can be executed synchronously or asynchronously. In addition, different blocks of code can be set to display in different screen windows. These features are controlled by the value of FLAG as follows:

0 - (Default) R_REPEAT executes SYNCHRONOUSLY. For synchronous execution
    the next operator after the end of the block is not executed until
    the block has finished all of its cycles.
1 - the block is executed asynchronously. This means that the REALTIME
    processor starts a new parallel processing stream to execute the
    R_REPEAT block, and at the same time the original processing stream
    continues to execute the operators that appear after the block.
2 - the block is executed asynchronously as above; it is also excluded
    from consideration by the R_SYNCH operator, which can otherwise be
    used to synchronize the execution of asynchronous blocks.
4 - this block should be started using RT display screen 2, if available.
    Screens are controlled by the RT1RECT, RT2RECT matrices.
    They are usually set to a physical monitor screens SCR1RECT, SCR2RECT.

INTVLFLAG is a bit flag used for controlling interval timing options as:

1 - the specified INTERVAL is to be treated as a minimum cycle time. If
    one cycle is delayed for any reason the next cycle will still take
    INTERVAL time to complete. Otherwise, the INTERVAL is treated as an
    absolute timer so that is one cycle is delayed subsequent cycles
    will execute more quickly in order to try and complete all NREPEATS
    cycles within the specified time (NREPEATS * INTERVAL).
2 - the INTERVAL argument is a long array variable specifying different
    time intervals for each cycle.  The INTERVAL pointer is incremented
    by 4 bytes after each cycle.

See Also:
CIGAL Home, CIGAL Manual, RealTime List, Manual Help

jvs/cigal/manual/chapter6/r_repeat.txt · Last modified: 2023/02/23 18:43 (external edit)