You are on page 1of 168

OASIS-CC

Operations and Science Instrument Support


Command and Control

CSTOL Reference Manual

For OASIS-CC V02.05.12


and subsequent versions
November 1994

Copyright  1986, 1992


By the Regents of the University of Colorado
OASIS-CC
Operations and Science Instrument Support
Command and Control

CSTOL Reference Manual

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.

Copyright  1986, 1992


By the Regents of the University of Colorado
OASIS-CC CSTOL Reference Manual Table of Contents

Table of Contents

1. Introduction .................................................................................... 1-1


About CSTOL ................................................................................ 1-1
Using CSTOL................................................................................. 1-2
About This Manual........................................................................... 1-2
Manual Conventions..................................................................... 1-3
2. Building Blocks ............................................................................... 2-1
CSTOL Character Set........................................................................ 2-1
Identifiers...................................................................................... 2-3
Constants ...................................................................................... 2-3
Literals .................................................................................... 2-3
States ...................................................................................... 2-4
Integers .................................................................................... 2-4
Data Numbers ............................................................................ 2-5
Real Numbers ............................................................................ 2-6
Engineering Units........................................................................ 2-7
Clock Times .............................................................................. 2-7
Delta Times............................................................................... 2-8
Strings ..................................................................................... 2-8
Variables....................................................................................... 2-8
Global Variables ......................................................................... 2-8
Local Variables........................................................................... 2-10
Special Variables......................................................................... 2-10
Global Special Variables................................................................ 2-10
CLP Special Variables .................................................................. 2-14
Procedure Special Variables............................................................ 2-17
Other Special Variables ................................................................. 2-17
3. Building CSTOL Statements ................................................................ 3-1
Labels .......................................................................................... 3-1
Directives...................................................................................... 3-2

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Table of Contents OASIS-CC CSTOL Reference Manual

Qualifiers ...................................................................................... 3-2


Arguments ................................................................................ 3-2
Clauses .................................................................................... 3-2
Argument Lists ............................................................................... 3-3
Range Specifications......................................................................... 3-3
Input Lines................................................................................ 3-4
Comments................................................................................. 3-4
4. Summary of CSTOL Statements............................................................ 4-1
Expressions.................................................................................... 4-1
Control Structures ............................................................................ 4-2
Procedures..................................................................................... 4-2
Macros ......................................................................................... 4-3
Commands .................................................................................... 4-3
Communications.............................................................................. 4-4
User Input/Output ............................................................................ 4-4
Database Management....................................................................... 4-5
Program Control.............................................................................. 4-5
5. Expressions .................................................................................... 5-1
Operators ...................................................................................... 5-2
Arithmetic Operators .................................................................... 5-2
String Operators.......................................................................... 5-3
Relational Operators..................................................................... 5-3
Logical Operators........................................................................ 5-4
Order of Evaluation .......................................................................... 5-5
Data Types in Expressions .................................................................. 5-6
Functions ...................................................................................... 5-7
Trigonometric Functions................................................................ 5-7
Inverse Trigonometric Functions ...................................................... 5-7
Hyperbolic Functions.................................................................... 5-8
Miscellaneous Functions................................................................ 5-8
Using Expressions............................................................................ 5-9
Assignment ............................................................................... 5-9
IF-blocks .................................................................................. 5-10
Indefinite Wait ........................................................................... 5-10
Timed Wait ............................................................................... 5-10
Conditional/Timed Wait ................................................................ 5-11
Command Execution Verification Wait .............................................. 5-11
Positional Wait ........................................................................... 5-11

ii

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Table of Contents

Input to CSTOL .......................................................................... 5-12


Output to the User ....................................................................... 5-12
6. Control Sequences ............................................................................ 6-1
IF-Blocks ...................................................................................... 6-1
Loops........................................................................................... 6-2
7. Procedures...................................................................................... 7-1
The Form of a CSTOL Procedure.......................................................... 7-2
Declarative Section ...................................................................... 7-2
Executable Section....................................................................... 7-3
Preparing a Procedure ....................................................................... 7-3
Installing a Procedure........................................................................ 7-3
Compiling a Procedure ...................................................................... 7-4
Starting a CSTOL Procedure ............................................................... 7-5
Controlling a CSTOL Procedure ........................................................... 7-6
Suspending Procedure Execution...................................................... 7-6
Setting Breakpoints in a Procedure.................................................... 7-7
Resuming Execution of a Suspended Procedure..................................... 7-7
Terminating a Procedure................................................................ 7-7
Procedures and Special Variables ..................................................... 7-7
Determining the Status of CSTOL Procedures ...................................... 7-10
8. Macros.......................................................................................... 8-1
The Form of a CSTOL Macro .............................................................. 8-1
Preparing a Macro............................................................................ 8-2
Installing a Macro ............................................................................ 8-2
Macro Definition ............................................................................. 8-3
Invoking a Macro............................................................................. 8-3
Determining Macro Status .................................................................. 8-3
Example Macro............................................................................... 8-4
9. Commands ..................................................................................... 9-1
Basic Commands ............................................................................. 9-1
Qualifying and Quantifying Commands .................................................. 9-2
Clauses .................................................................................... 9-2
Qualifying Keywords.................................................................... 9-3
Unchecked Bit pattern and ASCII Commands ........................................... 9-4
Timed Commands............................................................................ 9-5
Priority Commands........................................................................... 9-5
Command Messages ......................................................................... 9-6
Microprocessor Loads ....................................................................... 9-6

iii

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Table of Contents OASIS-CC CSTOL Reference Manual

10. Description of CSTOL Statements........................................................ 10-1


ASK ............................................................................................ 10-2
BEGIN ......................................................................................... 10-3
CANCEL ...................................................................................... 10-4
CHECKPOINT ............................................................................... 10-5
CLEAR ........................................................................................ 10-7
CHECK ........................................................................................ 10-8
Commands .................................................................................... 10-10
Basic Command Syntax................................................................. 10-10
Clauses and Keywords .................................................................. 10-11
Timed Commands ....................................................................... 10-12
Priority Commands ...................................................................... 10-12
COMMIT...................................................................................... 10-14
COMPILE ..................................................................................... 10-15
CSTOL OFF .................................................................................. 10-16
DECLARE .................................................................................... 10-17
DECOMPILE ................................................................................. 10-19
DEFINE ....................................................................................... 10-20
DELETE....................................................................................... 10-21
DISPLAY ..................................................................................... 10-22
ELSE ........................................................................................... 10-24
ELSE IF........................................................................................ 10-25
END ............................................................................................ 10-26
END IF .................................................................................... 10-26
END LOOP............................................................................... 10-26
END MACRO............................................................................ 10-26
END PROC............................................................................... 10-27
ESCAPE ....................................................................................... 10-28
FLUSH......................................................................................... 10-29
GO.............................................................................................. 10-30
GO TO ......................................................................................... 10-31
IF ............................................................................................... 10-32
INITIALIZE .................................................................................. 10-33
INSERT........................................................................................ 10-34
LET............................................................................................. 10-35
LOAD.......................................................................................... 10-37
LOCK .......................................................................................... 10-38
LOOP .......................................................................................... 10-39

iv

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Table of Contents

MACRO ....................................................................................... 10-40


MAKE ......................................................................................... 10-41
MESSAGE .................................................................................... 10-42
POLL........................................................................................... 10-43
PROC .......................................................................................... 10-44
RECORD ...................................................................................... 10-45
REPORT....................................................................................... 10-47
RESTORE..................................................................................... 10-48
RETRIEVE.................................................................................... 10-49
RETRY ........................................................................................ 10-51
RETURN ...................................................................................... 10-52
ROUTE ........................................................................................ 10-53
RUN............................................................................................ 10-54
SAMPLE ...................................................................................... 10-56
SEND .......................................................................................... 10-57
SHOW ......................................................................................... 10-58
SNAP .......................................................................................... 10-59
START......................................................................................... 10-60
STOP POLLING BUS....................................................................... 10-61
STOP RECORDING......................................................................... 10-62
STOP RETRIEVING ........................................................................ 10-63
STOP ROUTING............................................................................. 10-64
STOP SAMPLING........................................................................... 10-65
SWITCH....................................................................................... 10-66
SWITCH RECORDING .................................................................... 10-67
UNDEFINE ................................................................................... 10-68
UNLOCK...................................................................................... 10-69
UPDATE ...................................................................................... 10-70
WAIT .......................................................................................... 10-71
WAIT AT...................................................................................... 10-73
WAIT FOR.................................................................................... 10-74
WRITE......................................................................................... 10-76
Appendix A. Control Language Processors .................................................. A-1
Automatic CLPs.......................................................................... A-1
Automatic and User CLP Differences ................................................ A-2
Sub-CLPs ................................................................................. A-3
Initiation of Sub-CLPs .................................................................. A-3

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Table of Contents OASIS-CC CSTOL Reference Manual

User Control of the Sub-CLPs ......................................................... A-3


Appendix B. Operator-Operand Compatibility .............................................. B-1
Appendix C. Adding Command Verbs to the Parser........................................ C-1

vi

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 1. Introduction
Rev 0 – 11/94

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:

• A distinctly English-like syntax;

• The ability to access database tables using a query language;

• A mechanism for expanding the language through macros.

CSTOL users may perform the following functions:

• Evaluate expressions with data item variables from the spacecraft or instrument;

• Make decisions based on information returned by the spacecraft or instrument;

• Initiate and control procedures written in CSTOL;

• Initiate OASIS-CC and system utility programs;

• Maintain the OASIS-CC database;

1-1

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


1. Introduction OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

• Call and terminate displays;

• Make and break communications links;

• Send commands to the spacecraft or instrument.

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.

OASIS-CC may execute procedures using background CLPs (sub-CLPs). Appendix A


describes the variety of CLPs within OASIS-CC.

About This Manual


This manual describes the CSTOL language as implemented within OASIS-CC and may be
used as both a tutorial for new users and a reference guide. Chapters 2 through 9 begin
with basic language components — how to form words and statements in CSTOL — and
progress to more advanced topics such as expressions, procedures, macros and
commands. Chapter 10 describes each type of CSTOL statement in detail.

1-2

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 1. Introduction
Rev 0 – 11/94

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.

• Square brackets denote optional components.

The following example uses all conventions:

DECLARE VARIABLE name = default-value [value-range]

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


1. Introduction OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

This page is intentionally blank.

1-4

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

2. Building Blocks

This chapter explains the formation of different word and number classes, the basic
components of CSTOL statements.

CSTOL Character Set


Printable ASCII characters compose words and statements in CSTOL. Use the following
characters to construct CSTOL statements:

• Alphabetic characters, the letters A to Z in upper or lowercase. CSTOL is case


insensitive, treating upper and lowercase characters identically. The following
statements are equivalent in CSTOL:

TURN OFF HEATER_1

TURN OFF heater_1

turn off heater_1

Turn Off Heater_1

• The decimal digits 0 - 9.

• Special characters to act as mathematical operators in expressions or string


delimiters:

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.

Underscores, _, connect words to form meaningful identifiers like


HIGH_VOLTAGE.

2-1

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

Double quotation marks, "", delimit text strings.

Parentheses, ( and ), set off parts of an expression.

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 asterisk, *, expresses multiplication within arithmetic expressions.

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 pound sign, #, is the radix indicator in non-decimal integer constants.

The ampersand, &, is the continuation marker, indicating when to continue a


statement on another line.

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.

The comma separates arguments within argument lists.

2-2

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

Identifiers
Identifiers are alphanumeric names. Identifiers have the following uses:

• Literal constants

• State constants

• Units in engineering unit numbers

• 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:

CLEAR ALL window-type

The window-type argument is replaced by one of these literals: DISPLAYS, MESSAGES,


COMMANDS or REPORTS.

2-3

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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:

LET $INST_STATE = OFF

SET FAN SPEED TO LOW

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.

123,456,789 — No commas allowed.

99999999999 — Magnitude greater than 231 not 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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

• B = Binary: valid digits are 0 and 1

• O = Octal: valid digits are 0 - 7

• D = Decimal: valid digits are 0 - 9

• X = Hexadecimal: valid digits are 0 - 9 and A - F. Interpreted as an unsigned


integer

• H = Hexadecimal: valid digits are 0 - 9 and A - F – used in raw binary SEND


commands

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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 ] integer . [fraction]

[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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

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:

27.948 V — Value in volts

7.13E-1 MA — Value in milliamperes

90.00DEG — Value in degrees of arc

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:

[year] / [day-of-year] - [hour] : [minute] : second

Year is specified as a two- or four-digit number. If two, a value of 1900 is added to


calculate a twentieth century date. If omitted, Year defaults to the current year.

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

/-18:00:00 — 1800 hours today

2-7

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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:

[hours] : [minutes] : seconds

The components of this format have the same definitions and rules as for clock times. For
example:

01:30:00.0 — Specifies an interval of 90 minutes

::22.2 — Specifies an interval of 22.2 seconds

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

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:

WRITE PLATFORM TEMPERATURE

prints a value in engineering units, like degrees Centigrade, while

WRITE RAW PLATFORM TEMPERATURE

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:

WRITE AVERAGED PLATFORM TEMPERATURE

WRITE SMOOTHED PLATFORM TEMPERATURE

Either word prints the current running average value of the platform temperature.

2-9

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

OASIS-CC interprets names lacking the $ as state constants.

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).

Global Special Variables


These variables are visible system-wide.

$$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:

• ISSUE — Enables the transmission of commands to be defined by each sub-CLP's


value of $$COMMAND_MODE;

• NOISSUE — Disables transmission of all OASIS-CC commands.

2-10

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

The default value for $$GBL_COMMAND_MODE is ISSUE. This variable has a


corresponding Latest_Data element, $$GLOBAL $$COMMAND_MODE that reflects its
value. This correspondence allows the setting to be displayed.

$$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;

• CMD — Enables the logging of command contents (without message headers or


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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

• HILO — HILO checks are performed as defined in Latest_Data and Limits.

• DELTA — DELTA checks are performed as defined in Latest_Data and Limits.

• OFF — No limits checks defined in Latest_Data and Limits are performed.

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.

• BOTH — DESIRABILITY and CHANGE checks are performed as defined in


Latest_Data and State_Conversions.

• DESIRABILITY — DESIRABILITY checks are performed as defined in


Latest_Data and State_Conversions.

• CHANGE — CHANGE checks are performed as defined in Latest_Data and


State_Conversions.

2-12

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

• OFF — No states checks defined in Latest_Data and State_Conversions are


performed.

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:

• ON — Engages CEV for commands with CEV enabled in the database.


Commands not enabled for CEV in the database aren't affected by this variable;

• 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:

• ON — Engages UED for enabled telemetry items in the database;

• 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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

$$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:

• ON — Engages PRECHECK execution for commands with PRECHECKs defined;

• OFF — Disengages PRECHECK execution for commands with PRECHECKs


without altering the database.

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:

• ON — Engages POSTCHECK execution for commands with POSTCHECKs


defined;

• OFF — Disengages POSTCHECK execution for commands with POSTCHECKs


without altering the database.

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.

CLP Special Variables


These variables are local to each CLP. Each CLP has its own copy.

$$ERROR
This variable holds the exit status of a combined conditional/timed wait. It has one of these
state values:

• NO_ERROR — Indicates the relational expression tested TRUE;

2-14

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

• 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:

• WINDOW —Compiler output is directed to the display screen;

• FILE — Compiler output is written to a disk file;

• BOTH — Both window and file output are desired;

• NEITHER — Neither window nor file output is desired.

The default value for $$COMPILER_OUTPUT is NEITHER.

$$CHECK_INTERVAL
This variable determines the rate at which conditional WAIT statements are evaluated. It is
expressed as a delta time such as:

• 00:00:01— Conditional WAIT will be evaluated about once per second;

• ::00.5— Conditional WAIT will be evaluated about two times per second.

The default value for $$CHECK_INTERVAL is 00:00:01

$$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:

• ISSUE — Enables the transmission of commands;

• NOISSUE — Disables transmission of commands.

The default value for $$COMMAND_MODE is ISSUE

2-15

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

$$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.

Table 2.1 $$CLP_STEP_MODE, $$CLP_STP_INTERVAL and


$$CLP_LOG_INPUT defaults

CLP $$CLP_LOG_INPUT $$CLP_STP_INTERVAL $$CLP_STEP_MODE

User YES ::0.0 GO


Equation NO ::0.0 GO
Command NO ::0.0 GO
Trigger YES ::0.0 GO
Sub YES ::0.0 GO

2-16

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 2. Building Blocks
Rev 1 – 11/94

Procedure Special Variables


These variables exist only within the domain of the active procedure, and must be set
within the body of the procedure.

$$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:

• 00:00:02 — Procedure statements are executed every two seconds (when


$$STEP_MODE is PAUSE).

The default value is 00:00:01.

$$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;

• PAUSE — Procedure statements are executed once the $$STEP_INTERVAL time


interval elapses;

• WAIT — Procedure statements wait until the user enters a GO directive to execute .
This process equals a single step mode.

The default for $$STEP_MODE is GO.

Other Special Variables

$$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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


2. Building Blocks OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

This page is intentionally blank.

2-18

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 3. Building CSTOL Statements
Rev 1 – 11/94

3. Building CSTOL Statements

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:

[label:] directive qualifiers.

For example:

TURN OFF HEATER_1

DIAGNOSTICS: START LEAK_TEST

LET TANK PRESSURE = 28.5 PSI

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


3. Building CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

1A: — A letter always begins a label.

A1$: — Only alphanumeric characters and underscores are allowed.

Check_Transponder: — Labels must be 16 characters or less.

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:

DISPLAY POWER_STATUS 7 0:0:10

To simplify such statements, most arguments are encased within clauses. This example
demonstrates the same statement with clauses:

3-2

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 3. Building CSTOL Statements
Rev 1 – 11/94

DISPLAY POWER_STATUS ON 7 EVERY 0:0:10

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;

• BEGINNING — Starting clock time;

• BY — Quantity of increase or decrease;

• EVERY — Repeat time interval;

• FROM — A source;

• ON — A location;

• TO — A destination;

• UNTIL — Stopping clock time;

• WITH — One or more parameter name/value pairs;

• WHERE — Condition specifying a contingent action.

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:

COMPILE PROC_A, PROC_B, PROC_C

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


3. Building CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

-10 : +10 — Range of integer values

24.5 : 30.6 — Range of real values

0.DEG : 90.DEG — Range of engineering units values

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 4. Summary of CSTOL Statements
Rev 1 – 11/94

4. Summary of CSTOL Statements

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.

• DECLARE defines procedure parameters, local variables and constants.

• LET evaluates an arithmetic or logical expression.

4-1

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


4. Summary of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

• END IF marks the end of an IF-block.

• END LOOP marks the end of a loop.

• ESCAPE breaks a loop, transferring control to the first statement after END LOOP.

• IF marks the beginning of a set of statements executed if the IF relational


expression is TRUE.

• 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.

• COMPILE compiles one or more procedures.

• DECOMPILE releases the memory space of the compiled code of one or more
procedures.

• END PROC marks the end of a procedure.

• GO resumes procedure execution.

• GO TO redirects procedure execution.

• PROC marks the procedure start and names its expected parameters.

• RETURN terminates procedure execution.


4-2

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 4. Summary of CSTOL Statements
Rev 1 – 11/94

• START initiates procedure execution, supplying the arguments passed to it.

• WAIT suspends procedure execution.

• WAIT AT sets an automatic breakpoint within a procedure.

Macros
The following statements define CSTOL macros.

• DEFINE preprocesses a macro, making it available for use.

• END MACRO marks the macro end.

• MACRO marks the macro beginning.

• UNDEFINE releases the memory space of one or more 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.

• FLUSH clears the Command Execution Verification (CEV) buffers.

• CANCEL deletes command messages before transmission.

• LOAD transfers disk file contents to an external element.

• MESSAGE marks the command message start.

• RETRY retransmits a command message.

• SEND transmits a command message or a raw binary or ASCII command.

4-3

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


4. Summary of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

Communications
The following statements control data reception from and transmission to external elements.

• INITIALIZE initializes an IEEE-488 bus controller.

• MAKE sets a bus device to a specific communications state.

• POLL initiates acquisition of IEEE devices' status bytes.

• 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.

• ROUTE sends part of a return stream to a forward stream or a sub-CLP.

• SAMPLE initiates sampling of devices on an IEEE-488 bus.

• STOP POLLING terminates automated polling on an IEEE-488 bus.

• STOP SAMPLING terminates sampling of devices on an IEEE-488 bus.

• SWITCH activates or deactivates a data stream.

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.

• ASK asks the user questions and receives the answers.

• 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.

• SHOW displays the CSTOL Control Language Processor status, including


procedure and macro names known to the CLP.

• SNAP saves the contents of display or message windows in a disk file.


4-4

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 4. Summary of CSTOL Statements
Rev 1 – 11/94

• 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.

• COMMIT and CHECKPOINT save memory-resident contents of database tables to


disk files.

• DELETE removes records from a database table.

• 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.

• REPORT produces a list of database table records meeting user-specified criteria.

• RESTORE copies a database table from disk to memory for access by OASIS-CC
software.

• UNLOCK releases a lock on a database table, allowing access by all users.

• UPDATE modifies fields within selected database table records.

Program Control
The following statements control access to OASIS-CC and run application and system
programs.

• CSTOL OFF logs out users from OASIS-CC software.

• RUN initiates routines outside of OASIS-CC.

4-5

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


4. Summary of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

This page is intentionally blank.

4-6

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 5. Expressions
Rev 0 – 11/94

5. Expressions

Expressions are mathematical equations consisting of variables, constants, functions, and


operators combined following the rules of expression construction outlined in this chapter.
Expressions appear in several CSTOL contexts, described below.

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:

• operand — Expressions may be simple constants or variables. This expression


value equals the operand value. For example:

3.14159 — A real constant.

PLATFORM POSITION — A global variable.

$X — A local variable.

• function (operand) — Functions applied to operands form expressions. This


expression value equals the returned function value. For example:

5-1

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


5. Expressions OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

LOG(3.14159) — Natural logarithm of π.

SIN(PLATFORM POSITION) — Sine of a global variable.

SQRT($X) — Square root of a local variable.

• expression operator expression — more elaborate expressions may be formed


using operators. For example:

3.14159 + $X — An arithmetic expression.

0.95*$X**2 - 12.37*$X + 201.06 — Another arithmetic expression.

PLATFORM POSITION < 152.3 DEG — A relational expression.

• (expression) — Expressions may be enclosed within parentheses to isolate part of


a complicated expression (see Order of Evaluation, below). The value of the
expression is unchanged. For example:

($X + 3.14159)

2*(PLATFORM POSITION - 123.7 DEG)

The expression output is always a single value.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 5. Expressions
Rev 0 – 11/94

• + for addition;

• - for subtraction or negation;

• * for multiplication;

• / for division;

• ** for exponentiation;

• mod for modulo.

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:

PLATFORM POSITION mod 5

($TEST - 123.0 DEG)*2

00:01:20 + 00:00:25 — Results in a value of 00:01:45

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:

"data" + "base" — Results in the string "database"

"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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


5. Expressions OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

• = for equal;

• /= for not equal;

• > for greater than;

• >= for greater than or equal;

• < for less than;

• <= for less than or equal.

Relational expressions contain relational operators. For example:

$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:

• and for the logical and

• or for the logical or

• xor for the logical exclusive or

• not for the logical not

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 5. Expressions
Rev 0 – 11/94

• 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:

• Subexpressions within parentheses are evaluated first. If nested, evaluation begins


inside the innermost parentheses and moves outward;

• Operators with higher precedence are evaluated before those with lower precedence;

• Operators of equal precedence are evaluated from left to right.

5-5

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


5. Expressions OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

The following list presents the CSTOL operator precedence from highest to lowest:

• Unary minus and logical not

• Exponentiation

• Multiplication and division

• Addition and subtraction

• String concatenation

• Relational operators

• Logical and, or and exclusive-or

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.

For operators of unequal precedence, the expression 1 + 3 * 4 produces a value of 13


because multiplication has a higher precedence than addition. The subexpression 3*4 is
evaluated, then 1 is added to yield 13. Again parentheses may alter the evaluation: (1 + 3)
* 4 produces the value 16.

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).

Data Types in Expressions


Operators act on specific types of operands. For example, two integer or delta-time values
may be added, but an integer may not be added to a delta-time value because they have
incompatible data types. At times the data types of two operands resemble enough that one
may be converted into a compatible data type, a process called coercion. When an operator
is applied to one or two operands one of the following happens:

5-6

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 5. Expressions
Rev 0 – 11/94

• 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.

• TAN represents the tangent of an angle.

For example:

SIN(45. DEG) — Results in the value .7071

COS(PLATFORM POSITION)

Inverse Trigonometric Functions


Inverse trigonometric functions take a single real argument interpreted as the sine, cosine or
tangent of an angle and return an engineering unit value with the angle in radians.

5-7

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


5. Expressions OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

• 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:

ASIN(1.0) — results in the value 1.57080 RAD

ACOS(1.0) — results in the value 0.0 RAD

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.

• SINH represents the hyperbolic sine of an angle.

• COSH represents the hyperbolic cosine of an angle.

• TANH represents the hyperbolic tangent of an angle.

See the following example:

SINH(1.57080 RAD) —Results in the value .7071

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).

• LOG represents the natural logarithm (to the base e).

• LOG2 represents the logarithm to the base 2.

• LOG10 represents the logarithm to the base 10.

• SQRT represents the square root.

5-8

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 5. Expressions
Rev 0 – 11/94

For example:

EXP(1.) — Results in the value 2.71828

SQRT(4) — Results in the value 2.0000

Using Expressions
CSTOL expressions appear in six different contexts:

• On the right side of the assignment operator in the CSTOL LET statement;

• In IF and ELSE IF statements within an IF-block;

• As the time specifier in a timed WAIT statement;

• As the condition specifier in a conditional WAIT statement;

• As a response to an input statement in an ASK statement;

• As the output value in a WRITE 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

LET EXTENDER POSITION = EXTENDER POSITION + 14.5 DEG

LET $X = 1.0 + SIN(123.4 DEG)*($Y-3.0)

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


5. Expressions OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 5. Expressions
Rev 0 – 11/94

WAIT 00:00:30 suspends a procedure for 30 seconds

WAIT $AOS suspends a procedure until the time specified in $AOS

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:

WAIT relational-expression [OR FOR delta time | OR UNTIL clock time]

The procedure remains suspended until the relational-expression is TRUE, or if supplied,


the delta or clock time has passed. The special variable $$ERROR returns NO_ERROR
when the condition is met, or TIME_OUT if a supplied delta or clock time has passed. The
relational-expression is evaluated at the frequency stored in the special variable
$$CHECK_INTERVAL. For example:

WAIT INSTRUMENT POWER = ON

WAIT INSTRUMENT POWER = OFF OR FOR 00:01:00

WAIT PLATFORM POSITION > 123. DEG OR UNTIL 1993/359-00:00:02

Command Execution Verification Wait


Command Execution Verification (CEV) waits suspend procedure execution depending on
the outcome of CEV processing (see Chapter 5 of the OASIS-CC System Manager's Guide
for a description of Command Execution Verification).

The CEV wait uses this format:

WAIT FOR cev_group_name

WAIT FOR ALL

WAIT FOR LAST

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


5. Expressions OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

The positional wait uses this format:

WAIT AT line number | label [always]

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:

ASK reply-variable ask-string.

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.

Output to the User


The WRITE statement evaluates a list of expressions and writes their values to the message
log. The WRITE statement has this format:

WRITE write-list.

Here write-list is a list of one or more expressions to be evaluated. For example:

WRITE "Current platform position is ", PLATFORM POSITION

WRITE 413 mod 360

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 6. Control Sequences
Rev 0 – 11/94

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:

• IF-blocks allow procedures to make decisions and conditionally execute statements


based on those decisions.

• 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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


6. Control Sequences OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

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]

Statements to be executed repeatedly

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 6. Control Sequences
Rev 0 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


6. Control Sequences OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

This page is intentionally blank.

6-4

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 7. Procedures
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


7. Procedures OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

The Form of a CSTOL Procedure


CSTOL procedures use this form:

PROC procedure-name [parameter-list]

Declarative section

BEGIN

Statement(s)

END PROC

Here procedure-name, an identifier, specifies the procedure name to CSTOL, while


parameter-list provides the procedure an optional set of formal parameters. Passing
parameters allows the procedure to be called with different input data. Each formal
parameter in the PROC statement is positionally matched with an argument in the START
statement initiating the procedure. For example, the value of the first argument is assigned
to the first formal parameter, the second value to the second parameter.

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:

DECLARE INPUT name = value [value-range]

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 7. Procedures
Rev 1 – 11/94

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 symbolic constant is a constant value referred to by an identifier. For example, the


mathematical quantity π is referred to by $PI, rather than repeatedly entering 3.14159. A
constant declaration has this format: DECLARE CONSTANT name = value.

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.

To install a procedure, transfer the procedure file to the directory indicated by


OASIS_PROCS. Next, place an entry in the OASIS-CC Procedures database table to tell
OASIS-CC the file name containing the procedure. This entry is typically made through
CSTOL using a statement like this:

7-3

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


7. Procedures OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

INSERT PROCEDURES Procedure_Name = proc-name, &


Filename = file-name

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.

Here proc-name-list contains a list of procedure names to compile. Once compiled a


procedure stays compiled and available for use for the remainder of the session. However,
the object version is kept in memory and discarded at termination.

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 WINDOW is selected, output is directed to the display screen. Messages, including


error messages, are sent to the message log when compilation begins and ends.

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.

• The source line from the procedure file.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 7. Procedures
Rev 1 – 11/94

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:

• Procedures missing the PROC statement;

• Procedures missing the END PROC statement;

• Procedures with a continuing last line.

Starting a CSTOL Procedure


Procedure execution begins with a START statement of this format:

START procedure-name [argument-list].

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:

1. A list of compiled procedures is searched for the named procedure. If found,


execution begins immediately.

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.

Recursive procedure calling — calling a running procedure — is not allowed in CSTOL.


7-5

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


7. Procedures OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

Controlling a CSTOL Procedure


The user has substantial control over the execution of CSTOL procedures. The following
CSTOL statements are available to control procedures. They may be entered from the
keyboard or — except for GO — occur within the procedure:

• WAIT suspends execution;

• WAIT AT establishes a breakpoint;

• GO resumes execution;

• GO TO transfers control to a particular line;

• RETURN terminates execution of the current procedure;

• RETURN ALL terminates execution of all active procedures.

Suspending Procedure Execution


Procedure execution is suspended with the WAIT statement. If entered from the keyboard,
WAIT allows the current statement to complete, then suspends the procedure before
processing the next statement . WAIT statements occur in the following types:

• An unconditional WAIT is not modified with relational or time expressions. It


causes procedure execution to stop until GO is entered from the keyboard.

• A timed WAIT is modified with a time expression (WAIT time-expression). If the


time expression is a clock time, the procedure is suspended until that time; if delta
time, the procedure is suspended for the specified duration.

• A conditional/timed WAIT is modified with a relational expression (WAIT


relational-expression) and an optional time expression (WAIT relational-expression
OR FOR delta time | OR UNTIL clock time). It stops procedure execution until the
relational expression evaluates to true. If the optional delta time or clock time expire
before the relational expression evaluates to true, the procedure resumes execution
after setting $$ERROR to TIME_OUT. It the relational-expression is true, then
$$ERROR is set to NO_ERROR. The rate at which a conditional expression is re-
evaluated is governed by the special variable $$CHECK_INTERVAL.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 7. Procedures
Rev 1 – 11/94

special variables. Refer to Chapter 4 of the OASIS-CC System Manager's Guide for more
information on limits and states checking.

Setting Breakpoints in a Procedure


The WAIT AT statement specifies a line, by line number or label, where procedure
execution is suspended. When reached, this specification, called a breakpoint, causes the
procedure to automatically enter an unconditional wait state before that line is executed.
Breakpoints normally occur when the line is first encountered, although they may be set for
every time.

Another type of breakpoint halts procedure execution depending on Command Execution


Verification (CEV) results (see Chapter 5 of the OASIS-CC System Manager's Guide).
WAIT FOR cev_group halts the procedure until all of the commands named by the
cev_group have passed CEV successfully. Cev_group can be a specific group name, or
ALL, or LAST.

Resuming Execution of a Suspended Procedure


The GO statement resumes procedure execution with the next line in sequence. GO
primarily resumes procedures in unconditional wait states (via WAIT statements,
breakpoints or errors), but may also resume procedures in conditional states prior to the
satisfaction of the condition or timed waits prior to the elapse.

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.

Procedures and Special Variables


Some of the special variables available in CSTOL are for status and control of procedure
execution. See Chapter 2 for complete descriptions of all of the special variables.

7-7

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


7. Procedures OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

$$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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 7. Procedures
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


7. Procedures OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

$$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.

Determining the Status of CSTOL Procedures


Information about procedures, compiled or active, is obtained with the SHOW statement.
For compiled procedures, use the SHOW COMPILED PROCEDURES statement. The
names and number of lines for each compiled procedure will appear.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 8. Macros
Rev 0 – 11/94

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:

• Macros execute as a single entity and their execution cannot be suspended or


redirected.

• 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.

The Form of a CSTOL Macro


Macros have this format:

MACRO macro-name parameter-list

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


8. Macros OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

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.

Macros always execute to completion — they cannot be suspended, resumed or redirected.


Each statement is executed in order of appearance. Statements that control procedures —
WAIT, WAIT AT, GO, GO TO, RETURN and RETURN ALL — appear in macros but
control only the active procedure, not the macro itself. As a result, execution of a macro
with a WAIT statement causes the suspension of the active procedure.

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:

INSERT MACROS Macro_Name = macro-name, &


Filename = file-name

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 8. Macros
Rev 0 – 11/94

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.

Here macro-name-list lists the macros to define.

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.

Determining Macro Status


Users may access information on defined macros with the SHOW DEFINED MACROS
statement. This statement generates a list of currently defined macros in the message log.

8-3

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


8. Macros OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

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

The macro invocation is:

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 9. Commands
Rev 0 – 11/94

9. Commands

The OASIS-CC teleoperations package allows users to control external elements —


spacecraft, science instruments and test equipment. To exercise this control, users send
external elements instructions using commands. Two problems generally arise with
commands in space systems. One, the commands are often encoded in a binary format
understood by electronic systems but not people. Two, the command formats differ greatly
between external elements. To compensate, CSTOL provides a natural, English-like way
of command expression with a consistent syntax for all external elements. When a user
enters a CSTOL command statement, the following occurs:

1. The Control Language Processor checks the command statement syntax;

2. A parsed version of the command statement is passed to the command processing


software within OASIS-CC. This software translates the statement into a command
format understood by the external element;

3. The command processing software places the translated command into a command
message;

4. The command message is transmitted automatically or upon user request.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


9. Commands OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

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:

RESET OVEN TEMPERATURE

Here TEMPERATURE names the oven attribute affected by the command. CSTOL
provides a set of predefined command directives:

ACTIVATE, ARM, BOOT, CHANGE, CLOSE, DISABLE,


DISARM, DRIVE, DUMP, ENABLE, FIRE, FLYBACK,
FORCE OFF , FORCE ON, GET, HALT, IGNORE,
INITIATE, MOVE, OPEN, PASS, PERFORM, RESET,
SELECT, SET, SLEW, STEP, TEST, TOGGLE, TURN
OFF, TURN ON, USE

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.

Qualifying and Quantifying Commands


Basic commands are imperative, telling an external element to take an action. If the action
requires qualification or quantification, OASIS-CC provides clauses and keywords to
attach to the 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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 9. Commands
Rev 0 – 11/94

SET PUMP SPEED TO 1200. RPM

TURN ON HEATER TO LOW

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:

TEST COMPUTER_1 WITH INTERRUPTS DISABLED

TURN ON TELESCOPE WITH AUTO_FOCUS ENABLED, &


AZIMUTH_DRIVE ON AND ELEVATION_DRIVE ON

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:

WITH AUTO_FOCUS ENABLED, AZIMUTH_DRIVE ON, &


ELEVATION_DRIVE ON

WITH ELEVATION_DRIVE ON AND AZIMUTH_DRIVE ON &


AND AUTO_FOCUS ENABLED

The BY clause can be used to indicate a change by a specified amount. For example:

CHANGE OVEN TEMPERATURE BY 10. C

MOVE MANIPULATOR BY -1.4 CM

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:

BOOT COMPUTER_1 FROM DISK_A

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


9. Commands OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

These keywords specify speed:

• FAST

• MEDIUM

• SLOW

These specify direction:

• BACKWARD

• FORWARD

• UP

• DOWN

• LEFT

• RIGHT

• IN

• OUT

• CW (clockwise)

• CCW (counterclockwise)

The following command moves a manipulator arm left by 1.4 centimeters:

MOVE MANIPULATOR BY 1.4 CM LEFT

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.

Unchecked Bit pattern and ASCII Commands


While CSTOL allows command expression in plain English, sometimes commands are
more directly expressed in a format the external element understands quickly. As a result,
CSTOL allows users to specify bit strings and ASCII strings as commands. These

9-4

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 9. Commands
Rev 0 – 11/94

commands — represented as hexadecimal digits, or strings— may be entered with the


SEND statement and the external element name. For example:

SEND H#103E2501A78 TO INSTRUMENT_A

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:

SEND "This is a test message" TO LISTENER_B

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:

HOLD SLEW INSTRUMENT TO 10.3 DEG &


AT X#011C8 UNTIL /-12:30:05

This statement places the command that corresponds to this CSTOL statement

SLEW INSTRUMENT TO 10.3 DEG

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:

NOW TURN OFF VACUUM_PUMP

9-5

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


9. Commands OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

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:

LOAD INSTRUMENT_A AT X#125E FROM MP_FILE_123A

See the OASIS-CC System Manager's Guide for the proper microprocessor load file
format.

9-6

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

1 0 . Description of CSTOL Statements

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:

• A general statement description;

• The statement syntax;

• A description of each statement component;

• Notes on the proper statement usage.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

3. Expressions entered as replies to ASK statements are limited to 256 characters.


Explicit continuation characters are not available for ASK responses — once the
end of the line is reached, it scrolls to allow typing on the next line.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

2. When execution occurs by an autonomous (non-interactive) Control Language


Processor as a trigger response, automatic equation, or command pre- or post-
check, BEGIN is ignored. The procedure acts like those occurring before BEGIN,
where control cannot be interrupted or altered. Use interactive mode to create such
procedures by omitting BEGIN.

10-3

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

CANCEL
CANCEL deletes the current command message, stopping transmission in the process.
Once sent, command messages cannot be canceled.

Format
CANCEL

10-4

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

CHECKPOINT
CHECKPOINT creates database-format disk images for database tables records.

Format
CHECKPOINT ALL TO name

CHECKPOINT table-name WHERE selection-expression

Arguments
name (): translates to an upper case environment variable ($NAME) that identifies the
directory to which a complete database checkpoint is written.

table-name (identifier): The database table containing the records to checkpoint.

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.

2. The second form (CHECKPOINT table-name WHERE selection-expression) creates


images of the selected table to be made for book-keeping purposes. OASIS-CC does
not care about the status of the table in this form. Care should be taken not to start
OASIS-CC from one of the files created by this form of checkpoint. If, for example,
OASIS-CC was activated with a checkpointed Streams table where the field
10-5

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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).

3. CHECKPOINT in either form is intended as a tool to save database information that


has accumulated during an OASIS-CC run. A similar directive, COMMIT is intended
as a tool to create disk copies of database tables during application development.

10-6

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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]

CLEAR ALL page_type [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:

DISPLAYS Clear data display windows


MESSAGES Clear event message windows
COMMANDS Clear windows that show command messages
REPORTS Clear database report windows

terminal_nickname (identifier): A name identifying a remote terminal to remove the


window from. If unspecified, terminal_nickname defaults to the terminal where the
statement is entered. If specified, the terminal_nickname provides a key into the
Links table, which stores the full host and terminal ID.

Notes
1. See Chapter 9 of the OASIS-CC System Manager's Guide for more information on
remote displays.

10-7

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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 (,)

Character string (text between double quotes(")

Local variable [check-list]

Global variable [check-list]

check-list: VS value_1 : value_2

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

7. Values in a check-list can be valid CSTOL numeric expressions.

10-9

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

Basic Command Syntax


Every command has two components. A command directive specifies an action while an
element name specifies the external element receiving the command. A third component, a
specific attribute of the external element, may appear as needed.

Format
command-directive element-name [attribute-name ]

Arguments
command-directive (identifier): A word or two-word phrase that specifies the action of
the command.

external-element (identifier) The external element that receives the command.

attribute-name (identifier): An optional attribute of the external element. If omitted, the


command specifies no attribute.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

Clauses and Keywords


Basic commands are imperative, telling an external element to take an action. However,
some actions require qualification. OASIS-CC provides certain qualifying clauses,
including TO, WITH, BY and FROM, to attach to commands.

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]

basic-command BY amount [speed-qualifier] [direction-qualifier]

basic-command FROM source [speed-qualifier] [direction-qualifier]

basic-command WITH attribute 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.

direction-qualifier (identifier): A keyword specifying the direction of change. The


choices are BACKWARD, FORWARD, UP, DOWN , LEFT, RIGHT, IN, OUT,
CW (clockwise), and CCW (counterclockwise).
10-11

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

time (clock time constant): The release time for execution.

Notes
1. See the OASIS-CC System Manager's Guide to set up timed commands.

2. An AT or UNTIL clause may appear first.

3. The external element must provide intermediate command storage.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

Notes
1. See the OASIS-CC System Manager's Guide to set up priority commands.

2. Priority commands are transmitted even if the special variable,


$$COMMAND_MODE, is set to NO_ISSUE.

3. Priority commands are not placed in buffered command messages. Instead,


message processing is suspended while the priority command is processed and
sent.

10-13

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

2. See DECOMPILE for removal of CSTOL procedures from the system.

3. Undefined macros within the procedure are defined during compilation.

4. A procedure list with compilation errors is available in CSTOL. See the Procedures
section for further information.

10-15

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

2. In general, if OASIS-CC fails to exit properly, press CONTROL-Y and enter a


STOP directive at the DCL prompt. Issue CONTROL-C for Unix.

10-16

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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 INPUT declaration supplies additional information about an input parameter,


its data type established by the default value. The argument value passed to the
procedure must have the same data type. The actual value of an input variable is the
value of this argument.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

2. To assure execution, DECLARE appears before the BEGIN statement. Otherwise,


a necessary variable or constant may not be declared before its reference in another
statement, causing the procedure to halt with an error.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

DECOMPILE
DECOMPILE removes compiled procedures from the CLP list. This statement has two
advantages:

• To remove a changed procedure, creating room for a new version. START


statements always use precompiled versions. To enter a new version into the CLP,
recompile the procedure using the COMPILE statement or DECOMPILE so the next
START statement may recompile the new version.

• To free up memory space holding the procedure object code. If compiled


procedures are no longer needed, these procedures may be decompiled to free
virtual memory space.

Format
DECOMPILE procedure-list

DECOMPILE ALL PROCEDURES

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

selection-criteria (expression): A relational expression in the form field-name = value


[AND field-name = value...], where field-name is the name of a field contained in
the database table and value is a constant that field is compared to. Only records
where the entire expression evaluates to TRUE — where every named field has the
specified value — are 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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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]

DISPLAY page-name [TO remote-terminal-nickname]

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.

remote-terminal-nickname (identifier): An name identifying a record in the Links table


that contains an Internet address and terminal identifier for the host system for
which the remote display is intended. Only TAE+ displays and OASIS-CC
message windows can be displayed remotely. For example, if the TAE+ panel
named master was desired on a workstation with the given nickname monitor_3,
the display statement would be:

display master to monitor_3

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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;

• The expression in the particular ELSE IF evaluates TRUE.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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:

Procedures PROC and END PROC


Macros MACRO and END MACRO
Loops LOOP and END LOOP
IF Blocks IF and END IF

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

2. ESCAPE is most useful when used with an IF statement to determine whether


conditions warrant breaking the loop.

10-28

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

2. FLUSH ALL is identical to FLUSH command-group-name, except that all


commands are removed and all failed command counters are reset to zero.

3. FLUSH in either form generates messages indicating which commands were


removed, and which counters were reset. The format of these messages follows
the format of messages generated by the SHOW PENDING CEV statement.

10-29

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

3. The blank between GO and TO is optional.

4. If a procedure is in WAIT when GO TO is issued, the procedure is repositioned to


the specified line, remaining in WAIT until GO is entered or WAIT conditions are
met.

10-31

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

2. GO TO statement may be used to enter or exit an IF-block, although such actions


may yield unpredictable results.

3. See Chapter 6 for more information on IF-blocks.

10-32

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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:

• An integer or real number;

• A state or other literal;

• A text string.

The value and field types must agree.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

expression (arithmetic or logical expression): The expression to evaluate.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

Other combinations result in an error.

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.

$$LOOP_COUNT contains the current number of loop iterations, incrementing


with each time loop. The $$LOOP_COUNT special variable is undefined beyond
its loop. If occurring within an expression beyond the loop, an error occurs.

10-36

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

location (integer constant): The address where the load is inserted.

file-name (long identifier): The file holding data to send.

Notes
1. This application dependent statement mainly sends microprocessor loads.

2. The AT location phrase may be ignored for some applications.

3. The file must be located in the logical directory OASIS_LOAD.

4. The filename extension is .LOAD.

5. The file has a specific format described in the System Manager's Guide.

10-37

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

MACRO
MACRO marks the beginning of a CSTOL macro.

Format
MACRO macro-name [macro-parameters]

Arguments
macro-name (identifier): The name of the macro.

macro-parameters (): Consists of parameter specifiers $1 ... $9 separated by spaces.


Parameter specifiers must appear in ascending numeric order starting from $1.
When the macro expands, text associated with the macro invocation is substituted
for the parameter.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

MAKE
MAKE sets bus devices or instruments to a defined state.

Format
MAKE DEVICE/INSTRUMENT device-name-list BE/DO state

MAKE ALL DEVICES ON stream-name-list BE global-state

Arguments
device-name-list (identifier): The affected IEEE-488 devices.

state (identifier): The communications class for devices — REMOTE, LOCAL_LOCK,


RESET, LOCAL, or TRIGGER

global-state (identifier): The communications class for devices — REMOTE,


LOCAL_LOCK, RESET, or LOCAL

stream-name-list (identifier): The streams containing affected devices.

Notes
1. The devices specified in MAKE may not reside on the same IEEE bus.

2. The word INSTRUMENT is interchangeable with DEVICE while BE interchange


with DO to allow for improved readability.

10-41

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

release-time (clock time constant): The release time for execution.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

POLL
This statement instructs OASIS-CC to get the status byte of IEEE-488 devices.

Format
POLL DEVICE device-name-list

POLL BUS stream-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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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:

.stream_name The data stream itself


.stream_name_HEADER The title

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:

.stream_name_DATA The bridge stream itself


.stream_name_HEADER The title
.stream_name_IDENTA description of the data file

3. Message files are placed in OASIS_MSG_LOGGING. The filenames for message


logs follow the same conventions as data and bridge streams. A message log has
two files with the same name but different extensions:

10-45

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

.EVENT_MESSAGES The message log itself


.EVENT_MESSAGES_HEADER The title

4. For compatibility with previous OASIS-CC versions, the formats RECORD ON


record-mode [title], RECORD OFF record-mode, and RECORD OFF ALL are
syntactically correct.

10-46

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

field-list (long identifier): A list of fields to report.

selection-expression (relational expression): A conditional expression where each


subexpression has the format field-name = value where field-name is a record field
and value is a constant the field is compared against. Multiple subexpressions are
connected by the logical connective AND. Only records where all named fields
have the specified value are reported.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

file-name (long identifier): The file containing the data to retrieve.

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.

3. For compatibility with previous OASIS-CC versions, the formats RETRIEVE ON


data-stream, RETRIEVE OFF data-stream, and RETRIEVE OFF ALL are
syntactically correct.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

CC System Manager's Guide for details on how to generate disk copies of


decomposition trees.

10-50

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

RETRY
RETRY sends a command message or a single command again, working only if the
message is previously transmitted.

Format
RETRY

10-51

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

ROUTE
ROUTE sends part of a return stream to a forward stream or to a Sub-CLP.

Format
ROUTE secondary-stream TO forward-stream

ROUTE secondary-stream TO Sub-CLP ID

Arguments
secondary-stream (identifier): The secondary data stream from the Streams table.

forward-stream (identifier): The forward data stream.

Sub-CLP ID (identifier): Legal values are clp_1, clp_2...clp_20.

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.

3. Routing may be implicitly stopped by OASIS-CC. Consider these events:

SWITCH ON return_a
SWITCH ON forward_a
ROUTE part_of_return_a TO forward_a
SWITCH OFF forward_a
SWITCH ON forward_a

The SWITCH OFF forward_a causes an implicit STOP ROUTING


part_of_return_a TO forward_a. No routing occurs when forward_a is switched
on again.

10-53

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

4. If a parameter is either DN or INTEGER, the ASCII image of the integer value is


passed to the utility program. The "DN" specifier associated with DN types is
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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

7. If a parameter is a clock time, the ASCII image of the time is passed to the utility
program.

8. The effective maximum number of parameters is 23. The effective maximum is


defined as the number of spaces contained in the translated parameter list, plus one.
For example, if the parameter list is:
"This 'Is a' new TEST",$real
where $real is 15.0, the effective parameter list passed to the program is:
This "IS a" new TEST 1.5000000000e+1
which has 6 effective parameters. The maximum length of an effective parameter
list is 256 characters (including the name of program to be started), and an
individual string parameter cannot exceed 128 characters.

10-55

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

sample-rate (delta-time constant): The rate of sampling.

Notes
1. Different IEEE buses may contain the devices.

2. If the sample rate is not supplied, devices are sampled once.

10-56

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

SEND bit-pattern-command TO external-element-name

SEND quoted-character-string TO external-element-name

SEND local-variable-name TO external-element-name

SEND global-variable-name TO external-element-name

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

local-variable-name : The name of a local variable containing a character string

global-variable-name: The name of a global variable (i.e. an External_Element and


Item_Name in the Latest_Data table) containing a character string/

external-element-name (identifier): The external element receiving the command.

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.

3. Strings sent by the SEND string TO external-element-name can be fixed or variable


length. See Chapter 5 of the OASIS-CC System Manager's Guide.

10-57

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

SHOW
SHOW displays certain CLP and command information.

Format
SHOW attribute item

Arguments
attribute (identifier): Qualifies the information type to show.

item (identifier): Identifies the information type to show.

At present, SHOW may be followed by any of these pairs of attribute-item combinations.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

SNAP
SNAP saves the current contents of the named display page.

Format
SNAP page-name

SNAP page-name RESOURCE

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.

2. SNAP page-name RESOURCE saves a graphical image of the page in TAE+


resource file format. The Action Workbench (awb) can then be used to display the
snapped file offline. This form of SNAP only works when the page is already
displayed. It creates a file named fyy_mon_dd_hh_mm_ss.page-name.res in the
$OASIS_SNAP directory.

3. SNAP page-name RESOURCE corrensponds to the directive SNAP page-name in


releases prior to v020512.

10-59

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

STOP POLLING BUS


STOP POLLING BUS instructs OASIS-CC to terminate the automatic polling of IEEE-488
streams initiated with the POLL BUS statement.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

STOP RECORDING ALL

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

STOP RETRIEVING
STOP RETRIEVING terminates data retrieval from disk.

Format
STOP RETRIEVING data-stream

STOP RETRIEVING ALL

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.

2. For compatibility with earlier OASIS-CC versions, RETRIEVE OFF data-stream,


and RETRIEVE OFF ALL are syntactically correct.

10-63

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

STOP ROUTING secondary-stream TO Sub-CLP ID

Arguments
secondary-stream (identifier): The secondary data stream from the Streams table.

forward-stream (identifier): The forward data stream.

Sub-CLP ID (identifier): Legal values are clp_1, clp_2...clp_20.

Notes
1. STOP ROUTING secondary-stream terminates all routing of that stream (secondary
streams may be routed to many forward streams).

2. Routing may be implicitly stopped by OASIS-CC. Consider these events:

SWITCH ON return_a
SWITCH ON forward_a
ROUTE part_of_return_a TO forward_a
SWITCH OFF forward_a
SWITCH ON forward_a

The SWITCH OFF forward_a causes an implicit STOP ROUTING


part_of_return_a TO forward_a. No routing occurs when forward_a is switched
on again.

10-64

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

STOP SAMPLING
STOP SAMPLING stops sampling of a device or stream associated with the IEEE bus.

Format
STOP SAMPLING device-name-list

STOP SAMPLING ON stream-name-list

Arguments
device-name-list (identifier): The devices sampling is stopped for, separated by
commas.

stream-name-list (identifier): The streams sampling is stopped for, separated by


commas.

Notes
1. Devices do not have to appear on the same bus, streams do.

10-65

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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]

SWITCH OFF data-stream

SWITCH OFF ALL

Arguments
data-stream (identifier): The data stream to activate or deactivate.

data-line (identifier): The logical name of the communications device.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

SWITCH RECORDING MESSAGES

SWITCH RECORDING OF ALL

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.

2. SWITCH RECORDING MESSAGES forces the closing and reopening without


message loss of the event message log file.

3. SWITCH RECORDING OF ALL forces the closing and reopening without


message or data loss of all opened record files.

4. An error will result if SWITCH RECORDING is specified for a file that is not
currently open.

10-67

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

UNDEFINE
UNDEFINE undefines CSTOL macros.

Format
UNDEFINE macro-list

UNDEFINE ALL MACROS

Arguments
macro-list (identifier): A list containing the macros to undefine.

10-68

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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.

selection-expression (): A relational expression with subexpressions of the format field-


name = value where field-name is a field and value is a constant value the field is
compared against. Multiple subexpressions are connected by the logical connective
AND. Records where every named field has the specified value are candidates for
updating.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

WAIT
WAIT suspends a procedure. These suspension types may occur with WAIT:

• Indefinite suspends the procedure until a GO statement is entered from the


keyboard.

• Temporary suspends the procedure for a specified length or clock time.

• Conditional suspends the procedure until certain conditions are met.

• 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

WAIT conditional-expression [OR FOR delta time| OR UNTIL 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

conditional-expression (conditional expression): An expression that determines the


condition to terminate a conditional wait.

Notes
1. If no expression is given, the procedure is placed in an indefinite wait. To resume
execution, issue GO from the keyboard.

2. To avoid deadlocks, an indefinite wait statement in a procedure executing within an


automatic CLP causes the procedure to terminate as if RETURN ALL is
encountered.

10-71

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

3. If an conditional expression appears in WAIT, the expression must produce a


logical result (TRUE or FALSE) Other results cause an error.

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.

5 If the specified clock time is in the past, no wait occurs.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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

WAIT FOR ALL

WAIT FOR LAST

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.

2. WAIT FOR command-group-name issues an error and indefinitely blocks a


procedure if, once the pending CEV queue is empty of command-group-name
commands, the number of command-group-name commands that have failed CEV
is greater than 0.

3. WAIT FOR command-group-name resets the count of failed command-group-name


commands to zero once the CEV queue is emptied of command-group-name
commands.

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.

5. WAIT FOR LAST acts identically to WAIT FOR command-group-name, except


that the LAST command transmitted in the pending CEV queue is considered. The
LAST command is defined as the last one sent on the CLP from which the WAIT
FOR LAST was issued.

6. Command-group-names cannot be named ALL or LAST.

10-74

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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 string constant like "Starting power-up process" results in the


output of that text;

• Specifying a global, local or special variable results in the output of that value.

2. Users can direct WRITE output to customized message windows by supplying


custom message ID codes. If the first character of a string supplied in a WRITE is
an asterisk ("@"), the next 32 characters (or up to the first space character) are
interpreted as message identification codes. The event message is duplicated for
each of the message ID codes, in addition to the regular LIxx code. Chapter 8 of
the OASIS-CC System Managers Guide describes message ID codes and how to
create custom message windows.

• 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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual 10. Description of CSTOL Statements
Rev 1 – 11/94

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.

3. The current version of CSTOL has no output format control.

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


10. Description of CSTOL Statements OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

This page is intentionally blank.

10-78

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Appendix A. Control Language Processors
Rev 0 – 11/94

Appendix A. Control Language


Processors

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Appendix A. Control Language Processors OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

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.

Automatic and User CLP Differences


Automatic CLPs execute most CSTOL statements. Because automatic CLPs perform their
duties without human oversight or intervention, however, CSTOL statements requiring
user interaction are not allowed within these CLPs. User and automatic CLPs have these
differences:

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Appendix A. Control Language Processors
Rev 0 – 11/94

4. Procedures in automatic CLPs may not enter an indefinite wait state. These
procedures are terminated if the procedure encounters:

• An unconditional WAIT statement;

• An ASK statement;

• Any run-time error.

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.

User Control of the Sub-CLPs


To start proc_xyz on sub-CLP number 3, the operator enters:

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Appendix A. Control Language Processors OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

the user-CLP (by prefacing the user-CLP directive with a sub-CLP number) is limited to
the following set:

GO, GO TO, WAIT, RETURN, SHOW, DEFINE, UNDEFINE, COMPILE,


DECOMPILE, START and CLEAR.

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Appendix B. Operator-Operand Compatibility
Rev 0 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Appendix B. Operator-Operand Compatibility OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Appendix B. Operator-Operand Compatibility
Rev 0 – 11/94

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Appendix B. Operator-Operand Compatibility OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

(and), (not), (or), (xor)


Integer Real Clock Delta State Text Dn Eu
Integer Integer
Real
Clock
Delta
State
Text
Dn
Eu

Equals (=), Not Equals (/=)


Integer Real Clock Delta State Text Dn Eu
Integer Boolean Boolean
Real Boolean Boolean
Clock Boolean
Delta Boolean
State Boolean
Text Boolean
Dn Boolean
Eu Boolean

Greater than (>), Greater than or Equal (>=)


Less than (<), Less than or Equal (<=)
Integer Real Clock Delta State Text Dn Eu
Integer Boolean Boolean
Real Boolean Boolean
Clock Boolean
Delta Boolean
State
Text
Dn Boolean
Eu Boolean

B-4

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Appendix B. Operator-Operand Compatibility
Rev 0 – 11/94

Negation (-)
Integer Real Clock Delta State Text Dn Eu
Integer Integer
Real Real
Clock
Delta Delta
State
Text
Dn Dn
Eu Eu

B-5

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Appendix B. Operator-Operand Compatibility OASIS-CC CSTOL Reference Manual
Rev 0 – 11/94

This page is intentionally blank.

B-6

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Appendix C. Adding Command Verbs to the Parser
Rev 1 – 11/94

Appendix C. Adding Command Verbs


to the Parser

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.

Table C.1 OASIS-CC Command Verbs

ACTIVATE ARM BOOT CHANGE


CLOSE DISABLE DISARM DRIVE
DUMP ENABLE FIRE FLYBACK
FORCE OFF FORCE ON GET HALT
IGNORE INITIATE MOVE OPEN
PASS PERFORM RESET SELECT
SET SLEW STEP TEST
TOGGLE TURN OFF TURN ON USE

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.

2) Find the comment "THIS PORTION OF PARSER.DAT FILE CAN BE


MODIFIED"
; 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

C-1

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Appendix C. Adding Command Verbs to the Parser OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

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
TRAN !PERFORM ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN !SLEW ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND

; END OF THE PORTION OF PARSER.DAT THAT CAN BE MODIFIED TO ADD OR REMOVE


; CMD VERBS

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

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics


OASIS-CC CSTOL Reference Manual Appendix C. Adding Command Verbs to the Parser
Rev 1 – 11/94

TRAN !PERFORM ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND


TRAN !SLEW ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
; Additional sub language verbs added 10/93 per crn 330
TRAN 'ARM' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'DISARM' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'FIRE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'INITIATE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'ACTIVATE' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND
TRAN 'GET' ,NORMAL_CMD_STATE,EXTENDED_DIRECTIVE_TOKEN,COMMAND

; END OF THE PORTION OF PARSER.DAT THAT CAN BE MODIFIED TO ADD OR REMOVE


; CMD VERBS

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

Laboratory for Atmospheric and Space Physics University of Colorado at Boulder


Appendix C. Adding Command Verbs to the Parser OASIS-CC CSTOL Reference Manual
Rev 1 – 11/94

This page is intentionally blank.

C-4

University of Colorado at Boulder Laboratory for Atmospheric and Space Physics

You might also like