Cstol
Cstol
Cstol
Permission is granted to make and distribute verbatim copies of this manual provided that the
copyright notice and these paragraphs are preserved on all copies. The software and any
accompanying written materials are provided “as is” without warranty of any kind. The University
of Colorado disclaims all warranties of any kind, either expressed or implied, including but not
limited to implied warranties of merchantability and fitness for a particular purpose.
Mention of any commercial company or product in this document does not constitute an
endorsement by the University of Colorado.
Table of Contents
ii
iii
iv
vi
1. Introduction
The Operations and Science Instrument Support Command and Control (OASIS-CC)
teleoperations package uses the CSTOL system control language. CSTOL is not a
programming language. Instead, it resembles the command languages one encounters
when signing onto a system. These general-purpose command languages include DCL for
VAX/VMS, C-Shell and Bourne Shell for Unix and the MS/DOS command language.
While these languages perform operations like listing files in a directory and displaying the
contents of text files, CSTOL provides functions to monitor and control spacecraft, space
instruments and their ground support equipment.
About CSTOL
CSTOL is an enhanced version of the System Test and Operations Language (STOL).
STOL, an important part of several spacecraft test and operations systems, originated at
NASA's Goddard Space Flight Center. CSTOL retains the advantages of STOL —
particularly its simplicity — but is easier to use. Improvements include:
• Evaluate expressions with data item variables from the spacecraft or instrument;
1-1
Using CSTOL
Users communicate with the OASIS-CC teleoperations package through CSTOL. When
users enter OASIS-CC, a window for entering CSTOL statements appears on the screen.
Text entered here is sent to a Control Language Processor (CLP). OASIS-CC has one
CLP for each user to accept and perform the actions specified within CSTOL statements.
The CLP performs the action or calls the appropriate OASIS-CC task. For example, the
CLP may evaluate arithmetic expressions and initiate and control procedures while tasks
may issue commands, control data acquisition and call displays.
Users may create CSTOL procedures and macros — sequences of CSTOL statements
stored in a file and executed repeatedly (see Chapters 7 and 8).
CSTOL may also be used indirectly. For example, OASIS-CC is indifferent to selections
made from the TAE+ interface or the keyboard. When the user selects an OASIS-CC
TAE+ action item, the selection is translated to a CSTOL statement and passed to the CLP.
CSTOL may insert CSTOL statements into certain database tables. The records in these
tables define conditions that require quick responses. When a condition occurs, the
associated CSTOL statement is automatically executed. System managers usually enter
CSTOL statements into database tables. See the OASIS-CC System Manager's Guide.
1-2
Manual Conventions
CSTOL format specifications, particularly for the different types of statements, occur
throughout this manual. The following typographic conventions are used:
• Words and phrases within CSTOL statements appear in capital letters. This
convention is used mainly for directive names (ENABLE and STOP SAMPLING)
and words that introduce qualifying clauses (TO and WHERE). All sample CSTOL
statements appear in upper case type.
• Italicized type distinguishes terms that represent a class of item. For example,
integer-constant means to insert an integer constant here. A format specification
explains what to substitute for each italicized term.
DECLARE VARIABLE must appear as shown, while the variable name is represented by
name. A data value from an optional value range replaces default-value. The [value-range]
is optional.
1-3
1-4
2. Building Blocks
This chapter explains the formation of different word and number classes, the basic
components of CSTOL statements.
Blanks separate CSTOL statement components. Blanks may not appear within
identifiers or numbers.
Tabs may appear blanks do. Do not use tabs if possible. Their expansion is
typically computer and display-device dependent.
2-1
The dollar sign, $, denotes local and special variables. Local variable names use
one dollar sign — $TEST_VOLTAGE — while special variable names use two —
$$COMMAND_MODE.
The left angle bracket, <, expresses 'less than' within relational expressions.
The right angle bracket, >, expresses 'greater than' within relational expressions.
The plus sign, +, expresses addition within arithmetic expressions as well as string
concatenation.
The dash or minus sign, -, expresses subtraction and negation within arithmetic
expressions. It also separates the date from the time in clock time constants.
The slash, /, expresses division within arithmetic expressions and part of 'not equal
to' within relational expressions. It also separates the year from the day in clock
time constants.
The equals sign, =, expresses assignment within LET statements and "equal to"
within relational expressions.
The colon marks the end of statement labels and separates the low and high values
in range specifications and the hours, minutes and seconds in clock time and delta
time constants.
The semicolon is the comment indicator, marking the start of a comment on a line of
input.
2-2
Identifiers
Identifiers are alphanumeric names. Identifiers have the following uses:
• Literal constants
• State constants
• Variable names
• Labels
• Directive names
Identifiers consist of one to 16 characters. The first character must be a letter. any
combination of letters, digits and underscores may follow the first character. For example:
ENABLE
STEPPER_MOTOR
PLUS7_VOLTS
Constants
Constants are character strings that supply values. CSTOL contains eight constant types.
Two types — literals and states — are identifiers. The others are numeric constants —
integers, data numbers, reals, engineering units, delta times and clock times plus one that
represents general text strings. Each of these constant types is described below.
Literals
Literals are constructed from identifiers and used as qualifying arguments in statements.
They indicate the option being selected. For example, the CLEAR ALL statement, uses
this format:
2-3
States
Like literals, states are identifiers that indicate the option being selected. Unlike literals,
states describe values that state variables can assume. The OASIS-CC State_Conversions
database table defines state values allowed for a global variable. Use the DECLARE
statement to define the state values allowed for a local variable. For example:
The first example presents OFF, a state constant assigned to the local variable
$INST_STATE. LOW, in the second example, is a state variable that specifies the fan
speed.
Integers
Integer constants are whole numbers in the range, -231 to +231 -1. Integers are usually
expressed using standard decimal notation. For example:
+123
-145789232
Decimal integers may be preceded by a plus or minus sign. Blanks, commas and
magnitudes greater than 231 are not allowed. The following decimal integers are not legal:
12 34 — No blanks allowed.
Integer numbers may be alternately expressed in binary, octal, decimal and hexadecimal
radix notation. radix notation uses this general format:
radix# value
In this notation, radix equals a radix character while value equals a string of digits in the
appropriate range for the radix:
2-4
Although decimal integers are usually written using the default decimal syntax, they may be
expressed using the D radix.
The following examples present integer numbers equivalent to the decimal value 45 in radix
notation:
B#101101
O#55
X#2D
Data Numbers
Data numbers are integer constants that represent raw, uncalibrated values like those
returned by spacecraft equipment sensors. Data numbers have this format:
integer-number DN
Within this format, integer-number is expressed in the standard decimal or radix notation.
For example:
123 DN
B#11010010 DN
The OASIS-CC package permits signed or unsigned data numbers from 1 to 64 bits in
length. However CSTOL only manipulates these numbers up to 32 bits in length.
2-5
Real Numbers
Real numbers represent whole and fractional values. They have the range and precision of
double precision words on the host computer running OASIS-CC. (NOTE: The exception
to this rule is that the floating point data stored in the Latest_Data table are single precision.)
Real numbers use a scaled or unscaled format. Unscaled real number are expressed using
these formats:
[sign] . fraction
If present, the optional sign must be plus (+) or minus (-). If a sign is not given, a positive
value is assumed. Integer is a string of one or more decimal digits, while fraction is a
string of zero or more decimal numbers following the decimal sign. If the integer is
missing, one or more digits in the fraction part must be supplied . See the following
examples of unscaled real numbers:
3.14159
.645
-2453
Scaled real numbers are a computer version of scientific notation — real numbers with
exponent specified. They have this format:
unscaled-real-number E nn
integer-number E nn
Within this format, nn is a decimal integer exponent that indicates a power of ten used to
scale the number. Positive values multiply the number while negative exponent values
divide the number by the specified power of 10. The following examples represent the
value of π:
314.159E-2
.00314159E3
3.14159E0
2-6
Engineering Units
Engineering units are scaled or unscaled real numbers with units of measurement explicitly
stated. They usually represent the calibrated value of a sensor measurement. engineering
unit constants use this format:
real-number units
The unit of measurement is a one, two or three letter abbreviation for the measurement.
The EU_UNIT_CATEGORIES in Appendix A of the OASIS-CC Database Guide lists all
unit abbreviations recognized by CSTOL. See the following examples of engineering unit
constants:
As shown in the last example, the space between the number and the units is optional.
Clock Times
Clock time constants specify a date and time of day. Clock time constants use this format:
Day-of-year occurs in the range 1 - 365 (366 for a leap year). If omitted, Day-of-year
defaults to the current day number.
Hour and minute represent the hour of day and minute of hour. Hour occurs in the range 0
- 23, while minute occurs in the range 0 - 59. If unspecified, both values default to zero.
Second, specified as an integer or a real number, is required. See the following examples:
1987/360-12:30:45.5
1989/073-1:0:0
2-7
The system clock of the computer running OASIS-CC determines the time zone for clock
times. Spacecraft operations clocks are typically set to Coordinated Universal Time (UTC)
or Greenwich Mean Time (GMT).
Delta Times
Delta time constants specify a time interval. They use this format:
The components of this format have the same definitions and rules as for clock times. For
example:
Strings
Strings are constants that represent arbitrary text. Text strings are enclosed in double
quotes:
"text-string"
Text strings include blanks, tabs and any printing ASCII character except the double
quotation mark reserved for the string delimiter. The text string length is limited by the
maximum length of a CSTOL statement, 800 characters. Lowercase letters in text strings
are not converted to uppercase, unless the string is contained in a query directive, such as
UPDATE or INSERT. In performing comparisons of text strings, "abc" does not equal
"ABC".
Variables
Variables contain data values. CSTOL variables are global, local and special.
Global Variables
Global variables store the individual measurements to be processed that are stripped from
the data stream when data are received by the OASIS-CC system. The Latest_Data table
contains one global variable for each measurement. Global variables also store status data
created by the OASIS-CC package. These variables are updated automatically when new
data become available, usually when a new frame or packet of telemetry data is processed.
By examining global variables, CSTOL may determine the current state of OASIS-CC and
the systems it monitors, and to analyze a system's state. For example, a CSTOL procedure
2-8
may send a particular command only when a specific state occurs in the spacecraft.
CSTOL examines global variables containing status data from the spacecraft to determine if
the spacecraft is in the desired state. Each global variable has a two-part name, each part an
identifier:
element item
Within this format, item names the particular measurement the variable holds, while
element names the component the measurement pertains to — for example, OASIS-CC, an
instrument, or a spacecraft. See these examples:
CAMERA APERTURE
LIGHT_SENSOR READING
PLATFORM TEMPERATURE
Global variables often contain multiple values. If the value comes from a sensor as a data
number (DN) value, the global variable stores the value. OASIS-CC typically converts a
data number to an engineering unit number or a state value, making the value more
meaningful to users. The raw DN value and the engineering unit (EU) or state
representation, if any, are available for manipulation. If the global variable name is
specified, its engineering unit or state value is used. To manipulate the DN value, precede
the variable name with the RAW. For example:
prints the DN value. Global values may be automatically smoothed by OASIS-CC as the
data arrive using a running average technique. If averaging is enabled, the smoothed value
is included with DN and EU values. The smoothed value is manipulated by preceding the
variable name with SMOOTHED or AVERAGED. For example:
Either word prints the current running average value of the platform temperature.
2-9
Global variables are created with the database generation process. See the OASIS-CC
System Manager's Guide.
Local Variables
Local Variables are created using the DECLARE statement. These variables hold calculated
values within procedures. Local variables are named with an identifier preceded by a dollar
sign. For example:
$MODE
$MAXIMUM_TEMP
Within the DECLARE statement, each local variable is assigned a specific data type,
restricting its storage to values of that type. Local variables hold all types but literal.
Special Variables
OASIS-CC predefines special variables. Some special variables are read-only, allowing
CSTOL to read, but not change, their values. Other special variables act like local variables
— their value can be read and changed through CSTOL. Special variable names consist of
an identifier preceded by two dollar signs. The OASIS-CC special variables are presented
below. The visibility of the special variables differs. Some of the variables are visible to
all users and procedures on all control language processors (CLPs). Some of the variables
are visible at the CLP level (meaning each CLP has it's own copy), while other variables
are visible at the procedure level (each procedure has its own copy).
$$GBL_COMMAND_MODE
The value of this variable determines if commands entered in CSTOL are transmitted by
OASIS-CC. This variable is visible to all OASIS-CC CLPs. It has one of these state
values:
2-10
$$COMMAND_ECHO
The value of this variable determines if hexadecimal representations of command contents
are logged in the message queue. This variable is visible to all OASIS-CC CLPs. It has
one of these state values:
• OFF — Inhibits the logging of all command headers, contents and trailers in the
message queue;
• MSG — Enables the logging of command headers and trailers (without command
contents) in the message queue;
• BOTH — Enables the logging of all command data (including headers and trailers)
in the message queue.
The default value for $$COMMAND_ECHO is OFF. This variable has a corresponding
Latest_Data element, $$GLOBAL $$COMMAND_ECHO that reflects its value. This
correspondence allows the setting to be displayed.
$$CURRENT_TIME
This read-only clock time variable, expressed in clock time format, contains the current
time defined by the computer system clock.
$$LIMITS_WAIT
This system-wide variable determines whether CSTOL procedures executing on the user or
sub-CLPs are halted at the time a red limit or state alarm condition is entered.
• ON — Procedures on the user CLP and sub-CLPs are halted when a red limits
condition is entered from either a green or yellow condition, or if a state enters a
BAD desirability from a GOOD desirability (procedures executing on the equation,
trigger and command CLPs are unaffected by this flag). A GO statement is
required to resume execution on each CLP that was halted.
2-11
OASIS-CC is unable to affect a limits wait for any CLP that has an ASK window
active at the time the red limit or state alarm was issued. The result is that
procedures will resume execution when the ASK is answered.
• OFF — Procedures are unaffected when red limit or state alarm conditions are
entered.
The default value for $$LIMITS_WAIT is OFF. This variable has a corresponding
Latest_Data element, $$GLOBAL $$LIMITS_WAIT that reflects the value. This
correspondence allows the setting to be displayed.
$$LIMITS_MODE
This system-wide variable controls which database-defined limits checks will be
performed.
• BOTH — HILO and DELTA checks are performed as defined in Latest_Data and
Limits.
The default value for $$LIMITS_MODE is BOTH. This variable has a corresponding
Latest_Data element, $$GLOBAL $$LIMITS_MODE that reflects the value. This
correspondence allows the setting to be displayed.
$$STATES_MODE
This system-wide variable controls which database-defined states checks will be
performed.
2-12
The default value for $$STATES_MODE is BOTH. This variable has a corresponding
Latest_Data element, $$GLOBAL $$STATES_MODE that reflects the value. This
correspondence allows the setting to be displayed.
$$CEV_MODE
This system-wide variable acts as a switch that controls Command Execution Verification
(CEV) for commands with this function is enabled in the database (see Chapter 5 of the
OASIS-CC System Manager's Guide). It has one of these state values:
• OFF — Disengages CEV for commands with CEV enabled in the database. While
setting this variable to OFF inhibits CEV, it does not alter the database. Setting the
variable to ON will reinstate CEV for commands with CEV enabled.
The default value for $$CEV_MODE is ON. This variable has a corresponding
Latest_Data element, $$GLOBAL $$CEV_MODE that reflects its value. This
correspondence allows the setting to be displayed.
$$UED_MODE
This system-wide variable acts as a switch that controls Unexpected Event Detection (UED)
for telemetry items with this function enabled (see Chapter 4 of the OASIS-CC System
Manager's Guide). It has one of these state values:
• OFF — Disengages UED for all telemetry items without altering their database
settings.
The default value for $$UED_MODE is ON. This variable has a corresponding
Latest_Data element, $$GLOBAL $$UED_MODE that reflects its value. This
correspondence allows the setting to be displayed.
2-13
$$PRECHECK_MODE
This system-wide variable acts as a switch that controls the activation of PRECHECK
procedures for commands with PRECHECKs defined. (see Chapter 5 of the OASIS-CC
System Manager's Guide). It has one of these state values:
The default value for $$PRECHECK_MODE is ON. This variable has a corresponding
Latest_Data element, $$GLOBAL $$PRECHECK_MODE that reflects its value. This
correspondence allows the setting to be displayed.
$$POSTCHECK_MODE
This system-wide variable acts as a switch that controls the activation of POSTCHECK
procedures for commands with POSTCHECKs defined. (see Chapter 5 of the OASIS-CC
System Manager's Guide). It has one of these state values:
The default value for $$POSTCHECK_MODE is ON. This variable has a corresponding
Latest_Data element, $$GLOBAL $$POSTCHECK_MODE that reflects its value. This
correspondence allows the setting to be displayed.
$$ERROR
This variable holds the exit status of a combined conditional/timed wait. It has one of these
state values:
2-14
• TIME_OUT — Indicates the relational expression did not test TRUE within the
specified delta or clock time..
$$COMPILER_OUTPUT
This state variable determines the route of listings generated during procedure compilation.
Choices are:
$$CHECK_INTERVAL
This variable determines the rate at which conditional WAIT statements are evaluated. It is
expressed as a delta time such as:
• ::00.5— Conditional WAIT will be evaluated about two times per second.
$$COMMAND_MODE
The value of this variable determines if commands entered in CSTOL are transmitted by
OASIS-CC. The user CLP has its own copy of this variable, as does each user sub-CLP.
Modifying the value of the variable on one CLP does not affect the values for the other
CLPs. It has one of these state values:
2-15
$$CLP_LOG_INPUT
This variable is identical to $$LOG_INPUT (see Procedure Special Variables below),
however each CLP has its own copy. When a procedure is started, it inherits and operates
with the value of $$CLP_LOG_INPUT until it encounters a setting for $$LOG_INPUT, if
one exists, within the procedure. Changing the value of $$CLP_LOG_INPUT will not
affect execution of active procedures, since the variable is only used at the time a procedure
is started. Table 2.1 presents the default value for this variable.
$$CLP_STP_INTERVAL
This variable is identical to $$STEP_INTERVAL (see Procedure Special Variables below),
however each CLP has its own copy. When a procedure is started, it inherits and operates
with the value of $$CLP_STP_INTERVAL until it encounters a setting for
$$STEP_INTERVAL, if one exists, within the procedure. Changing the value of
$$CLP_STP_INTERVAL will not affect execution of active procedures, since the variable
is only used at the time a procedure is started. Table 2.1 presents the default value for this
variable.
$$CLP_STEP_MODE
This variable is identical to $$STEP_MODE (see Procedure Special Variables below),
however each CLP has its own copy. When a procedure is started, it inherits and operates
with the value of $$CLP_STEP_MODE until it encounters a setting for $$STEP_MODE, if
one exists, within the procedure. Changing the value of $$CLP_STEP_MODE will not
affect execution of active procedures, since the variable is only used at the time a procedure
is started. Table 2.1 presents the default value for this variable.
2-16
$$LOG_INPUT
This state variable determines if procedure output is logged to the message log. Legal
values are YES to log the statement or NO to not log it. The default value is YES.
$$STEP_INTERVAL
This variable specifies the delay between execution of CSTOL statements within a
procedure. The variable has delta time values:
$$STEP_MODE
This state variable determines the events following statement execution. It has one of these
values:
• GO — Procedure statements are executed as quickly as the CLP can process them;
• WAIT — Procedure statements wait until the user enters a GO directive to execute .
This process equals a single step mode.
$$LOOP_COUNT
This read-only integer variable counts the number of times the current loop is executed.
The first time through a loop the count equals one. The variable is defined within a loop
only.
2-17
2-18
CSTOL statements are sentences in CSTOL recognized and acted upon by the CLP. Most
CSTOL statements have the following format, whether a user enters CSTOL input from a
terminal, invokes a macro, starts a procedure, or inserts CSTOL statements into the
OASIS-CC database:
For example:
Labels
Labels, identifiers that mark statements within procedures, usually transfer control to the
marked statement. Labels end with a colon with no intervening blanks. For example:
A:
XYZ_1A:
POWER_UP:
Check_Status:
While these examples are legal, meaningful labels like POWER_UP are more meaningful
than nondescript labels like XYZ. These are illegal labels:
3-1
Directives
Directives are identifiers naming the CSTOL action to occur. Most directives are single
common English words, but may be compound, consisting of two words. For example,
LET and IF are one-word directives, END IF and TURN OFF, compound directives.
Qualifiers
Qualifiers are arguments, argument lists, range specifications and clauses that qualify the
directive action. Some directives — like ELSE, GO and RETURN — require no
qualifying arguments or clauses while other directives require at least one. Certain
mandatory qualifiers must be specified while others are optional, included only for values
differing from the default.
Arguments
Arguments are single constant values or variable names that hold such values. Values
qualify the directive action. For example:
DISPLAY POWER_STATUS
LOOP 3
The literal constant argument, POWER_STATUS, names the display page to show in the
first example. In the second, the integer constant argument, value 3, specifies the number
of loop executions. Given statements allow certain value types for particular arguments.
Clauses
If CSTOL statements consisted only of directives and arguments, many statements would
be difficult to remember or read. For example, this directive is difficult to comprehend:
To simplify such statements, most arguments are encased within clauses. This example
demonstrates the same statement with clauses:
3-2
Here the ON clause identifies the terminal to display the window while EVERY specifies
the update interval.
The following list presents CSTOL clauses and the type of argument they contain:
• AT — A location;
• FROM — A source;
• ON — A location;
• TO — A destination;
Argument Lists
Directives may demand or allow multiple values for a particular argument. CSTOL allows
argument lists — groups of arguments with individual values separated by commas. For
example, the COMPILE directive may accepts an argument list of procedure names to
compile, if compiling multiple procedures:
Range Specifications
Range specifications, pairs of numbers separated by a colon, specify the lowest and highest
values allowed on a declared numeric value. Appearing in the DECLARE statement, range
specifications are legal for integers, data numbers, reals and engineering unit numbers, but
illegal for delta or clock times. For example:
3-3
Input Lines
CSTOL statements are entered into OASIS-CC as text lines, each line containing 80
characters or less. While most statements fit onto a single line, some are longer than 80
characters. To compensate, CSTOL provides continuation lines. To continue to the next
line, use the ampersand (&) as the last character in the line. The ampersand is unneeded if
entering a text string spanning more than one line. The text string automatically continues
to new lines until the closing double-quote text string delimiter is encountered.
When continuing a statement to another line, a special prompt , ->, tells the user that the
CLP expects a continuation line. Statement labels begin lines and statements but cannot
appear on continuation lines. CSTOL statements are limited to 800 characters.
Comments
Comments may be appended to end a line. Comments are text appearing after the
executable part of a CSTOL statement on an input line. Any input line may be commented
and may consist of a comment only. Comments begin with a semicolon. The semicolon
separates the comment, which extends to the end of its line, from executable CSTOL code.
The CLP ignores comments, and they do not affect processing. Comments often provide
additional information about macros or procedures, making it advisable to use comments
liberally there. This example shows the use of comments when annotating a procedure:
;
; Commands to power the instrument
;
TURN ON INSTRUMENT
IF $NIGHT_TIME = YES
TURN ON HEATER ; Heater must be on when S/C is in dark
END IF
3-4
This chapter summarizes all CSTOL statements. Each statement description includes the
directive, the part of the statement specifying the action. Statements are arranged by these
function areas:
• Expressions *
• Control Structures *
• Procedures *
• Macros *
• Commands *
• Communications
• User Input/Output
• Database Management
• Program Control
Functional areas marked with asterisks are explored further in subsequent chapters.
Chapter 10 describes each CSTOL statement individually.
Expressions
The following statements define variables and evaluate expressions.
4-1
Control Structures
The following statements compose CSTOL's two major control structures: IF-blocks and
loops.
• ELSE marks the block of statements executed if the IF and all ELSE IF clauses do
not execute.
• ELSE IF marks the beginning of the set of statements executed if the ELSE IF
relational expression is TRUE, assuming no previous IF or ELSE IF clause within
the IF-block is TRUE.
• ESCAPE breaks a loop, transferring control to the first statement after END LOOP.
• LOOP marks the beginning of a loop, specifying the number of times it executes.
Procedures
The following statements define and control CSTOL procedures.
• BEGIN marks where declarations end and normal statement execution begins
within a procedure.
• DECOMPILE releases the memory space of the compiled code of one or more
procedures.
• PROC marks the procedure start and names its expected parameters.
Macros
The following statements define CSTOL macros.
Commands
The following statements are used to command external elements. Besides the following
directives, CSTOL provides a large set of predefined directives used to express commands.
See Chapter 9 for a list of command directives.
4-3
Communications
The following statements control data reception from and transmission to external elements.
• RECORD initiates and terminates logging of incoming and outgoing data to disk
files.
• RETRIEVE retrieves data recorded in a disk file and replays it through OASIS-CC
like a data line.
User Input/Output
The following statements control the display of data and messages and allow CSTOL to
send output to and receive input from users.
• CHECK writes data values and text, and optionally compares them to user-supplied
ranges.
• SHOW displays a variety of statuses for the CSTOL Control Language Processors
(CLPs) and Command Execution Verification (CEV) processor.
• WRITE writes data values and text to the OASIS-CC message log.
Database Management
The following statements allow storage, retrieval and updating of information in the
OASIS-CC database.
• INSERT creates a new database table record and specifies the values for data fields
in that record.
• LOCK reserves a database table for exclusive access by the issuing user.
• RESTORE copies a database table from disk to memory for access by OASIS-CC
software.
Program Control
The following statements control access to OASIS-CC and run application and system
programs.
4-5
4-6
5. Expressions
Constants and variables are operands — the data acted upon — within expressions.
Operators are special symbols specifying an arithmetic, relational or logical operation
applied to one or two operands. Once an operation is performed, the operator returns a
single value.
Functions extend operators. Identified by name rather than special symbol, they too act on
one or more operands and return a single value. Each operand has an associated data type
(see Chapter 2). This data type is key since most operators and functions only act on a few
data types. Also, the value type returned by operators or functions depends upon the data
types acted upon. Appendix B presents the valid data types for each operator.
Rules for expression formation are simple. CSTOL expressions resemble expressions in
programming languages like BASIC and FORTRAN. Expressions may take these forms:
$X — A local variable.
5-1
($X + 3.14159)
Operators
Operators hold expressions together, specifying the arithmetic, relational or logical
operation performed on operands and subexpressions. Except for the arithmetic negation (-
) and logical negation (not) operators, all CSTOL operators are binary, requiring two
operands. Operators return a single value of the data type determined by the operands.
Arithmetic Operators
Arithmetic operators take numeric — integer, real, data number, engineering unit, clock
time or delta time — values as operands and perform an arithmetic operation to yield a
numeric result. The CSTOL arithmetic operators are:
5-2
• + for addition;
• * for multiplication;
• / for division;
• ** for exponentiation;
The negation operator acts on a single operand to return the negative value of the operand.
For example, if local variable $X contains the value 3.14, then -$X returns the value -3.14.
The exponentiation operator raises the first operand to the power specified by the second
operand. For example, 3**2 produces the value 9. CSTOL recognizes only integral
exponents; for example, 3**2.5 is not allowed.
The modulo operator returns the remainder after integer division of the first operand by the
second. For example, 10 mod 3 returns 1, the remainder after dividing 10 by 3.
Arithmetic expressions use only arithmetic operators and numeric operands. For example:
String Operators
CSTOL provides a single operator, concatenation, for manipulating character strings. The
plus sign (+) represents concatenation, a binary operator that joins the characters of two
operand strings. For example:
"To be"+ " or " +"not to be" — Results in "To be or not to be"
Relational Operators
Relational operators compare two numeric operands or two string operands and yield a
boolean result. If the comparison holds, the logical value TRUE is returned, if not,
FALSE is returned. The CSTOL's relational operators are:
5-3
• = for equal;
$X > 5
INSTRUMENT POWER /= ON
3=1+2
"first" /="second"
Text strings equal if they match character for character, including blanks. Lowercase letters
do not equal uppercase letters; for example, "AB" is not equal to "ab".
Logical Operators
Logical operators have two distinct purposes in CSTOL. They may connect relational
expressions into a larger relational expressions or specify bit-wise operations on integer
operands to yield an integer result. The logical operators are:
The not operator is a unary operator that reverses the logical state of its operand. For
example, TRUE operands are reversed to FALSE . Other logical operators are binary,
acting as connectors of relational expressions to produce values in the following ways:
5-4
• The and operator result is TRUE if both relational expressions are TRUE;
• The or operator result is TRUE if one or both relational expressions are TRUE;
• The xor operator result is TRUE if only one relational expression is TRUE.
For bit-wise manipulation of integer numbers, the not operator reverses the sense of each
bit of its operand. For example, 1 bits become 0. The binary logical operators also act
upon each bit of their integer operands independently; the least-significant bits are
compared, then the next-least significant bits, up to the most-significant bits. These bit
comparisons results are generated as follows:
• For and operations, the resultant bit is 1 if both corresponding bits in the operands
are 1;
• For or operations, the resultant bit is 1 if either corresponding bit in the operands is
1;
• For xor operations, the resultant bit is a 1 if one (but not both) of the operand bits
are 1.
Order of Evaluation
Expressions in CSTOL are normally evaluated from left to right. However, every operator
has an assigned precedence that may override this evaluation. The user may explicitly
override the evaluation by encasing subexpressions in parentheses. The rules for
expression evaluation are summarized from the strongest to the weakest rule as follows:
• Operators with higher precedence are evaluated before those with lower precedence;
5-5
The following list presents the CSTOL operator precedence from highest to lowest:
• Exponentiation
• String concatenation
• Relational operators
For operators of equal precedence, the expression 3 - 5 - 2 results in -4 (and not 0) since
the subexpression 3 - 5 is evaluated first, yielding -2, then -2 is subtracted, yielding -4.
Parentheses may alter the order of evaluation as follows: 3 - (5 - 2) results in 0 since
parentheses force the subexpression 5-2 to be evaluated first.
The order of evaluation for exponentiation differs from other operators when multiple
exponentiation operations are performed in series. The expression 2**3**2 evaluates as
2**(3**2) (equaling 512) rather than (2**3)**2 (equaling 64).
5-6
• If the operands are compatible with the operator, the operation is performed;
• If operands are nearly compatible, one is coerced into compatibility with the other
and the operation performed;
• If the operands are incompatible, the operation is aborted and an error message
issued.
Coercion is typically encountered when one operand is an integer and the other a real value.
Here the integer value is coerced into a real value.
Appendix B presents compatible data types and defines those coercable for each CSTOL
operator.
Functions
CSTOL provides several predefined functions: trigonometric, inverse trigonometric,
hyperbolic, and miscellaneous functions.
Trigonometric Functions
Trigonometric functions take a single argument, an angle represented by an engineering
unit number in degrees or radians. Its result is a real number.
• SIN represents the sine of an angle. Result range equals -1.0 to + 1.0.
• COS represents the cosine of an angle. Result range equals -1.0 to + 1.0.
For example:
COS(PLATFORM POSITION)
5-7
• ASIN represents Arcsine. Its result ranges from -1.57080 radians to +1.57080
radians.
• ACOS represents Arcosine. Its result ranges from 0.0 radians to 3.14159 radians.
• ATAN represents Arctangent. Its result ranges from -1.57080 radians to +1.57080
radians.
For example:
Hyperbolic Functions
These functions resemble trigonometric functions, but compute the hyperbolic sine, cosine
and tangent. The argument must be an engineering unit number in radians. The result is a
real number.
Miscellaneous Functions
The following functions take integer or real number arguments and return a real number.
Logarithm and square-root routines require an argument greater than zero.
• EXP computes the natural exponential of its value (e raised to the power of the
argument).
5-8
For example:
Using Expressions
CSTOL expressions appear in six different contexts:
• On the right side of the assignment operator in the CSTOL LET statement;
Assignment
Expression results are assigned to variables through the LET statement. The LET
statement has this format: LET variable = expression.
Here variable is a local, special or global variable that stores the expression value. For
example:
LET $X = $Y
If the expression and variable data types do not match, CSTOL attempts to coerce the
expression value to the variable's data type. Appendix B presents coercion rules.
5-9
IF-blocks
CSTOL IF-blocks control the conditional execution of sections of code. IF-blocks use this
format:
IF expression
Statement(s)
ELSE IF expression
Statement(s)
ELSE
Statement(s)
END IF
IF the logical or relational expression in the IF statement evaluates TRUE, the statements
immediately following it are executed . If FALSE, all ELSE IF statement expressions are
evaluated in order of appearance. The first to evaluate TRUE is executed while other ELSE
IF or ELSE statements are ignored. If none evaluate TRUE, the statements after the ELSE
statement are executed.
Indefinite Wait
The indefinite wait statement suspends the current procedure until either a GO is issued, or
a subsequent non-indefinite wait statement completes. It uses this format:
WAIT
If a procedure is halted by a wait, and, for example, a subsequent timed wait is issued from
the keyboard, the procedure will automatically resume execution when the timed wait
completes. The same hold true if a conditional wait were issued from the keyboard and the
condition tests TRUE.
Timed Wait
The timed wait statement temporarily suspends the current procedure. It uses this format:
WAIT time-expression
Here time-expression evaluates to a clock or delta time value. A clock time suspends the
procedure until a specified time, while a delta time suspends the procedure for a specified
length of time. Sample timed waits are shown below. In the second example, the local
variable is assumed to be declared as a clock time, however the directive would also work
if it was a delta time:
5-10
Conditional/Timed Wait
Conditional/Timed waits suspend a procedure until a specified condition has occurred, or,
optionally, until a clock time or delta time has passed. The wait uses this format:
ALL, LAST and cev_group_name all qualifiers that dictate which commands must pass
CEV before allowing the procedure to resume execution.
Positional Wait
Positional waits suspend procedure execution at a specified line or label.
5-11
Procedures are suspended at the specified line or label. Once procedure execution is
resumed, the positional wait will not halt at the line or label again, unless the option always
was used.
Input to CSTOL
The ASK statement gets input for a CSTOL procedure from a user. It has this format:
The ASK statement causes a window to appear on the display screen with the ask-string
message. The user enters any CSTOL expression. The expression is evaluated and the
result placed into the local variable specified by reply-variable. If the data types of the
expression and the reply variable do not match, CSTOL attempts to coerce the expression
value to fit that of the variable and reports an error if that attempt fails.
WRITE write-list.
The first example writes out the string expression, the first argument in the output list (the
constant string value is the string itself), then the global variable value of PLATFORM
POSITION. The second example evaluates the expression, 413 mod 360, and outputs the
answer – 53.
5-12
6. Control Sequences
CSTOL provides two mechanisms, IF-blocks and loops, to conditionally execute a group
of statements. These mechanisms appear only within procedures. See the following
explanations:
• Loops allow the cyclical execution of a set of statements. This cycle may repeat
infinitely.
IF-Blocks
Groups of CSTOL statements may be executed conditionally with IF-blocks. A complete
IF-block has this format:
IF relational-expression
Statement(s) controlled by the IF
ELSE IF expression
Statement(s) controlled by the ELSE IF
ELSE
Statement(s) controlled by the ELSE
END IF
IF-blocks have four main parts: the IF clause, the ELSE IF clause, the ELSE clause, and
the END IF statement. The IF clause, an IF statement followed by a set of CSTOL
statements, appear firsts. If the relational expression of the IF statement is false,the
CSTOL statements are skipped and execution resumes with the next ELSE IF, ELSE or
END IF statement. If true,the statements are executed. When all statements are processed,
control passes to the END IF statement.
6-1
ELSE IF clauses resemble IF clauses. They provide a relational expression and contain
statements executed if that expression is true. ELSE IF clauses are optional, however; an
IF-block may have zero, one or multiple ELSE IF clauses. Multiple ELSE IF statements
are evaluated in order of appearance.
ELSE IF clauses are processed exactly like IF clauses: if the relational expression is true,
its statements are executed. When all statements are processed, control passes to the END
IF statement. If the expression is false, the statements are skipped and execution continues
with the next ELSE IF, ELSE or END IF statement.
ELSE clauses specify a group of statements executed when the relational expressions on
the IF statement and all preceding ELSE IF statements evaluate false. If so, all statements
from ELSE to END IF are executed. The optional ELSE clause appears once only.
The END IF statement signifies the end of an IF-block. An IF-block contains only one
END IF statement.
An IF-blocks may be nested, appearing within an IF, ELSE IF, or ELSE clause. CSTOL
does not limit the depth of this nesting, but the OASIS program office discourages nesting
more than two levels deep (an IF-block within an IF-block) due to user difficulty in
understanding deeply nested constructs.
Loops
A sequence of CSTOL statements may execute repeatedly with the loop control structure,
which takes this form:
LOOP [loop-count]
END LOOP
The loop count is an integer constant or local variable with an integer value that determines
the number of times the loop is executed. If unspecified, the loop continues indefinitely
until it encounters an ESCAPE statement. The loop count value is evaluated when the loop
is entered.
Any CSTOL statement within the executable portion of a procedure may appear in a loop.
Loops may also be imbedded within other loops. Loops may be nested, but like IF-blocks,
the OASIS program office discourages nesting more than two levels deep (a loop within a
loop) due to user difficulty in understanding deeply nested constructs.
6-2
Loop execution is terminated with the ESCAPE statement. When executed, ESCAPE
transfers control to the first statement following the END LOOP statement.
The special variable, $$LOOP_COUNT, occurs within a loop. This variable counts the
number of times the loop executes. The count starts at 1 and increases with each END
LOOP statement. $$LOOP_COUNT counts the executions of the innermost loop within
nested loops. $$LOOP_COUNT is undefined outside of a loop.
6-3
6-4
7. Procedures
Procedures are sequences of CSTOL statements executed by the CLP. Contained in a text
file, procedures allow the development and checking of complex test and operation
sequences prior to execution. Procedures also eliminate the inconvenience of reentering
statements from the keyboard. CSTOL procedures resemble FORTRAN and other
programming language subprograms, but differ as follows:
• Users have substantial control over procedure execution. Users may suspend and
resume execution and redirect or terminate the flow of processing.
• Procedure lines may be displayed during execution, allowing the user to monitor it.
• The user controls the rate of procedure execution. The user may run a procedure at
full speed, slow it using a time delay between statements, or move through the
procedure one statement at a time.
• Procedures may be executed despite syntax errors detected during compilation. The
procedure stops at any statement where an error is detected or if an error is detected
at run time (dividing by zero, for example).
• Values of procedure variables may be queried and changed by the user during
procedure execution. Special variables may control many facets of processing.
7-1
Declarative section
BEGIN
Statement(s)
END PROC
CSTOL allows input parameters only; values are passed to the procedure but not returned.
Argument are constants or variables. The argument of a data type must agree with that of
the formal parameter. Global variables may be passed as arguments but are usually
accessed directly. Use the LET statement to assign a new value to a global variable. The
assigned value remains after termination.
Declarative Section
The declarative section declares input parameters, local variables, and symbolic constants
within the procedure. Only DECLARE statements are allowed here, with one DECLARE
statement for every input parameter listed in the PROC statement. Declarations of formal
parameters have this format:
Here name is the formal parameter name in the PROC statement. It has the format of a
local variable, an identifier preceded by a dollar sign (for example, $INST_TEMP). The
value determines the type of argument value supplied for the parameter. Integer values, if
given, require that an integer constant or variable is supplied when the procedure is called.
A value range may be specified. The supplied value is checked for its occurrence within
this value range when the procedure is called.
7-2
A local variable declaration has this format: DECLARE VARIABLE name = value [value-
range].
Here the meanings of name, value, and value-range are the same as input parameters.
These values set the initial variable value on procedure execution, although the value may
be changed by the procedure or the user with the LET statement.
A constant value cannot be changed with LET, so value ranges are unnecessary.
Executable Section
Unless a RETURN statement is encountered, interactive procedure execution begins with
the first statement after BEGIN and continues to END PROC.
All CSTOL statements are allowed with the executable section except a second PROC, a
MACRO, or an END MACRO statement. Because procedures end with END PROC, only
one END PROC statement may occur. END PROC terminates procedure processing and
returns control to the user or calling procedure. Procedure execution may be terminated
before END PROC with a RETURN entered from the keyboard.
Preparing a Procedure
Procedures are text files prepared with a text editor. The standard file extension for
procedure files is .PRC. Each line of file text equals the corresponding line of the
procedure. The first executable CSTOL statement is PROC, but blank lines or lines with
comments may precede the PROC statement. The last executable CSTOL statement is END
PROC. Blank lines are allowed between statements.
Installing a Procedure
The user must install a new CSTOL procedure before its use. Installation informs CSTOL
of the procedure, telling its location and the method to compile and start it.
7-3
Here proc-name is the procedure name in the PROC statement while file-name names the
file containing the procedure. Other fields in the Procedures table may be optionally filled
for procedure configuration management. See the OASIS-CC Database Manual.
Compiling a Procedure
Compilation transforms CSTOL procedures into object code executed by a CLP.
Procedures are compiled with the COMPILE statement: COMPILE proc-name-list.
During compilation, the procedure is checked for syntactic error which are reported to the
user. The special variable, $$COMPILER_OUTPUT determines message routing.
Messages may be sent to WINDOW, FILE, BOTH, or NEITHER with the LET statement.
For example, LET $$COMPILER_OUTPUT = FILE, writes a file to list errors detected
during compilation. Compiler output may be sent to a WINDOW, FILE, BOTH, or
NEITHER.
If FILE is selected, a complete listing of the procedure source is written to a disk file with
messages of syntax errors. The file, named like the procedure file plus an .LIS file
extension, is placed into the directory pointed to by OASIS_PROCS. For each source line
the listing contains:
• A line number. All lines — even non-CSTOL code — is assigned a line number
starting at 1. These line numbers may be used in GO TO statements to specify
control redirection and WAIT AT statements to set breakpoints.
• The current level of IF-block nesting. The count begins at 0 and increases for each
nested level.
Errors are reported before the source line of occurrence. Error messages start at the left of
the listing for easy identification. The expansion of macros also appears in the listing;
7-4
expanded macro lines are preceded by an (M) and shown as they occur after parameter
substitution.
If BOTH is selected, output is sent to the event message log and a listing file on disk via the
WINDOW and FILE options.
If NEITHER is selected, error messages are not logged nor is a listing file created.
Messages for the beginning and completion of compilation are sent to the message queue.
The completion message contains the number of detected errors. These errors are not
counted in the total, however, but in these other compiler options:
Here procedure-name names the CSTOL procedure while argument-list lists the parameters
supplied to the procedure. Each formal parameter needs one corresponding argument of a
matching data type.
START may be entered from the keyboard to start a procedure or from a procedure to start
another procedure. These events occur once a procedure is started:
2. If the procedure is not compiled, CSTOL calls the procedure file from disk and
compiles it. If free of syntax errors, execution is initiated.
3. The call arguments are evaluated and the resulting values passed to the procedure.
4. The currently running procedures are suspended until the started procedure is
complete, then resumed at the point of suspension. Execution is suspended if
another procedure is called from within or from the keyboard.
• GO resumes execution;
User-initiated procedures are suspended automatically whenever a red limit or state alarm
condition is entered if the special variable $$LIMITS_WAIT is set to ON. See the section
Procedures and Special Variables below. Chapter 2 has more information on this and other
7-6
special variables. Refer to Chapter 4 of the OASIS-CC System Manager's Guide for more
information on limits and states checking.
The GO TO statement resembles GO, but redirects execution to another line before
resuming it.
Terminating a Procedure
The RETURN statement terminates a procedure. If started from another procedure,
execution of the calling procedure resumes where the terminated procedure ends.
The RETURN ALL statement terminates all active procedures. If procedure X starts
procedure Y and RETURN ALL is encountered, from within or the keyboard, Y is
terminated followed by X, continuing until no procedures are running.
7-7
$$LOOP_COUNT:
This integer read-only variable contains the number of times the current loop has executed.
It is defined within a loop.
$$LIMITS_WAIT
This flag determines whether OASIS-CC automatically halts procedure execution on the
user and sub-CLPs at the time a red limit or state alarm is issued. $$LIMITS_WAIT is
either ON or OFF (default). The special CLPs (command, equation and trigger) are
unaffected by $$LIMITS_WAIT. If an ASK statement is active when a red limit or state
alarm is issued, responding to the ask will resume execution of the procedure. The variable
is defined system wide.
$$CURRENT_TIME:
This clock time read-only variable contains the current system time defined by the
computer's system clock.
$$STEP_MODE
This state variable contains a value that indicates what occurs after statement execution.
The value GO means execute the next statement immediately while WAIT triggers an
unconditional wait state. PAUSE means wait a specified amount of time before executing
the next statement. $$STEP_INTERVAL contains the waiting period. It is defined within
a procedure.
$$CLP_STEP_MODE
This variable is identical to $$STEP_MODE, however each CLP has its own copy. When
a procedure is started, it inherits and operates with the value of $$CLP_STEP_MODE until
it encounters a setting for $$STEP_MODE, if one exists, within the procedure. Changing
the value of $$CLP_STEP_MODE will not affect execution of active procedures, since the
variable is only used at the time a procedure is started.
$$STEP_INTERVAL
This delta-time variable indicates the time the CSTOL interpreter waits when
$$STEP_MODE is set to PAUSE. OASIS-CC maintains $$STEP_MODE and
$$STEP_INTERVAL values for every active procedure. Once a procedure begins,
OASIS-CC assigns $$STEP_MODE the value GO and $$STEP_INTERVAL the value
7-8
00:00:01. For the desired execution rate, modify these variables with the CSTOL LET
directive from within the procedure or the keyboard while the procedure is running. When
one procedure terminates and a calling procedure resumes, $$STEP_MODE and
$$STEP_INTERVAL revert to the values of the calling procedure.
$$CLP_STP_INTERVAL
This variable is identical to $$STEP_INTERVAL, however each CLP has its own copy.
When a procedure is started, it inherits and operates with the value of
$$CLP_STP_INTERVAL until it encounters a setting for $$STEP_INTERVAL, if one
exists, within the procedure. Changing the value of $$CLP_STP_INTERVAL will not
affect execution of active procedures, since the variable is only used at the time a procedure
is started.
$$LOG_INPUT
This state variable determines if procedure lines are logged to the event message log. If
YES, all procedure lines are logged, if NO, they are not logged. It is defined within each
procedure.
$$CLP_LOG_INPUT
This variable is identical to $$LOG_INPUT, however each CLP has its own copy. When
a procedure is started, it inherits and operates with the value of $$CLP_LOG_INPUT until
it encounters a setting for $$LOG_INPUT, if one exists, within the procedure. Changing
the value of $$CLP_LOG_INPUT will not affect execution of active procedures, since the
variable is only used at the time a procedure is started.
$$COMPILER_OUTPUT
This variable contains a value to indicate the destination of compiler output. Each CLP has
its own copy of this variable.
$$CHECK_INTERVAL
This variable determines how often a conditional wait statement is re-evaluated. Each CLP
has its own copy of this variable.
7-9
$$ERROR
This STATE variable stores the exit status of a conditional/timed wait. The value
NO_ERROR means the relational expression tested true. TIME_OUT indicates that the
relational expression did not test rue before the delta or clock time expired.
For active procedures, use the SHOW ACTIVE PROCEDURES statement. The names of
the active procedures, the current line of execution, and the total number of lines in the
procedure will appear.
7-10
8. Macros
Macros are the principal mechanism for extending CSTOL. They allow users to create new
CSTOL statements by combining existing CSTOL statements into a sequence to execute
repeatedly, but they execute like single CSTOL statements. Macros resemble procedures in
that they both execute a series of CSTOL statements, but differ as follows:
• Where a procedure receives the argument value, macros substitute the actual
argument text for the associated formal parameter.
• Macros may contain statements entered from the keyboard. IF-blocks and loops are
not allowed.
• The macro source code is not visible to the user during execution. If a macro
appears in a procedure, the line containing the macro invocation appears in the
message log, while its CSTOL statements do not.
Statement(s)
END MACRO
Here macro-name, an identifier, specifies the macro name as known to CSTOL while
argument-list lists the expected formal parameters. Macro parameters have the form $n,
where n is a decimal digit 1 - 9. The first parameter must be $1, the second $2, up to $9.
Most macros have one or two arguments.
8-1
Most CSTOL statements can appear within a macro, including LET, database statements
and commands. However, macros cannot contain statements restricted to procedures, in
particular, IF-blocks and loops as well as MACRO, PROC and END PROC statements.
Each macro ends with one END MACRO statement.
Preparing a Macro
Like procedures, macros are text files prepared with a text editor. The standard file
extension for macro files is .MAC. Each text line in a macro file becomes the
corresponding macro line. The first executable CSTOL statement in a macro file is a
MACRO statement, the last, END MACRO. Blank lines or lines with comments may
appear before MACRO, after END MACRO, or between any two statements within.
Installing a Macro
The user must install a new macro file before its use. Installation makes the location of the
macro file known to CSTOL for retrieval during definition and execution.
To install a macro, first transfer the macro file to the directory pointed to by
OASIS_MACROS. Second, place an entry in the Macros database table to tell OASIS-CC
the appropriate file name. Typically this entry is made through CSTOL using a statement
like this:
Her macro-name names the macro in the MACRO statement while file-name names the file
with the macro. Other fields in the Macros table may be filled for macro configuration
management. See the OASIS-CC Database Manual.
8-2
Macro Definition
Macros must be defined before execution. During definition, the macro file is read and
portions of its syntax are checked for correctness (macros are affected by run-time text
substitution, so a complete syntax check cannot be performed until invocation). Macros are
defined using the DEFINE statement in CSTOL: DEFINE macro-name-list.
The object code for macros is kept in virtual memory. If many macros are defined, virtual
space may run short. Use the UNDEFINE statement to eliminate macro object code.
Invoking a Macro
A macro is invoked when its name appears in place of a CSTOL directive. A macro
invocation uses this format:
macro-name arguments
Macro arguments are separated by blank or tab characters. When examining CSTOL
statement syntax, a CLP first looks for a standard CSTOL directive within the statement. If
none appear, the CLP presumes that a macro will be invoked and does the following:
1. The list of defined macros is searched for the macro named in the macro invocation.
2. If found, the macro is processed immediately. If not, the file is read in, defined,
and processed.
3. The argument text supplied in the invocation is substituted for the actual macro
parameters.
4. The expanded macro is changed to object code. If the macro was entered from the
keyboard, the object code is executed immediately. If included in a procedure, the
object code is copied for later use.
8-3
Example Macro
This example presents a macro that reinitializes a database table. The database table name is
supplied as the single macro argument. The table is locked before the restore to prevent
inconsistencies that might arise if accessed during it.
MACRO REINIT $1
LOCK $1
RESTORE $1
UNLOCK $1
END MACRO
REINIT Latest_Data
When invoked, the argument (Latest_Data) is substituted for all formal parameter $1.
Substitution results in this code:
LOCK LATEST_DATA
RESTORE LATEST_DATA
UNLOCK LATEST_DATA
Expanded statements are then parsed and converted to object code. If entered from the
keyboard, the object code is executed immediately. If within a procedure, the object code
is added to the procedure and saved for later execution.
8-4
9. Commands
3. The command processing software places the translated command into a command
message;
OASIS-CC usually performs all steps rapidly, making them seem like a single action to the
user. However, users may open a message and buffer multiple commands within it. Once
buffered, the message is transmitted only with a SEND MESSAGE statement.
This chapter describes the syntax of CSTOL command statements and the procedure used
to control the generation and transmission of command messages. For further information
on commands and command messages, see the OASIS-CC System Manager's Guide.
Basic Commands
Every CSTOL command statement has two mandatory components, a command directive
and an element name. The command directive specifies the action while an element name
specifies the external element to perform the action. For example:
9-1
TURN ON INSTRUMENT
CLOSE VALVE_1
The first example presents the command directive TURN ON and the element name
INSTRUMENT. The second presents the command directive CLOSE and the element
name VALVE_1.
A third component — a specific attribute of the external element affected — may be added
as needed. For example:
Here TEMPERATURE names the oven attribute affected by the command. CSTOL
provides a set of predefined command directives:
Appendix C describes how command verbs can be added or subtracted from the above list.
CSTOL is indifferent to command directive meanings; instead, the receiving element
determines the meaning based upon its context. For example, the OPEN command allows
flow through a valve but stops the flow of current through an electrical switch. CSTOL
cannot detect this ambiguity; the switch and valve determine the meaning of the OPEN
command.
Clauses
CSTOL provides four clauses for use in commands. These clauses are introduced with
TO, WITH, BY or FROM. A command statement may contain one clause only.
The TO clause sets the command the external element or attribute to a specified value. For
example:
9-2
The WITH clause resembles TO, but assigns values to one or more attributes. Each
attribute is paired with the assigned value. If multiple pairs occur in the clause, subsequent
pairs are separated by a comma or the keyword AND. For example:
The first example specifies a value for a single attribute while the second assigns values to
three attributes (AUTO_FOCUS, AZIMUTH_DRIVE and ELEVATION_DRIVE), a
comma and the keyword AND separating these pairs. Commas and AND are
interchangeable and the pairs may appear in any order. These WITH clauses equal the
above:
The BY clause can be used to indicate a change by a specified amount. For example:
While the TO and WITH specify absolute values, BY can specify relative change.
The FROM clause can be used to indicate the source of something the command operates
upon. For example:
Qualifying Keywords
Command statements may contain certain keywords that act as adverbs modifying the verbs
used as command directives. Keywords specify the speed or direction of occurrence and
are categorized by these specifications. A command may include only one keyword from
each category. Qualifying keywords appear after clauses, if present.
9-3
• FAST
• MEDIUM
• SLOW
• BACKWARD
• FORWARD
• UP
• DOWN
• LEFT
• RIGHT
• IN
• OUT
• CW (clockwise)
• CCW (counterclockwise)
Like other commands, CSTOL does not attach particular meanings to keywords. For
example, CSTOL is indifferent to speed when FAST is specified. Instead, the receiving
element determines the speed.
9-4
This command uses the radix designator H for hexadecimal command strings to
differentiate bit-pattern commands from normal integer constants that use the radix
designator X for hexadecimal numbers. Similarly:
This command results in the transmission of the text enclosed within the double quotes. If
a quotation mark is to be part of the transmitted test, represent it as a single quote - OASIS-
CC will automatically replace it with the ASCII code for a double quote. Chapter 5 of the
OASIS-CC System Manager's Guide discusses these as raw commands.
Timed Commands
Because many spacecraft systems utilize command storage to buffer commands for later
execution, CSTOL provides a method for specifying timed commands. To specify timed
command execution, place the word HOLD before the command. The time to release the
command for execution and the memory location within the command store are specified in
clauses that follow the command. For example:
This statement places the command that corresponds to this CSTOL statement
into memory location 11C8 (hex). The command will be executed at 12:30:05 today.
Priority Commands
The keyword NOW indicates the execution of the command at priority level. A priority
commands will not become part of a command message; instead, message processing is
suspended while the priority command is processed and transmitted. For example:
9-5
Command Messages
CSTOL allows users to construct command messages with multiple commands and to
control message transmission. Command messages are initiated with the MESSAGE
statement to specify the message type. Commands entered after MESSAGE — except
priority commands — are processed and placed into the message. The commands are
buffered until transmission or deletion, then sent with the SEND MESSAGE statement.
This example shows the construction and transmission of a command message:
MESSAGE TYPE_A
;
TURN ON INSTRUMENT
CLOSE PURGE_VALVE
SET DETECTOR VOLTAGE TO 12. V
;
SEND MESSAGE
If transmission fails, the message may be sent again with the RETRY statement. The
CLEAR statement deletes messages.
Microprocessor Loads
Most modern space instruments are controlled by built-in microprocessors. The
programming of most microprocessors is altered by transmitting a block of code or data to
the instrument. The LOAD statement initiates this transfer. LOAD specifies the external
element receiving the load, the starting memory location where the load is placed, and the
filename to take the load from. For example:
See the OASIS-CC System Manager's Guide for the proper microprocessor load file
format.
9-6
This chapter describes all CSTOL statements, each type discussed in an alphabetically
arranged section. Particularly complicated types are decomposed into smaller sections to
cover all variations. Each section contains the following information:
The component description identifies user expectations and, for arguments, the appropriate
data types. The argument description indicates if an argument is a constant or variable
only. If not indicated, use the constant or variable of the appropriate data type.
10-1
ASK
ASK asks a question displayed in a dialogue window and receives an answer from the
user. The user enters the answer into the dialogue window and its value is placed into the
specified local variable. The dialogue window disappears and the reply value is used,
typically in an IF statement, to direct the flow of processing.
Format
ASK reply-variable question
Arguments
reply-variable (local variable): The name of the local variable storing the result. Its data
type must be compatible with that of the user-entered value.
question (string constant): A text string containing the text within in the ASK window.
Notes
1. Most questions in an ASK statement are simple and require simple replies. For
example, many questions require YES or NO answers. More complex replies may
include CSTOL expressions. When the user hits [return] to terminate the reply, the
expression is evaluated and its value deposited into the local variable.
2. Local variables must be previously defined with a DECLARE statement. The value
obtained from the evaluation of the user-entered expression must match the value
expected for the local variable. For example, state variables require ON and OFF
values. If not entered, an error message is issued, the dialogue window disappears
from the screen, and the local variable remains unchanged.
4. The ASK statement does not supply default values for local variables. Pressing
[return] results in an error message. Local variables will remain unchanged.
5. Upper and lowercase letters are indistinct. Input is converted to uppercase unless
enclosed by double quotation marks.
10-2
BEGIN
BEGIN divides procedures into two sections:
• All statements between the procedure start and BEGIN, a section usually used for
DECLARE statements, are executed at the outset. This. DECLARE insures the
proper declaration of all variables when the procedure executes. BEGIN may also
set special variables to control procedure execution, like $$LOG_INPUT and
$$STEP_INTERVAL. The user cannot place the procedure into a WAIT state or
redirect procedure execution with a GO TO statement until BEGIN is reached.
• After BEGIN, the procedure may be suspended or redirected at any statement using
WAITs, GO TOs, or keyboard entries. Most statements appear after BEGIN, to
allow the user maximum control over the procedure.
Format
BEGIN
Notes
1. statements occurring before and after BEGIN are currently indistinct to OASIS-CC.
In reality, BEGIN has no real effect on procedure execution. However, a future
version will enforce these rules, so users should follow them.
10-3
CANCEL
CANCEL deletes the current command message, stopping transmission in the process.
Once sent, command messages cannot be canceled.
Format
CANCEL
10-4
CHECKPOINT
CHECKPOINT creates database-format disk images for database tables records.
Format
CHECKPOINT ALL TO name
Arguments
name (): translates to an upper case environment variable ($NAME) that identifies the
directory to which a complete database checkpoint is written.
selection-expression (): A relational expression with sub expressions of the form field-
name=value where field-name is a field and value is a constant value the field is
compared against. Multiple sub expressions are connected by the logical connective
AND. Records where every field has the specified value are candidates for
checkpointing.
Notes
1. The first form, (CHECKPOINT ALL TO name) creates a complete image of the
OASIS-CC database from which a future OASIS-CC session may be started.
Database files are stored in the directory defined by the environment variable
$NAME (must be upper case). The files are named by the table with a ".dat"
appended (e.g. analog_conversions.dat).
All primary streams must be switched off and retrieved off, all telemetry displays
must be cleared, and all bridge files must have recording stopped prior to attempting
this form. If these conditions are not met, OASIS-CC will issue an error message
and abort the request.
stream_is_on = true, the user could never activate the stream - OASIS-CC will reply
"The stream is already on" when the switch is attempted. Checkpoint files are placed in
the directory pointed to by the environment variable $OASIS_CHECKPOINT, and are
named fyy_mon_doy_hh_mm_ss.table_name (e.g. limits.f94_dec_25_12_34_45).
10-6
CLEAR
CLEAR stops display processing for an output window, then removes the window from
the screen. CLEAR ALL removes all windows of a specified type.
Format
CLEAR page_name [FROM terminal_nickname]
Arguments
page_name (identifier): The window name to remove.
page_type (identifier): The window type to remove. Use one of these keywords:
Notes
1. See Chapter 9 of the OASIS-CC System Manager's Guide for more information on
remote displays.
10-7
CHECK
CHECK compares a data value against a value or range of values supplied by the user, and
sends the results to the message queue.
Format
CHECK parameter-list
Arguments
parameter-list: One or more of the following elements, separated by a comma (,)
Notes
1. Character strings are output without change.
2. When a global or a local variable is specified, its named is output, followed by its
value.
3. All local variable types are supported, except delta times and clock times. All global
variable types are supported - including raw values.
4. When a single value is supplied in the optional check-list, the value of the local or
global variable is checked for equality. If not equal, the portion of the message
associated with the check is red, and flagged as ne (not equals).
5. When two values appear in the optional check-list (value_1 and value_2), OASIS-
CC checks if the value of the local or global variable is within the range of value_1
and value_2 (inclusive). If not within the range, the portion of the message
associated with the check is red, and flagged with either lt or gt (less than or greater
than).
6. Check-lists must always include a colon (:), even if a single value is used.
10-8
10-9
Commands
Commands specify actions performed by external systems controlled by OASIS-CC.
When executed, OASIS-CC software translates the command into a string of ASCII
characters or bits understood by the external system. OASIS-CC also attaches command
message and ground network protocols necessary to route the command to the external
element. See Chapter 9 for a more complete discussion of CSTOL command statements.
See the OASIS-CC System Manager's Guide for further information on the conversion of
CSTOL command statements into external element commands.
Format
command-directive element-name [attribute-name ]
Arguments
command-directive (identifier): A word or two-word phrase that specifies the action of
the command.
Notes
1. CSTOL contains a standard set of command directives (See Chapter 9). New
command directives are added through modification of the CSTOL parser tables as
described in Appendix C.
2. The OASIS-CC internal database design limits the length of attribute names beyond
the normal rules for identifiers. See the OASIS-CC System Manager's Guide.
10-10
The TO clause causes the command to act by setting the external element or attribute to a
specified value. The WITH clause resembles TO except that one or more attribute values
may be specified. The BY clause causes the command to act by changing the external
element or attribute by a specified amount. The FROM clause indicates a source the
command must act upon.
A command may also contain keywords to qualify the speed or direction of change.
Format
basic-command TO value [speed-qualifier] [direction-qualifier]
Arguments
attribute (identifier): An attribute of the external element to set to the associated value.
value (integer, state, delta time, engineering unit): The value to set the external element
or attribute to.
amount (integer, state, delta time, engineering unit): The amount to change an external
element or attribute.
source (integer, state, delta time, engineering unit): The place name something is
retrieved from.
speed-qualifier (identifier): A keyword specifying the speed of action. The choices are
FAST, MEDIUM, and SLOW.
Notes
1. A command may contain one clause, one speed qualifier and one direction qualifier
only. Qualifying keywords occur after clauses. Speed or direction qualifiers may
appear in either order.
2. Multiple attribute/value pairs may appear in a WITH clause. Separate each pair with
a comma or the AND keyword.
Timed Commands
The HOLD keyword indicates that a timed command is placed into intermediate command
storage at the receiving element rather than executed immediately. Timed commands
contain not only the command pattern, but also the memory location and the desired time of
execution.
Format
HOLD command [AT location] [UNTIL time]
Arguments
location (integer constant): The memory location of the command in storage.
Notes
1. See the OASIS-CC System Manager's Guide to set up timed commands.
Priority Commands
The NOW keyword indicates the execution of the command at priority level. For example:
NOW TURN OFF VACUUM_PUMP.
Format
NOW command
10-12
Notes
1. See the OASIS-CC System Manager's Guide to set up priority commands.
10-13
COMMIT
COMMIT saves the current contents of the named database table to disk, establishing the
state the table is set to when OASIS-CC is started or a RESTORE statement is executed.
Format
COMMIT table-name
Arguments
table-name (identifier): The name of the table to commit to disk.
Notes
1. The table must be locked and restored before COMMIT is used. Only the user
issuing the lock may commit the table.
10-14
COMPILE
COMPILE precompiles CSTOL procedures. Compilation consists of parsing and saving a
procedure (object code) for later execution. Compilation has two advantages:
• Syntax errors are detected during compilation before one uses the procedure.
• Procedures that are parsed and ready to run begin execution more quickly.
Format
COMPILE procedure-list
Arguments
procedure-list (identifier): The list of procedures to precompile. If multiple procedures
are specified, separate them with commas.
Notes
1. All procedures to compile must appear in the Procedures database table. This entry
tells the CLP the filename containing the procedure source code. The file is located
in the directory indicated by OASIS_PROCS.
4. A procedure list with compilation errors is available in CSTOL. See the Procedures
section for further information.
10-15
CSTOL OFF
CSTOL OFF terminates an OASIS-CC session. OASIS-CC terminates all active
procedures and streams and clears all display windows from the screen.
Format
CSTOL OFF
Notes
1. Logging out of OASIS-CC terminates the reception and recording of active streams.
10-16
DECLARE
DECLARE defines the parameters passed to and the constants and variables used locally
within a procedure.
Format
DECLARE mode variable-name = default-value [range value-list]
Arguments
mode (identifier): A keyword specifying the data type of the declared item. The values
are:
The VARIABLE declares a local variable. The local variable receives the data type
and value of the default value. The value can change if the variable appears on the
left side of a LET statement, but the data type cannot be changed, remaining the
same as when initially declared.
The CONSTANT declaration creates a local constant. The constant receives the
unchangeable default value from the statement. Constants cannot appear on the left
side of a LET statement, while the range or value specification is ignored.
variable-name (local variable): The name of the declared variable. This name uses the
correct format for a local variable name — an identifier preceded by a $.
default-value (any constant): A default value of any constant type must be supplied. Its
data type determines the local variable type. The variable only accepts values of the
specified type. If an engineering unit value, the local variable has the same type of
units specified for the default value.
range (numeric constant): An optional range of legal values for numeric constants
specified in the form lowest-allowed-value : highest-allowed-value. The data types
of values supplied in a range clause must equal those of the default value.
10-17
value-list (literal): A list of valid values for a state variable. The list must include every
possible state the variable can accept.
Notes
1. A variable or constant may be declared once within a procedure. Attempts to
redefine a variable or constant result in compilation errors. The ability to reset the
value of variables using the LET statement is not limited.
3. No range specification or value list is allowed for clock and delta times, hex bit
strings and character strings.
4. Although allowed by the language, a range specification or value list are useless for
constants; they use the value assigned in the declaration.
10-18
DECOMPILE
DECOMPILE removes compiled procedures from the CLP list. This statement has two
advantages:
Format
DECOMPILE procedure-list
Arguments
procedure-list (identifiers): The names of procedures to decompile. If multiple
procedures are specified, separate them with commas.
Notes
1. DECOMPILE ALL PROCEDURES decompiles only inactive procedures.
10-19
DEFINE
DEFINE preprocesses a CSTOL macro. Like the compilation of procedures, macros
specified in the statement are read into the CLP and placed on a list. Unlike compilation,
macros are not converted to object code when defined, but when invoked from the
keyboard or within a procedure.
Format
DEFINE macro-name-list
Arguments
macro-name-list (identifier): A list of macro names to define.
Notes
1. All macros to be defined must have an entry in the Macros database table. This
entry tells the CLP the filename containing the macro source code. The file must be
located in the directory pointed to by OASIS_MACROS.
10-20
DELETE
DELETE removes all records meeting the selection criteria from the named database table.
Format
DELETE table-name WHERE selection-criteria
Arguments
table-name (identifier): The database table containing records to be deleted.
Notes
1. The only relational operator currently allowed in the selection criteria expression is
the equality (=) test. Only the AND connective may be used.
2. Any value other than an integer number, real number, or identifier (an alpha
character followed by a sequence of alphanumeric characters) must be enclosed in
quotes.
10-21
DISPLAY
DISPLAY causes the named page or panel to appear on a monitor. If unspecified, the
destination monitor defaults to the terminal where the statement is entered.
Format
DISPLAY page-name [AT column row]
Arguments
page-name (identifier): The page name to display. OASIS-CC looks to see if the page
name corresponds to a page_name field in Display_Descriptions. If so, OASIS-CC
uses the associated tae_panel_name for the name of the TAE+ panel to display. If a
Display_Descriptions record doesn't exist, or the tae_panel_name field is blank,
OASIS-CC assumes the TAE panel name is the supplied page name. The page
name can also be one of the windows not created by TAE+, such as the page for
displaying CSTOL procedures.
and the Links database table record with the link_name monitor_3 would have an
associated data_line field would contain "128.138.138.19:0.0". See Chapter 9 of
the OASIS-CC System Manager's Guide for more information on remote displays.
column (integer constant): The screen character column holding the lower left corner of
the window. If unspecified, the default page position in the Display_Descriptions
database table is used. The AT clause is only applicable to the pages generated by
OASIS-CC – not TAE+ panels (see Chapters 8 and 9 of the OASIS-CC System
Manager's Guide).
10-22
row (integer constant): The screen character row holding the lower left corner of the
window. If unspecified, the default page position in the page definition database
table is used. The AT clause is only applicable to the pages generated by OASIS-
CC – not TAE+ panels (see Chapters 8 and 9 of the OASIS-CC System Manager's
Guide).
Notes
1. The TO qualifier is used to display the page on a remote X-based workstation or
terminal. Prior to issuing remote displays, the X-server must be active on the
remote workstation the remote workstation must be authorized to accept X requests
from workstation running OASIS-CC. See Chapter 9 of the OASIS-CC System
Manager's Guide for more information on remote displays.
10-23
ELSE
The optional ELSE introduces the default part of an IF-block. If the relational expression
in the IF statement and all ELSE IF expressions evaluate FALSE, the statements following
ELSE are executed. If the IF or ELSE IF evaluates TRUE, the ELSE is skipped. Only one
ELSE may occur in an IF-block.
Format
ELSE
10-24
ELSE IF
ELSE IF marks the beginning of a set of statements within an IF-block that are executed if
both of these conditions are met:
• The expression in the IF statement and preceding ELSE IFs evaluate FALSE;
When the expression in an ELSE IF evaluates TRUE, the statements following it are
executed in sequence until an END IF, ELSE IF or ELSE occurs. Further ELSE IF or
ELSE parts of the block are skipped regardless of how they evaluate. Execution continues
from the END IF.
Format
ELSE IF controlling-expression
Arguments
controlling-expression (relational expression): The relational expression evaluated.
This expression governs the execution of statements in the ELSE IF.
Notes
1. The controlling expression must evaluate TRUE or FALSE. Other values result in
an error.
10-25
END
END marks the end of a block of statements. END is always paired with a statement
beginning of the block. END uses these block types:
Because blocks occur only within procedures or macros, END statements are entered from
the keyboard.
END IF
END IF terminates an IF-block. Every IF-block must have an associated END IF.
Format
END IF
END LOOP
END LOOP marks the end of a block of statements that execute repeatedly. When END
LOOP occurs, execution cycles return to the first statement following the LOOP statement.
One END LOOP occurs for each LOOP statement.
Format
END LOOP
END MACRO
END MACRO the end of a CSTOL macro. END MACRO causes the CLP to stop reading
input from a macro source file. Statements after END MACRO cause errors.
Format
END MACRO
10-26
END PROC
END PROC marks the end of a procedure.
END PROC statement stops the CLP from reading procedure input and terminates
compilation for the procedure file. Any statements after END PROC are ignored. A
procedure will compile without END PROC, but OASIS-CC returns a system error once
the procedure begins.
Format
END PROC
10-27
ESCAPE
ESCAPE breaks a counted or indefinite loop. Procedure execution resumes with the
statement following END LOOP.
Format
ESCAPE
Notes
1. ESCAPE is valid only within a LOOP.
10-28
FLUSH
FLUSH resets the Command Execution Verification (CEV) function. See Chapter 5 of the
OASIS-CC System Manager's Guide for details on CEV.
Format
FLUSH command-group-name
FLUSH ALL
Arguments
command-group-name (identifier): name of the command group to be reinitialized.
Notes
1. All commands belonging to the command-group-name are removed from the
pending CEV queue, and the counters of the failed commands in the command-
group-name are reset to zero.
10-29
GO
GO resumes procedure execution at the next statement in sequence.
Format
GO
Notes
1. GO cannot appear within a procedure; the procedure would be running before the
statement is executed.
10-30
GO TO
GO TO repositions the procedure to a specified label or line number and resumes execution
from there.
Format
GO TO label
GO TO line
Arguments
label (identifier): The label name where execution is redirected.
line (positive integer constant): The line number where execution is redirected.
Notes
1. Line numbers appear only in GO TOs issued from a terminal. References to line
numbers are not allowed within procedures or macros to prevent the addition or
deletion of lines from a procedure, accidentally causing execution to go to an
unintended line.
2. Errors occur if no procedures are active, the specified label does not currently exist,
or the reference to a line number beyond the last procedure line. Repositioning
does not occur with an error. The procedure instead waits for corrective action
from the user at the GO TO.
10-31
IF
The basic mechanism for decision-making is the IF-block. All IF-blocks start with an IF
statement. The specified relational expression is evaluated and, if TRUE, CSTOL
statements following the IF are executed to an END IF, ELSE IF or ELSE. IF cannot be
entered from the keyboard, but may appear within procedures and macros.
Format
IF controlling-expression
Arguments
controlling-expression (relational expression): An expression with a TRUE or FALSE
result value.
Notes
1. IF must be paired with an END IF to mark the end of statements it controls.
10-32
INITIALIZE
This statement initializes an IEEE-488 bus controller.
Format
INITIALIZE data-stream
Arguments
data-stream (identifier): The stream name for the appropriate IEEE-488 controller.
Notes
1. This statement puts the IEEE-488 controller into the Controller in Charge state.
10-33
INSERT
INSERT creates a new record in a database table, filling the record fields with values from
the value list. The value list must use named notation.
Format
INSERT table-name value-list
Arguments
table-name (identifier): The database table to store the new record.
value-list (): An item list where each item uses the format, field-name = value, field-
name is the a field in the database table, and value is a constant that provides the
value to place into the field. If multiple items are specified, separate the names with
commas. The value may be:
• A text string.
Notes
1. All key fields must be included; unspecified non-key fields receive the default
values.
2. Any value other than an integer number, real number, or identifier (an alpha
character followed by a sequence of alphanumeric characters) must be enclosed in
quotes.
10-34
LET
LET evaluates an expression and stores the result into the specified variable. Results
include a global variable, a local variable or a special variable (some special variables are
unable to store). The result and variable data types must agree. The result value must
occur within the range of the result variable.
Format
LET variable = expression
Arguments
variable (global, local or special variable): The variable storing the result. If a global
variable results, the value is placed in the Latest_Data table.
Notes
1. The expression and variable data types must agree. Compatibility exists between
the expression result and the destination variable if any of these factors are true:
• They have the same data type. State values require that the expression result
state is a legal value associated with the variable.
• The expression result is an integer value and the variable is real; the value is
converted to real.
• The expression result is a real value and the variable is an integer; the result is
converted an integer through truncation.
• The expression result occurs in engineering units that may be converted into
the variable units. For example, if the expression result occurs in microvolts
and the variable in volts, the result is converted to volts.
• The expression evaluates to a real number and the result variable occurs in
engineering units, or vice versa.
• The expression evaluates to an integer number and the result variable occurs
in Data Numbers, or vice versa.
10-35
2. Certain special variables cannot appear as the LET destination variable. They are:
$$CURRENT_TIME contains the current time of the system clock and cannot be
reset by CSTOL.
10-36
LOAD
This statement sends the contents of a file to an external element.
Format
LOAD external-element-name AT location FROM file-name
Arguments
external-element-name (identifier): The external element where the load is directed.
Notes
1. This application dependent statement mainly sends microprocessor loads.
5. The file has a specific format described in the System Manager's Guide.
10-37
LOCK
LOCK reserves the named database table exclusively for the user issuing the statement.
Required when a table is permanently modified, LOCK prevents other users from
modifying the table while the permanent updates are made.
Format
LOCK table-name
Arguments
table-name (identifier): The database table to lock.
Notes
1. If a user attempts to access or lock a already-locked table, an error message is sent
to that user denying the request. If a user issues a lock request for a table that user
has locked, no change occurs.
2. A significant risk occurs when locking a database table during real-time operations.
Consequently, when a lock granted, OASIS-CC issues a warning to the user noting
when a particular table was last used.
10-38
LOOP
LOOP marks the beginning of a loop block, a block of statements that execute repeatedly.
Format
LOOP [repeat-count]
Arguments
repeat-count (integer): The number of times the loop is repeated. If unspecified, the
loop repeats endlessly unless a GO TO or ESCAPE stops it. The repeat-count must
be an integer constant or a local variable with an integer value.
10-39
MACRO
MACRO marks the beginning of a CSTOL macro.
Format
MACRO macro-name [macro-parameters]
Arguments
macro-name (identifier): The name of the macro.
Notes
1. The entry in the Macros database table must name a file residing in the logical
directory OASIS_MACROS.
2. When a macro is used from the keyboard or in a procedure, the current macro
definition is used. To reflect a new macro definition in a procedure, the macro must
be defined with DEFINE and the procedure recompiled to use of this latest
definition.
10-40
MAKE
MAKE sets bus devices or instruments to a defined state.
Format
MAKE DEVICE/INSTRUMENT device-name-list BE/DO state
Arguments
device-name-list (identifier): The affected IEEE-488 devices.
Notes
1. The devices specified in MAKE may not reside on the same IEEE bus.
10-41
MESSAGE
MESSAGE marks the beginning of a command message. Commands entered after this
statement — except priority commands — are placed into the message until full, transmitted
with a SEND MESSAGE statement, or deleted with a CANCEL statement.
Format
MESSAGE external-element-name
[HOLD AT location] [UNTIL release-time]
Arguments
external-element-name (identifier): The external element receiving the message.
location (integer constant): The location of the message within a command store.
Notes
1. A MESSAGE statement may have one AT and one UNTIL clause only. If both are
present, they may occur in either order (AT or UNTIL first).
2. OASIS-CC does not provide command store. It must reside in some external
element (usually a spacecraft or ground support system).
10-42
POLL
This statement instructs OASIS-CC to get the status byte of IEEE-488 devices.
Format
POLL DEVICE device-name-list
Arguments
device-name-list (identifier): The names of the devices to be polled, separated by
commas.
stream-name-list (identifier): The name of the stream on which all devices are to be
polled, separated by commas.
Notes
1. The POLL DEVICE statement causes OASIS-CC to get the status byte of the listed
devices.
2. The POLL BUS statement causes OASIS-CC to wait for the SRQ line to be
asserted on one of the listed streams. When SRQ is asserted, OASIS-CC gets the
status byte from the device(s) that requested service. This functionality is enabled
until a STOP POLLING BUS statement is issued.
10-43
PROC
PROC marks the beginning of a CSTOL procedure by specifying the procedure name and
providing the parameter names it accepts.
Format
PROC proc-name [formal-parameter-list]
Arguments
proc-name (identifier): The procedure name. This name matches the name in the
Procedures database table.
formal-parameter-list (local variable): Local variable names of the parameters within the
procedure.
Notes
1. If not compiled with a COMPILE or START statement, the procedure is compiled
and executed when START is issued. If previously compiled, execution begins
immediately.
2. The formal parameter names must be unique. A name may appear once only in the
formal parameter list. Each formal parameter should appear in a DECLARE
statement that supplies additional information about it.
10-44
RECORD
RECORD enables the logging event messages, incoming data streams, and bridge streams.
Chapter 10 of the OASIS-CC System Manager's Guide has more information on the
formats of certain files recorded by OASIS-CC.
Format
RECORD record-mode [title]
Arguments
record-mode (identifier): The data type logging is enabled for. If the record-mode is
MESSAGES, logging of event messages is affected. Other record-modes include
incoming data streams or bridge streams.
title (string): Text placed in a header file to identify the recorded stream.
Notes
1. Incoming data streams are recorded in files in OASIS_RECORD. Filenames
generated for data streams have the form F yy_mm_dd_hh_mm_ss, specifying the
year, month, day, hour, minute, and seconds the data stream is opened. Two files
with the same name but different extensions are produced for a data stream:
2. Bridge stream files are placed into OASIS_BRIDGE. The filenames for bridge
streams use the same format as incoming data streams. A bridge stream has three
files with the same name but different extensions:
10-45
10-46
REPORT
REPORT produces a listing of fields for all records of the table where the selection clause
holds. The listing goes to the appropriate terminal (output goes to a special report window)
or a disk file. The default device is the terminal where the request was issued.
Format
REPORT table-name [field-list]
[WHERE selection-expression] [TO device]
Arguments
table-name (identifier): The database table receiving the records.
device (identifier): The device where output is directed. This device is WINDOW,
FILE, or BOTH.
Notes
1. If no device is specified at the request, the report is written to the report window, if
present. Otherwise, the report is written to a disk file described below.
2. Report files are placed in the logical directory OASIS_REPORTS. The filename is
the described database table while the file extension is .REPORT.
3. Any value other than an integer number, real number, or identifier (an alpha
character followed by a sequence of alphanumeric characters) must be enclosed in
quotes.
10-47
RESTORE
This directive restores the contents of the named database table to the last committed state.
Format
RESTORE table-name
Arguments
table-name (identifier): The database table to restore.
Notes
1. The table must be locked before RESTORE is issued. Only the user who locks the
table may restore it.
2. Under certain conditions, OASIS-CC will not restore certain tables. If telemetry
displays are present or if data are bridged, the Latest_Data table cannot be restored.
Likewise, Streams cannot be restored if streams are active. These restrictions
prevent potentially dangerous resetting of certain fields within these tables.
10-48
RETRIEVE
RETRIEVE gets stored data blocks from disk and reads them into OASIS-CC as if data
were entering from a data line.
Format
RETRIEVE data-stream FROM file-name
[BEGINNING start-time] [UNTIL stop-time] [EVERY retrieval-rate]
Arguments
data-stream (identifier): The data stream attached to incoming information.
start-time (clock constant): Records in the file are time indexed. This argument
specifies the first record to retrieve.
stop-time (clock constant): This argument specifies the last record to retrieve (see start-
time).
retrieval-rate (delta time constant): The rate of retrieval specified in frames per second.
Notes
1. The file for the retrieved data must appear in the logical directory OASIS_RECORD
with a filename of this format: filename.data-stream.
2. At the end of stream retrieval, STOP RETRIEVING must be issued to access the
stream again.
4. If the stream's record in the Streams table has a secondary offset that is not 0,
OASIS-CC will build the decomposition tree for this stream when it is retrieved.
This may take several minutes for complex data streams. If the secondary offset for
the primary stream is 0, OASIS-CC will look for a pre-saved copy of the stream's
decomposition tree instead – a much faster operation. See Chapter 6 of the OASIS-
10-49
10-50
RETRY
RETRY sends a command message or a single command again, working only if the
message is previously transmitted.
Format
RETRY
10-51
RETURN
RETURN terminates the current procedure and returns to the previous one. RETURN
ALL terminates all active procedures associated with the CLP.
Format
RETURN
RETURN ALL
Notes
1. RETURN ALL is usually entered from the keyboard, but may appear in a
procedure.
10-52
ROUTE
ROUTE sends part of a return stream to a forward stream or to a Sub-CLP.
Format
ROUTE secondary-stream TO forward-stream
Arguments
secondary-stream (identifier): The secondary data stream from the Streams table.
Notes
1. A secondary stream may be routed to many forward streams.
2. ROUTE returns an error if the return primary stream parent of the routed secondary
is not ON (not switched on or not retrieved) or the forward stream is not ON
(unlike RECORD/STOP RECORDING or SWITCH ON/OFF of a non-primary
stream, the route status of a secondary stream is not memorized in the Streams
table). ROUTE also will return an error when data is sent to a non-active Sub-
CLP.
SWITCH ON return_a
SWITCH ON forward_a
ROUTE part_of_return_a TO forward_a
SWITCH OFF forward_a
SWITCH ON forward_a
10-53
RUN
RUN activates a user-supplied utility program. The program name is used as a key into the
Utility_Tasks database table, which provides the filename for the program.
Format
RUN program-name [parameter-list]
Arguments
program-name (identifier): The utility program to start. The name must appear in the
Utility_Tasks database table. See Chapter 12 of the OASIS-CC System Manager's
Guide for more information on utility tasks. All values of local and global variables
are converted to string data.
parameter-list: Optional values to pass to the utility program. The list can contain
character strings, local variables and/or global variables separated by commas
Notes
1. The utility program runs with the same attributes and scheduling class as OASIS-
CC.
2. If a parameter is character string, the string is passed to the utility program. Single
quotes within a string (') are replaced with double quotes (").
3. If a parameter is either and EU or a REAL (see Chapter 2), the ASCII image of the
float value is passed to the utility program. The units associated with EUs are
dropped.
5. If a parameter is a STATE, the ASCII image of the state is passed to the utility
program.
6. If a parameter is a delta time, the ASCII image of the float value in seconds is
passed to the utility program.
10-54
7. If a parameter is a clock time, the ASCII image of the time is passed to the utility
program.
10-55
SAMPLE
SAMPLE initiates sampling on an IEEE-488 bus.
Format
SAMPLE device-name-list [EVERY sample-rate]
Arguments
device-name-list (identifier): The devices to sample, separated by commas.
Notes
1. Different IEEE buses may contain the devices.
10-56
SEND
SEND sends a command message, a command expressed as a bit pattern, or a command
expressed as a string of ASCII characters.
Format
SEND MESSAGE
Arguments
bit-pattern-command (H#hex-integer-constant): The hexadecimal representation of the
command.
quoted-character-string (string): The string data must be enclosed within double quotes
Notes
1. Single quotes within the string data are translated into double quotes prior to issuing
the ASCII command.
2. The local and global variables named must contain string data.
10-57
SHOW
SHOW displays certain CLP and command information.
Format
SHOW attribute item
Arguments
attribute (identifier): Qualifies the information type to show.
ACTIVE PROCEDURES
COMPILED PROCEDURES
DEFINED MACROS
PENDING CEV
Notes
1. PENDING CEV refers to the queue of commands that are pending Command
Execution Verification. Chapter 5 of the OASIS-CC System Manager's Guide
describes Command Execution Verification.
10-58
SNAP
SNAP saves the current contents of the named display page.
Format
SNAP page-name
Arguments
page-name (identifier): The display page to snap.
Notes
1. SNAP page-name creates a printable approximate image of the page. This form of
the directive does not require that the page be displayed in order to be snapped. It
creates a file named fyy_mon_dd_hh_mm_ss.page-name in the $OASIS_SNAP
directory.
10-59
START
START initiates procedure execution and optionally passes the actual value for parameters
to it. If the procedure has been compiled, procedure execution begins immediately. If not,
the procedure is compiled before execution.
Format
START proc-name [argument-list]
Arguments
proc-name (identifier): The procedure to start.
argument-list : The values passed to the procedure. Multiple arguments are separated by
commas. If a procedure expects arguments, the correct number must be passed and
in the same order as the formal parameters specified in the PROC statement.
Procedure arguments may be variables or numeric, state or text string constants.
All parameters are input only; they cannot currently be returned from a procedure.
Notes
1. The procedure must have an entry in the Procedures database table and be located in
the directory referenced by the logical name OASIS_PROCS.
10-60
Format
STOP POLLING BUS stream-name-list
Arguments
stream-name-list (identifier): The names of the primary streams on which automatic
polling should be stopped. The stream names are separated by commas.
10-61
STOP RECORDING
STOP RECORDING turns off the logging of event messages, incoming data streams,
outgoing command streams, or bridge streams.
Format
STOP RECORDING record-mode
Arguments
record-mode (identifier): The type of data logging is stopped for. If the record-mode is
MESSAGES, logging of event messages is terminated. Other record-modes are
interpreted as incoming data, an outgoing command, or bridge streams.
Notes
1. STOP RECORDING ALL terminates recording of all messages and streams. ALL
should not be used as a stream name.
2. For compatibility with previous OASIS-CC versions, the formats RECORD OFF
record-mode and RECORD OFF ALL are syntactically acceptable.
10-62
STOP RETRIEVING
STOP RETRIEVING terminates data retrieval from disk.
Format
STOP RETRIEVING data-stream
Arguments
data-stream (identifier): The data stream retrieval is terminated for.
Notes
1. STOP RETRIEVING ALL terminates all streams being retrieved. ALL should not
be used as a stream name.
10-63
STOP ROUTING
STOP ROUTING terminates routing of a return stream to a forward stream or a Sub-CLP.
Format
STOP ROUTING secondary-stream TO forward-stream
Arguments
secondary-stream (identifier): The secondary data stream from the Streams table.
Notes
1. STOP ROUTING secondary-stream terminates all routing of that stream (secondary
streams may be routed to many forward streams).
SWITCH ON return_a
SWITCH ON forward_a
ROUTE part_of_return_a TO forward_a
SWITCH OFF forward_a
SWITCH ON forward_a
10-64
STOP SAMPLING
STOP SAMPLING stops sampling of a device or stream associated with the IEEE bus.
Format
STOP SAMPLING device-name-list
Arguments
device-name-list (identifier): The devices sampling is stopped for, separated by
commas.
Notes
1. Devices do not have to appear on the same bus, streams do.
10-65
SWITCH
SWITCH activates and deactivates data streams. Streams may be assigned to a specific
data line to override the default.
Format
SWITCH ON data-stream [data-line]
Arguments
data-stream (identifier): The data stream to activate or deactivate.
Notes
1. If the stream's record in the Streams table has a secondary offset that is not 0,
OASIS-CC will build the decomposition tree for this stream when it is switched on.
This may take several minutes for complex data streams. If the secondary offset for
the primary stream is 0, OASIS-CC will look for a pre-saved copy of the stream's
decomposition tree instead – a much faster operation. See Chapter 6 of the OASIS-
CC System Manager's Guide for details on how to generate disk copies of
decomposition trees.
2. SWITCH OFF ALL terminates all active data streams. Do not use ALL as a stream
name.
10-66
SWITCH RECORDING
SWITCH RECORDING enables the reopening of event message log files, incoming data
streams record files, outgoing command stream record files and bridge stream record files,
without loss of any data.
Format
SWITCH RECORDING OF data-stream-name
Arguments
data-stream-name (identifier): The stream name the statement is applied to.
Notes
1. SWITCH RECORDING OF data-stream-name forces the closing and reopening
without data loss of the record file of the indicated stream.
4. An error will result if SWITCH RECORDING is specified for a file that is not
currently open.
10-67
UNDEFINE
UNDEFINE undefines CSTOL macros.
Format
UNDEFINE macro-list
Arguments
macro-list (identifier): A list containing the macros to undefine.
10-68
UNLOCK
UNLOCK releases the lock on a database table, making the table accessible to all users.
Format
UNLOCK table-name
Arguments
table-name (identifier): The database table to unlock.
10-69
UPDATE
UPDATE modifies fields for all database table records where the selection clause holds.
Format
UPDATE table-name value-list WHERE selection-expression
Arguments
table-name (identifier): The database table containing the records to modify.
value-list (): A list of items of the format field-name = value where field-name is the a
field in the record and value is a constant placed in the field for each record meeting
the selection criteria. Multiple items are separated by commas.
Notes
1. Users may only update fields where they have access privilege. Key fields cannot
be updated.
2. Any value other than an integer number, real number, or identifier (an alpha
character followed by a sequence of alphanumeric characters) must be enclosed in
quotes.
10-70
WAIT
WAIT suspends a procedure. These suspension types may occur with WAIT:
• Conditional/timed suspends the procedure until certain conditions are met or until a
specified delta or clock time has expired.
Format
WAIT
WAIT delta-time
WAIT clock-time
Arguments
delta-time (delta time expression): The length of time to wait before terminating the wait
clock time (delta time expression): The clock time to wait for before terminating the wait
Notes
1. If no expression is given, the procedure is placed in an indefinite wait. To resume
execution, issue GO from the keyboard.
10-71
4. If the time in a wait is a clock time, procedure execution is suspended until that
time. When the time is reached, the procedure automatically resumes execution.
6 If the result of a conditional wait is TRUE, no wait occurs. If the expression has a
logical FALSE value, the procedure enters a wait state until it re-evaluates TRUE,
or until an optional delta or clock time expired. The rate of re-evaluation is
governed by the delta time stored in $$CHECK_INTERVAL.
7. A conditional wait returns the state value NO_ERROR in the $$ERROR variable
when the condition is TRUE. $$ERROR returns TIME_OUT if either the optional
delta or clock time expires, depending on which was supplied.
8. If a user starts a procedure from the keyboard while another procedure sits in
conditional or timed wait, the preempted procedure enters an unconditional wait
state.
9. Care must be taken not to 'stack' waits from the keyboard. For example, if a
procedure has entered a wait condition, and the user enters WAIT 00:00:05 from
the keyboard, the procedure will resume execution in 5 seconds, regardless of the
type of wait that originally halted the procedure.
10-72
WAIT AT
WAIT AT sets a breakpoint at a specified label or line number. When the breakpoint is
reached, the procedure enters an unconditional wait. The break may occur each time or the
first time the label or line is encountered.
Format
WAIT AT label / line [ALWAYS]
Arguments
label (identifier): The label where execution is suspended.
line (positive integer constant): The line number where execution is suspended.
Notes
1. A line number may only be specified in a WAIT AT issued from the terminal.
2. WAIT AT is canceled once used unless the ALWAYS option is to keep the
breakpoint in effect. All breakpoints are canceled when the procedure terminates.
10-73
WAIT FOR
WAIT FOR is designed to use in conjunction with Command Execution Verification
(CEV). See Chapter 5 of the OASIS-CC System Managers Guide for CEV details.
Format
WAIT FOR command-group-name
Arguments
command-group-name (identifier): The name of the command group the wait applies to.
Notes
1. WAIT FOR command-group-name temporarily blocks a procedure while there are
commands pending CEV for the command-group-name.
4. WAIT FOR ALL acts identically to WAIT FOR command-group-name, except that
all commands in the pending CEV queue are considered, not just commands
belonging to a single group.
10-74
7. WAIT FOR generates messages showing the status of the pending CEV queue after
the WAIT FOR is complete. The messages are similar to those generated by the
statement SHOW PENDING CEV.
10-75
WRITE
WRITE inserts a message into the event message log. The message can combine text with
variable values. See the description for CHECK, a statement similar to WRITE.
Format
WRITE write-list
Arguments
write-list (expression): A list of expressions determining the output. Multiple
expressions are separated by commas.
Notes
1. Each item in a write list may be a valid CSTOL expression. The expression is
evaluated and the result output. However, most items fall into two categories:
• Specifying a global, local or special variable results in the output of that value.
• Validity checks on the user-supplied ID codes are not performed. Users can
supply any characters, however the event message processor understands
alphabetical characters only;
• ID codes are 2 characters wide, except for the '..xx' codes starting with L,
CM, or CD, which are 4 characters wide.
For example, WRITE "ABCD This is a test" will result in 3 instances of the
message "This is a test". One instance carries the custom message ID AB. The
10-76
second carries the ID CD. The third carries the inherent LIxx code OASIS-CC
automatically associates with all WRITE output.
Text output by WRITE is limited to one line in the message log. The text from each item
is appended to existing text from the statement.
4. Color and attribute control information may appear within a message. For example
the text string.'<R>This is a critical message" results in the display of screen output
in red (on color terminals). The red remains in effect for that line unless another
color code is supplied. Similarly, <Y> and <G> specify yellow and green
messages.
10-77
10-78
The control language processor (CLP) allows the user to communicate with the OASIS-CC
system. Using the CLP, the user issues commands, requests displays, and runs
procedures.
OASIS-CC contains different types of CLPs. Automatic CLPs are used by subsystems
with needs similar to the user. For example, the Command Subsystem may run a
procedure to check for appropriate system configuration before and to verify that the
desired effect has occurred after a command is sent. To facilitate this interaction, CLPs are
available to subsystems needing them. In particular, one CLP has been provided for
Command, two for Data Handling.
Sub-CLPs assist with closed loop control performance. Sub-CLPs execute procedures in a
background mode without interfering with user CLP activities.
This appendix describes the automatic and Sub-CLPs within OASIS-CC. Implementation
of automatic CLPs is described further in the OASIS-CC System Manager's Guide.
Automatic CLPs
The equation, trigger, and command CLPs are automatic CLPs.
Equation CLP:
The Data Handling subsystem manipulates data arriving in a telemetry stream and derives
other data values by sending LET statements or procedures with LET statements to the
Equation CLP. For example, if a telemetry stream provides measurements of battery
voltage from three sensors, Data Handling may send a LET statement to the Equation CLP
to derive the average voltage.
A-1
Trigger CLP:
If Data Handling detects an out of limits analog measurement or a discrete measurement not
in the correct state, it may send statements or procedures to the Trigger CLP to initiate an
automatic response to the specific condition. These responses include notifying the user of
the problem, performing diagnostics, and taking corrective action.
Command CLP:
Command uses this CLP to execute CSTOL statements and procedures ensuring that all
command prerequisites are met prior to transmission and to determine proper execution.
1. Automatic CLPs are autonomous, each with its own set of compiled procedures and
macros. All automatic CLP input comes from its subsystem, allowing users no
explicit control over it. For example, compilation or recompilation of a procedure
from a user CLP does not make the code available to an automatic CLP. For a
procedure to be recompiled, the user must terminate and restart the OASIS-CC
session or force recompilation via input through the automatic CLP subsystem.
2. Procedure lines within an automatic CLP are not displayed to the CSTOL procedure
line window. WRITE statements within procedures running in automatic CLPs
may alert the user to when the procedures runs and what it does. However,
WRITE the execution speed of automatic procedures.
3. Error messages are not reported via the CSTOL error message window. Errors
during automatic CLP processing appear in the message log and event message
windows on the screen.
A-2
4. Procedures in automatic CLPs may not enter an indefinite wait state. These
procedures are terminated if the procedure encounters:
• An ASK statement;
Sub-CLPs
Sub-CLPs execute procedures, providing a closed loop control capability within OASIS-
CC while freeing user CLPs to initiate activities more executive in nature. They have
nearly the capabilities as a user CLP, executing any CSTOL directive embodied within a
procedure. Sub-CLPs may execute directives outside a procedure that are associated with
its control.
Initiation of Sub-CLPs
The OASIS-CC system manager decides if an application requires Sub-CLPs. Their
number must be defined in a Latest_Data table global variable (SUB_CLP NUMBER).
When started, OASIS-CC reads this variable and creates the appropriate number of Sub-
CLPs. If SUB_CLP NUMBER does not exist at startup, or its value is zero or less, no
Sub-CLPs are available during that session. Additional global variables must be defined to
allow the user to monitor the execution status of each Sub-CLP. See Appendix C of the
OASIS-CC System Managers Guide for further information on Latest_Data entries.
CSTOL statements received from external sources can be routed to Sub-CLPs. The
User_Privileges table is used to define whether a given Sub-CLP has authority to execute
commands, run procedures or access External Communications. This table is read once at
startup, therefore any modifications to it during run time are ignored. See Chapter 6 of the
OASIS-CC System Managers Guide for more details on ROUTING data to Sub-CLPs.
3 START PROC_XYZ
This causes START PROC_XYZ to be passed to sub-CLP 3, which then compiles and
executes the procedure. Sub-CLPs are designed to be restricted to running and controlling
CSTOL procedures. Procedures that run on sub-CLPs can use any of the CSTOL
directives available, however the list of directives that can be passsed to a sub-CLP from
A-3
the user-CLP (by prefacing the user-CLP directive with a sub-CLP number) is limited to
the following set:
Chapter 10 provides complete descriptions of the directives listed above. In general, user-
CLP initiation of the allowable directives on any Sub-CLP takes this form:
Format
Sub-CLP-number Directive
Arguments
Sub-CLP-number (identifier): An integer value or a local variable declared as an integer
with a value from 1 to 20.
Directive (identifier): The legal values are GO, GO TO, WAIT, RETURN, SHOW,
DEFINE, UNDEFINE, COMPILE, DECOMPILE, START, and CLEAR. Chapter
10 provides their formats.
Notes
1. Statements routed to a sub-CLP from the External Communications subsystem can
be any CSTOL directive – they are not limited to the list above.
A-4
Appendix B. Operator-Operand
Compatibility
The following tables show the operands allowed with operators appearing in CSTOL
expressions. Rows represent the possible values of operands appearing to the left of
operators while columns represent the possible values of operands appearing to their right.
For each legal combination of operands, the corresponding table cell is filled with the result
data type. If no entry appears in a table cell, the operation is not allowed.
Assignment (=)
Integer Real Clock Delta State Text Dn Eu
Integer Allowed Rounded Allowed
Real Allowed Allowed Allowed
Clock Allowed
Delta Allowed
State Allowed
Text Allowed
Dn Allowed Allowed
Eu Allowed Allowed
B-1
Addition (+)
Integer Real Clock Delta State Text Dn Eu
Integer Integer Real
Real Real Real
Clock Clock
Delta Clock Delta
State
Text Text
Dn Dn
Eu Eu
Subtraction (-)
Integer Real Clock Delta State Text Dn Eu
Integer Integer Real
Real Real Real
Clock Delta Clock
Delta Delta
State
Text
Dn Dn
Eu Eu
Multiplication (*)
Integer Real Clock Delta State Text Dn Eu
Integer Integer Real Delta Eu
Real Real Real Eu
Clock
Delta Delta
State
Text
Dn
Eu Eu Eu
B-2
Division (/)
Integer Real Clock Delta State Text Dn Eu
Integer Integer Real
Real Real Real
Clock
Delta Delta
State
Text
Dn
Eu Eu Eu
Modulo (mod)
Integer Real Clock Delta State Text Dn Eu
Integer Integer
Real
Clock
Delta
State
Text
Dn
Eu
Exponentiation (**)
Integer Real Clock Delta State Text Dn Eu
Integer Integer
Real Real
Clock
Delta
State
Text
Dn
Eu
B-3
B-4
Negation (-)
Integer Real Clock Delta State Text Dn Eu
Integer Integer
Real Real
Clock
Delta Delta
State
Text
Dn Dn
Eu Eu
B-5
B-6
OASIS-CC application developers can add to or delete from the list of CSTOL command
verbs. The command verbs delivered with OASIS-CC are in Table C.1. Adding and
deleting command verbs should be used with care – changes should be coordinated
between members of the same project to make sure that no incompatibilities are created.
To update the command sub-language verb list, four steps are necessary:
1) Edit parser.dat file. This file (in the directory pointed to by $OASIS_PARSER)
contains the ASCII representation of the parsing rules.
C-1
3) Remove the lines that correspond to the verbs you want to remove and/or add the
lines that correspond to the verbs you want to add. For example, add arm, disarm,
fire, initiate, activate and get to the list of command keywords:
; THIS PORTION OF PARSER.DAT FILE CAN BE MODIFIED TO ADD OR REMOVE CMD VERBS
STATE
TRAN 'NOW' ,CMD_HOLD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'HOLD' ,CMD_NAME_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'ENABLE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'CHANGE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'CLOSE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'DISABLE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'HALT' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'MOVE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'OPEN' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'SET' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'TOGGLE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'TURN' ,TURN_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'BOOT' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'SELECT',NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'DUMP' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'IGNORE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'USE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'PASS' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'DRIVE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'FORCE' ,TURN_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'FLYBACK' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN !RESET ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN !STEP ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN !TEST ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
C-2
4) Convert the ASCII file into a binary file understandable by OASIS-CC by entering
$ODIST/bin/convert_table. This creates a file called parser_int.dat in
$OASIS_PARSER. This is the file from which OASIS-CC loads the language
rules at run-time.
C-3
C-4