User Tools

Site Tools


CIGAL Reference Manual, Chapter 2 (Commands): REALTIME

REALTIME -- Execute a series of i/o operations controlled by a real-time clock


  • realtime rtprogram runlog mode
  • realtime
  • realtime 0
  • realtime - {…}

The REALTIME command provides a way to execute a series of operations with precise timing. The command's repertoire of allowable operations is designed to provide most of the building blocks necessary to control the video display, read and write analog and digital data using peripheral hardware capabilities, and manipulate data within the computer's memory. The available operations also provide a fairly comprehensive programming environment thatincludes direct access to all of CIGAL's data variables. Most importantly, REALTIME operations have been optimized for rapid execution and the command itself arbitrates scheduling issues to provide accurate and consistent execution timing.

The REALTIME command accepts the following arguments:


Normally, RTPROGRAM is the name of a disk file containing the list of operations and the times at which they are due to execute. REALTIME reads and compiles this list into a series of internal sublists, each of which contains a sequence of operations to be executed in chronological order. The different sublists execute in parallel to provide multiple, independently timed control streams. See help for R_OPS and RTPROGRAM for information about the individual operations and the syntax of the RT program file.

If REALTIME is called with no arguments, a previously suspended RT program is resumed (see R_PAUSE). If the RT_FILE argument is 0, a previously suspended RT program is terminated, releasing all allocated memory. If there is no suspended RT program this command has no effect.

If the RT_FILE argument is a - (minus sign, eg. CIGAL's missing argument placeholder), the REALTIME command reads the list of operations from the standard input (keyboard if entered interactively or current file if running from a macro). The list of operations ends when a '}' command line is encountered, or when you enter a blank line if running interactively; at that point REALTIME compiles the list and begins execution of the operations.


This is an array or matrix variable which REALTIME will fill with a log of the operations it performed and the actual time at which those operations were executed. Which operations generate log entries depends on the operation flags specified in the RT_FILE, as well as the value of the MODE argument (see below). Each entry in the RUNLOG consists of 8 bytes:

                long        exec_time       ; actual time executed
                byte        opcode          ; code for operation executed
                byte        eventflag       ; identifies individual operation
                integer     exec_flag       ; optional op-specific flags

If RUNLOG is omitted, REALTIME executes but does not record a log.


This is a flag specifying REALTIME execution options.

  • 0 - execute RT program normally (default).
  • 1 - check for run-time errors
  • 2 - use 2 display screens if avaailable (default is single screen)
  • 4 - execute RT program normally, except that after each operation has completed the amount of time the operation took is stored in the EXEC_FLAG field of the RUNLOG. (Note: elapsed time only includes the time it takes from the scheduled execution time until the operation completes and does not include any time spent setting up the operation before its scheduled start time.
  • 10o - execute RT program and record elapsed times, but ignoring the scheduled execution times. Each operation begins as soon as the previous operation is completed. In this case the elapsed time recorded is the total execution time required for the operation.
  • 20o - single step through realtime program
  • 40o - log every real-time event (normally on flagged events)
  • 100o - test for timing conflicts
  • 2000o - Use DirectDraw for display
  • 10000o - turn off taskbar explicitly during realtime (Note: sometimes taskbar acts odd when it comes back.)

For more information on the REALTIME processor see HELP on:

  • R_PROCESSOR - an overview of CIGAL's REALTIME processor
  • R_SYNTAX - a description of REALTIME's operator syntax
  • R_SUMMARY - a descriptive summary list of REALTIME operators
  • R_OPS - a summary list showing the syntax of REALTIME operators

For more detailed information on any particular REALTIME operator ask for HELP for that operator (for example, “help r_repeat”).

See Also:

CIGAL Home, CIGAL Manual, Commands List, Manual Help

jvs/cigal/manual/chapter2/realtime.txt · Last modified: 2014/08/04 16:03 (external edit)