User Tools

Site Tools


jvs:cigal:manual:chapter6:rt_syntax

CIGAL Reference Manual, Chapter 6 (RealTime): RT_SYNTAX

RT_SYNTAX -- Description of REALTIME's operator syntax

        The REALTIME operators are different from normal CIGAL commands
        in that they have more rigid command syntax and only the REALTIME processor recognizes
        them.  The character "R_" (e.g. R_ERASE) identifies REALTIME operators.

The basic syntax for REALTIME operators is:

        opname  opflag eventflag exectime oparg1 oparg2 ...

These arguments have the following meaning:
  OPNAME        - the operator name (e.g. "r_erase")
  OPFLAG        - an operator flag (default 0) whose bits indicate:
1)      Proceed directly from this operation to the following operation without permitting operations
in any other realtime processing stream to intervene. Normally operations in multiple parallel
processing streams would be interleaved according to their respective EXECTIME timing considerations.
2)      Log this operation in the RUNLOG record (see [REALTIME][2]).  The logging operation is
identified in the log by its opcode value; for a list of all opcode values see [RT_OPCODES][6].
3)      High priority timing
4)      Low priority timing

  EVENTFLAG - user defined flag to be entered in the runlog if OPFLAG has the 2 bit set.
  This helps to identify which line caused the entry.  The default value is 0.
  EXECTIME  - the time (in 20 usec clock ticks) at which the operation is to occur. This is
  a long (32-bit) value.  Normally this time is relative to the clock's zero time
  (either the start of the REALTIME or the most recent R_RESET or R_SRESET op).
  If this operator is in a R_REPEAT loop the time is relative to the start of that loop.
  If EXECTIME is preceded by a '+' character (as in "+10000") then the time is relative to
  the previous operation. Normally this starts the previous operation except when the
  previous operation is a wait (eg. R_UWAIT, R_DWAIT etc.) in which case it is relative
  to the end of the wait. If EXECTIME is 0 or missing (eg. '-') this operator is executed
  as soon as possible.

      Note: OPFLAG, EVENTFLAG and EXECTIME are evaluated only once, when the
          REALTIME program is first compiled so they cannot be changed during
          execution.  If you want to control event timing dynamically use the
          R_WAIT operator.  If you want to log selected events use the R_LOGVAL
          operator.  OPFLAG, EVENTFLAG and EXECTIME all default to zero when
          missing so it is common to use '- - -' for these 3 fields when
          explicit values are not required.

OPARG1    - the remaining arguments to a REALTIME operator are operator specific.
Refer to the description of individual operators for their meanings.  These arguments
are evaluated at runtime so that unlike the first 3 arguments their values can change
during execution.  See the following important notes.

      Note 1: The OPARGx arguments are all treated as pointers to data
              variables. If you enter a constant (e.g. 123) a pointer is
              created to a temporary pseudo-variable.  These pointers can
              be manipulated using the R_SEEK, R_INCR, R_TELL operators and
              by the auto-increment features described in Note 4.  The
              standard way to write REALTIME programs is to generate tables
              of values in arrays or matrices and then step through those
              tables by advancing the pointers.  The OPARGx argument is the
              name of the whole data variable (without any subscripts)
              whereas the part of the variable that will actually be used
              is the part located at the current pointer position.
      Note 2: Moving data variable pointers (e.g. R_SEEK) inside a REALTIME
      program has no effect on how that variable is used outside of the REALTIME command.
      Note 3: The size of an OPARGx data word is fairly flexible in that it
      will generally allow either integer (i.e. 16 bit) or long
      (i.e. 32 bit integer) data values for arguments that expect number values.
      However, for some arguments such as the variable to be loaded by a read operator
      or variables that specify x-y points or rectangles, the word size must
      match that expected for that operator. Check the syntax specifications for the
      individual operators for their requirements.
      Note 4: The first OPARG (e.g. OPARG1) is unusual in that you can add
                an autoincrement flag to the data variable.  This is done by
                putting "++" immediately after the variable name (e.g. i1++).
                This causes the pointer for that variable to be automatically
                incremented at the end of the operation. The number of bytes
                that the pointer is incremented is determined by the operator
                itself; if the argument is a short integer it will increment
                by 2 bytes, if it is a long or a point (e.g. x,y value) it will
                increment by 4 bytes.  Some operators can also autoincrement
                other arguments (e.g. R_AREAD) but the "++" syntax is only
                recognized on OPARG1.

See Also:
REALTIME(2), RT_OPCODES(6)

CIGAL Home, CIGAL Manual, RealTime List, Manual Help

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