$Revision: 1.8 $
$Date: 2001/03/04 16:22:35 $
The IEGSE STOL implementation is based on the description of CSTOL given in OASIS-CC CSTOL Reference Manual (v02.05.12). This document attempts to mirror the structure of the OASIS-CC CSTOL reference to minimise any possible confusion.
The major differences between the IEGSE STOL and CSTOL are associated with the commanding of both the instrument under test and the internal IEGSE functions. OASIS-CC took the approach of using parsed English language like commands. The IEGSE implementation takes the simpler method of using command nmemonics which take a fixed number of parameters.
The major omissions from the IEGSE STOL implementation are the statements associated with management of the OASIS-CC databases. The approach taken in the IEGSE is somewhat simpler since it was not designed to scale to much larger systems. Also missing are CSTOL statements which control displays. The IEGSE uses separate components to provide similar functionality.
The CSTOL macro system has been included in the IEGSE implementation, but it's use is deprecated and not documented here.
The aim of the IEGSE STOL implementation has been to keep as strictly as possible to the CSTOL specification, except in clearly identified areas. Extensions are explicitly noted in this document.
The STOL system provides the only interface to command the HIRDLS instrument. All command and microprocessor must be sent via the STOL. The STOL system consists of three components :
The CSTOL language has the following basic properties :
There are effectively eight different data types defined by CSTOL. The following sections describe them.
The CSTOL integer type is a signed 32-bit entity, i.e. has a valid range of -2147483647 to 21474836476. Integer constants can be expressed in a non-decimal radix as shown in the table.
| Radix | Prefix | Example(s) |
|---|---|---|
| Decimal | D# or none | 156 -67 D#156 |
| Binary | B# | B#10011100 |
| Octal | O# | O#234 |
| Hexadecimal | X# | X#9C |
Floating point numbers are stored internally has 64-bit entities. However the floating point representation of any imported data (e.g. after conversion to engineering units) is limited to single precision values (32-bit) i.e approximately -1.0e+38 to 1.0e+38. A real constant can be expressed using exponentiation. Examples are :
1.673 -9908.06 4.5e9
Text constants are expressed as a string of characters enclosed within
double quote (") marks. The value of string is the
only part of CSTOL with is case-sensitive. The enclosed text may contain spaces. Examples are :
"ABC" "table.1" "Solution is : "
These are used to specify date and time of day. This format is also referred within the IEGSE documentation as a datestring. The format is
year/day_of_year-hour:min:sec
The year and/or day_of_year may be omitted. In this case the current year and current day of the year are used. Examples :
1999/104-20:00:00 /-10:0:0 ; 10 am today 1999/102-6:32:8.9 ; fractional seconds allowed
IEGSE implementation notes:
/-:: is used to identify the current time. This will not work in CSTOL, use
the CSTOL special variable $$current_time instead (see section 3).
Delta times specify time intervals. The format is
hour:min:sec
Either or both of hour and min may be omitted. Negative delta times are allowed. Examples
0:10:0 ; 10 minutes -1:0:0 ; one hour before ::1.25 ; 1.25 seconds
A state constant is represented by a string of characters not enclosed
in double quote marks ("). Data items in the IEGSE input_data databases can have a value
represented as a state and this data type can be used in CSTOL to test the
current state. Examples
OFF YELLOW_LOW
IEGSE implementation note: There is a potential ambiguity between state values and names of data items in the IEGSE input_data databases. The IEGSE STOL compiler always checks an unenclosed string against the input_data database names before assuming it is a state value.
This type is used represent raw integer data values imported or acquired into the system. There value range is the same as for integers (see above). Hence the raw value associated with a IEGSE input_data database has this type. A data number constant is distinguished from a integer by adding the suffix DN (can be separated by space from value). Examples :
5 DN 5DN
This type consists of a real value and a alpha_numeric string of characters which define the units in which the value is measured. This type is used for the engineering units values of items in the IEGSE input_data databases. Examples
9.1 A ; 9.1 amps 2.0 V ; 2 volts -2.V ; -2 volts
IEGSE implementation note:
[stol]:units_file.
9A will fail.
The IEGSE version of CSTOL has implemented an unsigned 32-bit entity, i.e. has a valid range of 0 to 4294967295. Unsigned integer constants are differentiated from signed integer constants by placing a 'U' in front the radix identifier. The following table shows examples/
| Radix | Prefix | Example(s) |
|---|---|---|
| Decimal | UD# | UD#156 |
| Binary | UB# | UB#10011100 |
| Octal | UO# | UO#234 |
| Hexadecimal | UX# | UX#9C |
The IEGSE software gathers items from the data streams and places their current/last recorded value in the input_data databases. The name of a input_data database item can be used as a IEGSE STOL global variable.
The type taken by a global variable is either data number (raw), state or
engineering unit. Some data items value can be represented by more than one type. The type used by default by STOL is given by the database entry for the item. If a valid engineering or state conversion exists for the item that becomes the type of the STOL global variable, otherwise the variable is considered to be a data number. IEGSE STOL extension directiveiegse_force_raw can be used to solve some problems associated with this.
Global variable names have the following properties
_)
Some typical uses are shown below
write SVA_STATUS ; prints value of SVA_STATUS let $i = SCCMDS_RCVCT ; assigns current value of SCCMDS_RCVCT to a local variable
STOL local variables are used within procedures. Their type is ascertained from the value given in STOL declarestatement used to create them. Local variables are used as working data storage within the procedure and as containers for arguments passed to the procedure (declare reference page for details). Local variable names have the following properties
$)
_)
Special variables are denoted by having names which begin with two dollar signs ($$).
The following table lists the special variables defined by IEGSE STOL.
| Name | Type | Readonly | Description |
|---|---|---|---|
| $$current_time | clock time | yes | Contains the current time. |
| $$loop_count | integer time | yes | Only defined whilst procedure is in loop construction. Contains a count of the number of times the loop has been completed. |
| $$step_interval | delta time | no | If $$step_mode is set to PAUSE, this variable determines thelength of the pause. Set on a per procedure basis. Default is 0:0:1 (1 second).
|
| $$step_mode | state | no | Controls how the statements in a procedure are executed. Set on a per procedure basis. Valid state values are
|
Like most procedural based programming languages CSTOL consists of statements which control execution flow, allow expressions to be evaluated etc. These statements are described in detail with examples in the reference section. The following subsections give a brief overview.
Labels are composed of letters, digits and the underscore character, _. They must start with a letter and end with a colon, :. They
can be used to identify points in the procedure and to be the target of GOTO statements.
OASIS CSTOL imposes a limit of 80 characters per line. Statements longer than this
require the use of the ampersand (&) character to continue the statement on the next line. In the IEGSE STOL implementation the 80 character
limit is not imposed.
Comments lines are denoted by the semi-colon character (;). All text after a ";" up to the next newline is ignored by the parser.
These statements are not part of the OASIS-CC defined CSTOL.
CSTOL expressions are constructed in a form which will be familiar to anyone who has experience of almost any procedural programming language, e.g. Fortran, Pascal, Basic.
| Operator | Description |
|---|---|
| + | Addition (NOTE: can also be used to concatenate strings) |
| - | Subtraction |
| * | Multiplication |
| / | Division |
| ** | Exponentiation (raise to power) |
| mod | Modulo (remainder after integer divison) |
| Operator | Description |
|---|---|
| = | Equals |
| /= | Not Equal |
| > | Greater Than |
| >= | Greater Than or Equal To |
| < | Less Than |
| <= | Less Than or Equal To |
These operators are applied to expressions and can also be applied to integer operands to perform bit-wise manipulations.
| Operator | Description |
|---|---|
| not | logical not |
| and | logical and |
| or | logical or |
| xor | logical exclusive or |
| Function | Return Type | Argument Type | Description |
|---|---|---|---|
| ACOS | Engineering units (RAD) | Real | Arccosine |
| ASIN | Engineering units (RAD) | Real | Arcsine |
| ATAN | Engineering units (RAD) | Real | Arctangent |
| COS | Real | Engineering units (RAD or DEG) | Cosine |
| COSH | Real | Engineering units (RAD) | Hyberbolic Cosine |
| EXP | Real | Real | Natural exponential (e raised to the power of the argument) |
| LOG | Real | Real | Logarithm to base e |
| LOG2 | Real | Real | Logarithm base 2 |
| LOG10 | Real | Real | Logarithm base 10 |
| SIN | Real | Engineering units (RAD or DEG) | Sine |
| SINH | Real | Engineering units (RAD) | Hyperbolic Sine |
| SQRT | Real | Real | Square Root |
| TAN | Real | Engineering units (RAD or DEG) | Tangent |
| TANH | Real | Engineering units (RAD) | Hyperbolic Tangent |
The order of evaluation of expressions is as follows
The major difference between OASIS-CC CSTOL and IEGSE STOL concerns the sending of commands. All of this section refers only to the IEGSE STOL implementation. IEGSE users should not expect anything in the CSTOL reference manual to be applicable in this area.
Commands are grouped into three categories, there is an IEGSE database for each category. Each command has a unique nmemonic which identifies the record where the command properties are specified.
| Command Category | Nmemonic prefix | Command Parameter Restrictions | Restricted Command Classes |
|---|---|---|---|
| HIRDLS instrument | HIR | Unsigned integer only | CRITICAL |
| Internal IEGSE subsystems | GSE | None | CRITICAL OPERATOR_ONLY |
| External test equipment | TEQ | None | CRITICAL OPERATOR_ONLY |
The database defines command properties on per category basis. By default
all commands can be sent from either the operator window or from within
procedures except where specified to be class OPERATOR_ONLY.
All class CRITICAL commands require a confirmation to be given via the
operator window before the comamnd is dispatched.
All categories of commands are sent using the following statement format. The
statement identifier is the "at" (@) character.
Some HIRDLS commands have arguments which cannot be expressed as 32 bit integer values formatted into strings of digits, e.g. memory loads. To send these commands an upload file has to be prepared using the uplink_p utility. The file can then be sent to the instrument using the LOAD statement.
The whole of this section should be considered to be an IEGSE implementation note.
The STOL operator task runs in it's own X window on the IEGSE central node console. The window is always visible (non-minimisable and "sticky"). It's realisation is shown below.

The user types directives at the CSTOL prompt. The task
supports a subset of EMACS style command-line editing and command history manipulation provided by the GNU readline library. On start up the operator task loads the command history saved in the
file identified by the [stol]:operator_hsty file. This file
contains the last 100 commands entered prior to the operator task being killed.
A few of the most useful character sequences are listed here.
ESC d : Delete word.
CTRL-A : Start of current input.
CTRL-E : End of current input.
CTRL-U : Delete current input.
DEL : Delete last character
The following are the list of directives which may be executed from by the STOL operator. There are reference pages for each directive and some of them are described in the procedures section below.
As briefly described in the introduction procedures are sequences of STOL instructions which are stored as a text file and hence can be executed in a repeatable manner. Therefore they are key component when developing a structured and controlled instrument test platform.
A CSTOL procedure has the following structure.
PROC proc_name [ parameter_list ]
; Declaration section start
; Declaration section end
BEGIN
; Executable statements start
; End of procedure
END PROC
The procedure name proc_name must start with a character and
be less than 14 characters long. The procedure name can contain letters, digits and the underscore character.
If the procedure takes any parameters they must be listed in the order
in which they are expected in var>parameter_list.
IEGSE implementation note:
The name of the file containing the procedure must be of the form
name.pro, where name is proc_namewith letter characters converted to lowercase.
All local variables and input parameters must contain an entry in this section. See the DECLARE reference page for full details.
The BEGIN statement identifies the boundary between the declaration section and the executable section. The statements in this section are executed until either a RETURN statement or the END PROC is reached.
The procedure must be compiled into an interpretable object format before it can be executed. This process allows syntax and other error checks to be performed on the procedure before it is run. The STOL directive COMPILE is provided for this purpose.
IEGSE implementation note:
Procedure source files can be stored in a number of different path locations in the
IEGSE central node filesystem. The search order is given by the configuration parameter
[stol]:srcdir. If a file name name.pro
is not found in a directory specified by [stol]:srcdir the
users own directory $HOME/stol is then searched.
Procedures are started using the START directive.
IEGSE implementation notes:
[stol]:objdir. If a file name name.obj
is not found in a directory specified by [stol]:objdir, the
search for the file continues in directories given by [stol]:srcdir and then finally in
the users own directory $HOME/stol.
The whole of this section should be considered to be an IEGSE implementation note. Each procedure is a standalone POSIX (Unix) process. It runs within it's xterm window on the IEGSE central node console. The realisation on the screen is shown below. The window is non-minimisable, cannot be resized and does not have a scrollbar.

The procedure window is split into three areas.
CONSOLE means started directly by operator.
1 shows that this procedure is head of chain, i.e. started directly by operator.
When the procedure exits, either by reaching a RETURN or an END PROC statement, receiving a RETURN from the operator or exiting due to error, the procedure indicates this by changing the window title and foreground and background colours as shown below.

When the procedure has exited or is in an wait state it is possible to use scroll through either the procedure code or the I/O windows by using the following instructions :
CTRL-Z. An asterisk (*) character should
appear in the top left corner of the window on the information line.
o and p keys can be used to change between the
I/O and procedure code sections respectively.
CTRL-Z returns the window and the cursors to
their original states.
The procedure window can be removed once the procedure is in the
EXITED state by following the instructions below.
CTRL-C. The window will now disappear.
All procedure windows are removed automatically when the IEGSE software is stopped using the iegse_stop utility.
The following table describes the allowed procedure execution states. The execution state is displayed in the top right corner of the procedure window.
| Execution State | Description |
|---|---|
| ASK | Procedure is awaiting input in response to a STOL ASK statement. |
| EXITED | Procedure has completed execution. |
| LOADING | Procedure is loading object code and initialising internal structures. |
| RUNNING | Procedure executing instructions. |
| WAIT_COMM | Procedure is awaiting confirmation to send a critical command. Requires a GO command from the operator to continue execution. |
| WAIT_COND | Procedure is waiting for a condition to become TRUE before continuing. |
| WAIT_OPER | Procedure is in unconditional wait. Requires operator to send GO to continue execution. |
| WAIT_TIME | Procedure is in a timed wait. |
This is now a separate page : IEGSE STOL Reference Guide. The index of statements gives direct links to the appropriate section of the reference guide.
Return to IEGSE Home
Modified --> $Revision: 1.8 $ $Date: 2001/03/04 16:22:35 $
HIRDLS IEGSE Support