The CBI Scheduling Language.

If this is your first encounter with the language, please read:

A Tutorial Introduction to the Language

The rest of this page contains links to reference information.


Miscellaneous information

The list of CBI registers.
The cbiviewer program.

Control program configuration commands.

archive [combine=number, dir=/whatever, filter=true|false]
Configure the data archiver.
close archive|log
Close the current archive or log file.
catalog filename
Load sources from a source catalog file.
flush archive|log
Flush buffered data to the current archive or log file.
horizon elevation
Specify the horizon that is to be assumed by the show command.
logdir directory
Tell the control program where to put subsequent log files.
open archive|log, [dir=?]
Open a new archive or log file.
add_signals {signal_names}
Define the list of signal names.
site longitude, latitude, altitude
Set the location of the CBI.
ut1utc filename
Load an ephemeris of UT1-UTC.
update_year
Send the current year number to the control system.

Hardware configuration commands.

alimits track|scan, az_max, el_max, dk_max
Specify the azimuth, elevation and deck acceleration limits.
camera number
Select an active optical pointing camera.
collimate radio|optical, size, direction, [camera=?]
Specify the radio or optical collimation tilts.
encodersaz_per_turn, el_per_turn, dk_per_turn
Specify the sizes of the azimuth, elevation and deck encoders.
encoder_zero_points az_zero, el_zero, dk_zero, [camera=?]
Specify the encoder angles of zero topocentric azimuth, elevation and deck angle.
flexure flexure, [camera=?]
Enter the measured gravitational flexure of the telescope.
limits az_min, az_max, el_min, el_max, dk_min, dk_max
Specify the azimuth, elevation and deck encoder limits.
monitor [interval=time]
Configure the serial-I/O monitor task.
tilts ha, lat, el, [camera=?]
Specify the tilts in the telescope axes.
rotcor [state=on|off, limit=?, encoder_zero=?, shaft_zero=?]
Specify how and if the elevation rotation meters should be used.
tilt_meter [state=on|off, limit=?]
Specify how and if the azimuth tilt meters should be used.
tv_angle angle, [camera=?]
Record the orientation angle of the optical telescope.
vlimits track|scan, az_max, el_max, dk_max
Specify the azimuth, elevation and deck velocity limits.
zero_rotcor
Zero the rotcor correction applied by the tracker.

Engineering Commands

reboot cpu|rtc|cbicontrol
Restart the control system.
load_reboot_script filename
Load a schedule script to be run whenever the real-time cpu reboots.
setdio board, set|clear|assign, mask
Change the value of the output register of a given digital I/O board.
setreg register, value
Change the value of a CBI register.
shutdown cpu|rtc|cbicontrol
Halt the control system.
strobe
Generate an artificial data-strobe pulse.
unflag board
Unflag a previously unreachable VME board.

Scheduling inquiry functions.

Boolean after(time, utc|lst)
Return true if the current time is after a given time-of-day.
Boolean acquired(operations)
Return true if a specified set of operations has completed.
Boolean between(start, end, utc|lst)
Return true if the current time is within a given window of time.
Interval elapsed()
Return the time spent within the enclosing loop or until statement.
Count iteration()
Return the number of completed iterations of an enclosing loop.

Parameter query functions.

Boolean archive_filtering()
Return true if archive filtering is currently enabled.
Count archiving_interval()
Return the current archiving interval.

Schedule Control Commands.

advance_schedule index number
Move a schedule one or more entries towards the front of the schedule queue.
abort_schedule
Abort the schedule that is currently running.
catch condition {statements} {remedial_commands}
Abort the specified block of commands if the given condition becomes true.
check_schedule filename(arguments)
Check wether the specified schedule would be accepted by the schedule command.
remove_schedule index
Remove a given schedule from the schedule queue.
resume_schedule
Resume execution of a paused scheduling script.
retard_schedule index number
Move a schedule one or more entries towards the back of the schedule queue.
schedule filename(arguments)
Add a schedule to the list of pending schedules.
signal/send|init|clear name
Send a signal to a running schedule.
Signal signaled(signal)
Check whether a given signal has been sent by the user.
suspend_schedule
Temporarily suspend execution of the schedule that is currently running.

Telescope Control Commands.

axes axes
Enable specified telescope axes, and disable the rest.
azscan amplitude, [duration=?, repeat=?]
Perform a scan of a given amplitude, for a given duration.
deck_mode track|zero
Tell the tracker how to position the deck axis when tracking a source.
halt
Stop the telescope drives and put on the brakes.
model radio|optical
Select between the radio and optical pointing models.
offset/add [az=?, el=?, dk=?]
Change the tracking offsets of one or more telescope axes.
radec_offset/add [x=?, y=?]
Change the equatorial tracking offsets.
sky_offset/add [x=?, y=?]
Change the sky-based tracking offsets.
scan file, [repeat=?, scale=?]
Perform a scan in one or more of azimuth, elevation and deck-angle.
slew [az=?, el=?, dk=?]
Slew one or more axes of the telescope to given positions.
slew_rate [az=?, el=?, dk=?]
Reduce the slew rate of one or more telescope axes.
track source
Start tracking a given source .
tv_offset right, up
Adjust the tracking offsets to move the image on the TV monitor.

Miscellaneous Inquiry Functions.

Azimuth azimuth(source)
Return the current azimuth of a given source.
Date date()
Return the current date and time (UTC).
Declination declination(source)
Return the declination of a given source.
Elevation elevation(source)
Return the current elevation of a given source.
Date rise_date(source,utc,horizon)
Return the nearest date and time at which a given source rises.
Date set_date(source,utc,horizon)
Return the nearest date and time at which a given source sets.
PointingOffset sky_to_az(el, angle)
Return the azimuth offset that corresponds to a given great-circle distance.
PointingOffset sky_to_ra(dec, angle)
Return the Right Ascension offset that corresponds to a given great-circle distance.
Interval sky_to_time(dec, angle, utc|lst)
Return how long a source takes to drift across a given great-circle distance.
Time time(utc|lst)
Return the current time of day on a given time-scale.
Date today()
Return today's date (0h UTC).
Date tomorrow()
Return tomorrow's date (0h UTC).

Miscellaneous Inquiry Commands.

show source, [utc=?, horizon=?]
Display contemporary information about a source.

Miscellaneous Commands.

alarm message
Trigger the cbiviewer alarm.
mark one|add|remove, features
Change the set of feature markers to be recorded in the archive.

General Scripting Commands.

break
Prematurely exit the innermost enclosing foreach or while loop.
cleanup {statements}
Register a list of statements to be run when the script terminates.
exit
Terminate execution of the containing script.
<datatype> name = value
Create a new scalar variable and give it a value.
command name(type name, ...) {commands}
Create a new command.
do datatype variable=start,stop,increment {commands}
Repeatedly run a set of commands while stepping the value of a local variable.
foreach(type name) list {commands}
Loop through a set of commands once for each member of a list.
function type name(type name, ...) {expression}
Create a new function.
if(clause) {commands} else if(clause) {commands} else {commands}
Conditionally execute one of a number of blocks of commands.
ifhost(clause) hostname1 {commands} hostname2 {commands} {commands}
Conditionally execute commands that are specific to given cbicontrol hosts.
import filename
Import the contents of another script.
listof type name = {value, ...}
Declare a new variable and initialize it with a list of a given type.
log "string" | $datatype(expr) | $function(args) | $variable
Record a message in the log file and send it to control clients.
next
Prematurely start the next iteration of the innermost loop.
print "string" | $datatype(expr) | $function(args) | $variable
Print one or more arguments according to their types.
return
Finish executing the enclosing command without executing any of its remaining statements.
group name {type name, ...}
Create a new aggregate datatype.
until clause
Halt script execution until the given boolean clause becomes true.
while(clause) {commands}
Repeatedly run a set of commands while the given boolean clause is true.

Environment variables.

hostname
The name of the computer that is running cbicontrol.

CBI Datatypes.

AccelLimit
An acceleration limit.
AcquireTargets
A selection of ongoing transactions.
Altitude
A geodetic altitude (m).
Angle
A generic signed angle (sexagesimal degrees).
AngleLimit
A datatype used to set limits on the magnitude of angles.
ArcFile
An archive file type (archive or log).
Axes
A set of telescope axes.
Azimuth
A telescope azimuth (North=0, East=90, South=180, West=270).
BitMask
A 32-bit number specified as an unsigned number or as a set of bits.
BitMaskOper
The operator to use when applying a BitMask template to a BitMask.
Board
A CBI register-board name.
Boolean
A truth or false value.
Count
A positive integral count.
Date
A Gregorian date and time (UTC).
DeckAngle
A telescope deck-drive angle (-360..360).
DioBoard
The name of a digital I/O board.
DeckMode
The behavior of the deck-axis while tracking a source.
Double
A generic signed floating-point datatype.
Elevation
A source elevation (0..90).
Declination
A source declination (0..90).
EncoderCount
An encoder count.
Features
A set of markers that indicate features of interest in an archive frame.
Flexure
Gravitational flexure (degrees per cosine of elevation).
InputFile
The pathname of a readable file.
Integer
A generic signed integer.
Interval
A time interval.
Keyword
An unquoted case-insensitive keyword string.
Latitude
A geodetic latitude (-90..90).
LimitType
The type of motion to apply specified limits to.
Longitude
A geodetic longitude (-180..180).
Model
A pointing model (radio or optical).
OffsetMode
Is used to specify how new pointing offsets modify existing ones.
PointingOffset
A temporary ra,dec or az,el,dk pointing offset (-180..180).
QueueEntry
The index of a script within the schedule queue.
Register
A CBI register name.
RegValue
A 32-bit unsigned integer register value.
ScanFile
The pathname of a scan-definition file.
ScanScale
The amplitude-reduction factor of a scan.
Script
The pathname and arguments of a scheduling script.
Sexagesimal
A generic signed floating-point datatype expressed in sexagesimal.
Signal
A signal name.
SlewRate
A slew rate expressed as a percentage of the maximum.
Source
A source from the source catalog.
String
A literal string.
SwitchState
The on or off state of a switch.
SysType
The target subsystem of a reboot or shutdown.
Tilt
An telescope axis tilt angle.
Time
A time of day or time interval.
TimeScale
A timescale specifier (UTC or LST).
VelocLimit
A velocity limit.
Wdir
The pathname of a writable directory.

Martin Shepherd (Last change: 19-Jun-2008)