OASIS-CC Quick Reference Manual - Laboratory For Atmospheric ...
OASIS-CC Quick Reference Manual - Laboratory For Atmospheric ...
OASIS-CC Quick Reference Manual - Laboratory For Atmospheric ...
Permission is granted to make and distribute verbatim copies of this manual provided that the
copyright notice and these paragraphs are preserved on all copies. The software and any
accompanying written materials are provided “as is” without warranty of any kind. The University
of Colorado disclaims all warranties of any kind, either expressed or implied, including but not
limited to implied warranties of merchantability and fitness for a particular purpose.
Mention of any commercial company or product in this document does not constitute an
endorsement by the University of Colorado.
Table of Contents
Introduction....................................................................................... 1-1
Creating Telemetry Items........................................................................ 2-1
Items Representing Numeric (Analog) Values ........................................... 2-1
Example Raw Integer Requiring Calibration to EU............................... 2-1
Example Raw Integer Requiring Multi-Segmented Calibration to EU.......... 2-1
Example Raw Integer - no Calibration Desired.................................... 2-2
Example Pre-Calibrated Real........................................................ 2-2
Items Representing STATES............................................................... 2-2
Example Raw Integers Converted to STATES.................................... 2-2
Example STATES Converted to Raw Integers.................................... 2-3
Items reflecting STRING data.............................................................. 2-3
Example Character Strings........................................................... 2-3
Defining LIMIT Checking....................................................................... 3-1
Setting Primary HILO Thresholds......................................................... 3-1
Example HILO Limits................................................................ 3-1
Setting Secondary HILO Thresholds...................................................... 3-2
Example Secondary HILO Limits................................................... 3-2
Setting Delta Thresholds.................................................................... 3-2
Example Delta Limits................................................................. 3-2
Setting Trend Time Limits.................................................................. 3-2
Example Trend Limits................................................................ 3-3
Defining STATE Checking...................................................................... 4-1
Setting Desirability........................................................................... 4-1
Example Setting Desirability......................................................... 4-1
Defining TRIGGERS............................................................................ 5-1
Example Creating a TRIGGER ..................................................... 5-1
Defining EQUATIONS.......................................................................... 6-1
Example Creating an Equation ...................................................... 6-1
Defining Commands............................................................................. 7-1
Designing the CSTOL Command Statements ............................................ 7-1
Command Verbs and Objects.......................................................... 7-1
Attributes ............................................................................... 7-2
i
ii
List of Figures
List of Tables
iii
iv
1. Introduction
The OASIS-CC Quick Reference Manual provides quick access to information application
managers frequently require. It also presents features not covered in other OASIS-CC
documents. If the information you seek is not present, consult the other OASIS-CC
documents. Consider sending your suggestions for additional topics to include.
Many examples are presented, showing how to fill the database tables to achieve desired
functions. In all cases, database information is presented in the form of CSTOL query
insert and update directives.
TAE+ User Interface Developer's Guide: Century Computing, Inc., Laurel, MD.
1-1
1-2
2-1
2-2
insert STATE_CONVERSIONS,&
external_element=HIGH_VOLTAGE, item_name=STATUS,&
dn_low=0, dn_high=0, state=OFF, desirability=GOOD
insert STATE_CONVERSIONS,&
external_element=HIGH_VOLTAGE, item_name=STATUS,&
dn_low=1, dn_high=0, state=ON, desirability=GOOD
insert STATE_CONVERSIONS,&
external_element=HIGH_VOLTAGE, item_name=STATUS,&
dn_low=2, dn_high=0, state=UNKNOWN, desirability=GOOD
DN_HIGH must be supplied in an insert since it is a field which makes up the record's
key, however the field is not currently used by OASIS-CC.
2-3
2-4
LIMIT checking provides high/low and delta comparisons for numeric items. High/low
(HILO) checking compares a telemetry point's current value to pre-established thresholds.
Delta checking determines how much a current value changed from its last value, and
compares the difference to a pre-established limit.
3-1
3-2
3-3
3-4
STATE checking reports if a discrete item has changed its value, or the desirability of the
value has changed, or both.
Setting Desirability
All of the integer values that a state item can take must have a translation to a literal value
like ON or OFF or OPEN or CLOSED. Each translation must have a desirability of either
GOOD or BAD.
update STATE_CONVERSIONS,&
desirability=BAD where external_element=HIGH_VOLTAGE &
and item_name=STATUS and state=ON
update LATEST_DATA &
state_check_class=BOTH where &
external_element=HIGH_VOLTAGE, item_name=STATUS &
data_class=STATE
Setting state_check_class=BOTH enables OASIS-CC to issue a message of the appropriate
color (red or green) whenever HIGH_VOLTAGE status changes its value or desirability.
If state_check_class is set to DESIRABILITY, no message will be generated if the
HIGH_VOLTAGE STATUS changes from OFF to UNKNOWN, since these values share
the same desirability.
4-1
4-2
5. Defining TRIGGERS
Triggers are automated reactions to the crossing of a red HILO limits threshold, or
the change from a GOOD to a BAD state. Triggers are defined for the appropriate
items in LATEST_DATA (except those that have a data_class of character_string),
and the reactions are defined as a CSTOL statement, usually START PROCNAME.
Multiple LATEST_DATA records can share the same trigger.
proc safe_heater
begin
; the following determines if the trigger was activated on a red high... this
; logic must be consistent with the limits definitions...
5-1
endproc
Note the last action of safe_heater.prc is to re-enable the trigger. OASIS-CC
automatically disables a trigger once it has executed to prevent noisy data from
initiating it repetitively. In this example, the safeguard is explicitly overruled by the
trigger procedure itself.
When the trigger executes the first time, the procedure will compile and execute on a
control language processor reserved for triggers – the trigger CLP. Once a
procedure is compiled on the trigger CLP, it can never be decompiled (during the
OASIS-CC session). Consider testing the source from the User CLP before
enabling the trigger.
5-2
6. Defining EQUATIONS
Defining an equation is similar to defining a trigger, however the mechanism that initiates
an equation is different. Equations are initiated when a specific global variable, or
LATEST_DATA record, changes its value. The equation is named by the
EQUATION_NAME field in the LATEST_DATA record used to drive the equation.
Whenever the item's value changes (which may be at a lower frequency than when a new
value is received), the equation ultimately references a CSTOL statement to be executed.
Usually, the CSTOL statement consists of a call to start a CSTOL procedure, since most
equations require more than one line of CSTOL to complete.
6-1
proc add_currents
endproc
Prior to enabling the equation, test it by starting it from the User CLP:
start total_currents
If it's buggy, edit the source, decompile and start the procedure until it has the desired
affect.
decompile total_currents
start total_currents
When it works, enable the equation. When an equation is started by changing the value of
a LATEST_DATA item that names it, the procedure will compile and execute on a control
language processor reserved for equations – the equation CLP. Once a procedure is
6-2
compiled on the equation CLP, it can never be decompiled (during the OASIS-CC
session).
6-3
6-4
7. Defining Commands
The verbs CSTOL provides are listed in Chapter 9 of the OASIS-CC CSTOL Reference
Manual. If desired, the application manager can expand this list. Verbs translate into the
NAME of the command as it is known by the command database tables. Objects can be
anything you want, limited to 16 characters, and translate into the
EXTERNAL_ELEMENT of the command as known by the command tables.
7-1
Attributes
To improve the readability of command directives, and to reduce the proliferation of
underscores, the command syntax provides an optional Attribute to help describe the
Object. Now the syntax appears as:
like close relay one or set grating position. Attributes are optional when the command
directive is designed. If used, they must always be supplied when the command directive
is issued. If an attribute is used, the command tables' NAME becomes a concatenation of
the Verb, an underscore, and the attribute – all of which cannot exceed 16 characters. The
command tables' NAME would be set_position, and the EXTERNAL_ELEMENT,
grating.
Subfield Clauses
Some commands are discrete: their bit pattern never alters. Others contain subfields that
can take on varying data. OASIS-CC command directives allow subfields to be filled with
the TO, BY, FROM and WITH clauses. Discrete commands do not use these clauses, nor
the database information that must back them up. The command directive syntax is
completely specified below. (Actually, there are further twists to the syntax that are not
discussed in this document. Consult Chapter 10 of the OASIS-CC System Managers
Guide for the complete syntax specification).
TO, BY, and FROM are known to the command database tables as SUBFIELD_NAMEs.
A, B, C, ...Z also translate as SUBFIELD_NAMEs, however the command designer
chooses their spelling. The spelling of all italicized words in the command syntax is up to
the designer. (Verbs are chosen from the list referenced above). The subfield delineators
(,) and (and) are interchangeable in the WITH clause.
The user supplies the subfield values w,x,y, and z when the command is issued. These
values can be an integers, or EUs ( Engineering Units – real numbers with units), or a
STATEs. Example commands directives with subfields:
The TO, BY and FROM allow users to pass only one subfield value when the command is
issued. The WITH clause does not limit the number of subfields that can be supplied when
the command is issued.
After CSTOL command directives are implemented in the database, they are fixed. That is,
none of the elements of the command statement are interchangeable. (The subfield values
are not fixed, and all or parts of the subfield clauses can be omitted if the supplied default
subfield values are acceptable. The order in which subfield values are supplied does not
matter.)
FAF320A329900012324A (hex)
This command turns on a heater (as governed by the value 99), and sets a thermostat
according to the values shown currently as zeros. Another representation of the command:
FAF320A320100012324A (hex)
turns off the heater. This command has two subfields: one controls whether the heater is
on or off, the other controls how hot it should get when on. The thermostat control data is
ignored by the receiver if the command turns off the heater. After considerable review (and
emotion), the control review team designed a CSTOL statement that will issue the above bit
patterns. The winning selection was:
According the CSTOL command syntax, the commandable element is the heater; no
attribute was used, so the command name is set. Subfield names are mode and temp. The
subfield value for mode can be either 'on' or 'off', and is supplied when the statement is
entered by the user. The subfield value for temp is an integer, and is supplied when the
command is entered.
7-3
where the commandable element is h, command name is set, the subfield names are m
(with allowable values 'n' or 'f'), and t (expecting an integer value following).
1) Provide a map of commandable elements that a given user class may access.
User classes are defined in the USER_PRIVILEGES table, and have an
associated element name. A user class has access to the named element, and
all elements below it in the hierarchy.
2) Define command channel elements. Command channels are a associated with a
specific communications device. Commands sent on a given channel will
have commandable elements in the hierarchy that branch below a command
channel element. Note that for bus-type of communications devices (such as
IEEE_488), each device on a bus acts as a command channel element. For
communication devices not on a bus (such as serial ports) one command
channel element exists that reflects the interface.
3) Define a topmost element that provides access to all elements in the hierarchy for
the MASTER user class.
Example Creating a Command Hierarchy
Consider the selected CSTOL command statements and their bit patterns from the example
in Designing the CSTOL Command Statements:
SCCDU
SCCDU
HEATER
7-4
To further demonstrate the hierarchy, assume that SCCDU also services a cooler:
SCCDU
HEATER COOLER
Most OASIS-CC applications have multiple command channels, so pretend there is another
device to which an entirely different flavor of commands are sent. This device is an IEEE
bus that services a slew of test equipment, like a digital multimeter and a stepper motor.
The IEEE equipment needs to be defined in the table slightly differently – each device on
the bus acts as a command channel element (it needs to be its own oldest ancestor).
OASIS-CC knows which bus – there can be more than one – the DMM and STEPPER are
on by information provided in the ELEMENT_CHARACTERISTICS table.
HEATER COOLER
Since command privileges for a class of user are associated with a named element and all of
the elements below it, this hierarchy won't allow any user to command both the digital
multimeter, the stepper, and the heater from the same OASIS-CC session. (Only one user
class can run OASIS-CC at a given time). To rectify this, a last element is needed, and it's
role is to provide full command access:
EXECUTIVE
HEATER COOLER
Fill the ELEMENT_HIERARCHIES table, starting with the top most element (although the
order in which the inserts are executed doesn't matter):
7-5
7-6
The approach to implementing a command differs for the two types. For example, Table 1
shows that the two types don't use the exact same database table sets. Binary commands
are defined by first describing the command as a fixed length bit pattern, and second,
mapping into the fixed pattern any subfields the command requires (if any). ASCII
commands are defined by concatenating a series of character segments, some of which may
or may not be subfields. The process for defining both types follows.
7-7
Binary Commands use (at least): ASCII Commands use (at least):
COMMANDS COMMANDS
and, depending on the command's ASCII_COMMAND_MAPS
complexity:
COMMAND_MAPS and depending on the command's
complexity:
COMMAND_VALUES ASCII_COMMAND_VALUES
COMMAND_VALUE_CONVERISONS COMMAND_VALUE_CONVERSIONS
COMMAND_STATE_CONVERSIONS COMMAND_STATE_CONVERSIONS
FAF320A329900012324A (hex)
This command turns on a heater (as governed by the value 99), and sets a thermostat
according to the values shown currently as zeros. Another representation of the command:
FAF320A320100012324A (hex)
turns off the heater. This command has two subfields: one controls whether the heater is
on or off (99 vs. 01), the other controls how hot it should get when on. The thermostat
control data is ignored by the receiver if the command turns off the heater.
set heater with mode on and temp 4095 (A3299FFF hex) heater on, full temp
set heater with mode off (A3201000 hex) heater off
set heater with temp 4095 (A3201FFF hex) heater off
set heater (A3201000 hex) heater off
OASIS-CC needs to know where to place the subfields in the commands' fixed pattern:
7-9
the differences (one difference per segment) of the source and destination bit coordinates.
INTEGER values can be 1 to 32 bits long, whereas single precision and double precision
values must be 32 and 64 bits long.
Since the legal values for the MODE subfield are on or off a translation is required to turn
the literals into values:
Currently, OASIS-CC can only format command data as ASCII data or binary integer data.
Consider a command intended for the COOLER (see the example in Defining a Hierarchy
of Commandable Elements). In order to demonstrate an ASCII command, assume that the
cooler expects the following command data:
7-10
These commands set the cooler's operations to mode 1 and mode 2. As established in the
previous sections, all commands traveling the same channel share header and trailer
information, which is stored in the COMMAND_MESSAGES table. Further, the existing
COMMAND_MESSAGES record shows that no SCCDU command can be longer than 80
bits. The cooler commands are each 9 bytes long, including the header and trailer.
The control review team decided on the following CSTOL command statement to issue the
above data:
7-11
Is_a_subfield=FALSE because the value is not supplied by the CSTOL command statement
– it's supplied in this database record. Is_ascii=TRUE says how the value for this non-
subfield segment will be input - ASCII or hex.
7-12
In applications where LATEST_DATA has many records, it's useful to have the ability to
display items that are not included on any pre-designed panels. To implement this
capability, create a wildcard page that allows the user to specify LATEST_DATA items
during run-time.
8-1
Define a connection for the Modify... push button to bring up the panel shown in Figure 2.
Create another panel (name is wc with a title insert ) as shown in Figure 2. This panel will
be used to name the desired telemetry points you want to display, and assemble a label to
go along with it, and refresh the actual wildcard display. Define a connection to clear the
wildcard panel with the button Close.
When developing the panel wc, name the text keyin item used to define the desired row rn;
the keyin for external_element ee; Item_name in; Type of Data dt; Units vu; and Value
Format vf.
Define a connection for the Initialize Wildcard... button to raise another panel that requests
approval for this action. This Panel is shown in Figure 3
8-2
Place the AWB in Define Connections mode, and provide the Actions presented in Table 3
for the buttons titled Refresh Wildcard with New Info and delete.
8-3
Note that the second CSTOL statement sent to the system by the Delete push button is a
CSTOL Macro named init_wildard. The body of this macro is explained below. The
Cancel button should clear the delete panel. Generate the interface code, recompile, and
relink (these steps are required whenever a new panel is added, or any connections or
actions within the interface have been modified).
Create and run a CSTOL procedure that creates the following the database entries shown in
Table 4. The body of such a procedure, create_wildcard.prc is shown in Figure 4.
8-4
external_element=wc_display
item_name =dummy
data_class =character_string
proc create_wildcard
;INSERT THE MACRO THAT DUPLICATES THIS PROCEDURE. THIS MACRO IS CALLED FROM THE
;INTERFACE TO REINITIALIZE THE WILDCARD DISPLAY
delete macros where macro_name=init_wildcard
insert macros macro_name=init_wildcard,filename="init_wildcard.mac"
8-5
data_class=character_string
insert latest_data external_element=wc_display,item_name=label_2,&
data_class=character_string
insert latest_data external_element=wc_display,item_name=label_3,&
data_class=character_string
insert latest_data external_element=wc_display,item_name=label_4,&
data_class=character_string
insert latest_data external_element=wc_display,item_name=label_5,&
data_class=character_string
item_name=dummy,type_of_data=eu_data,index=0,value_format="a16"
delete display_definitions where tae_base=wcv5
insert display_definitions tae_base=wcv5, external_element=wc_display,&
item_name=dummy,type_of_data=eu_data,index=0,value_format="a16"
Make provisions for starting the create_wildcard procedure in your application. Also create
a CSTOL Macro named init_wildcard.mac. The macro will be identical to the procedure
create_wildcard, with the exception of the macro init_wildcard and end macro statements at
the beginning and end of the source code. Once the procedure has executed, the user can:
8-7
8-8
Appendix A. Performance
Considerations
Avoid using display update rates of 0.0. For most scenarios, a 1.0 second update rate is
sufficient.
Reduce the frequency at which equations execute. In the Defining Equations chapter, the
example shows an equation calculate a total current when either of the constituent current
measurements change value. If either constituent updates frequently, a lot of processing
will occur to keep the calculated current as fresh. Is it necessary? Consider naming the
equation with a telemetry item that updates at a lower frequency.
Avoid supplying values to protected fields when using the CSTOL insert directive. The
results may be unpredictable.
If your application uses TAE Text Label items to display alphanumeric data, change them to
Text Dynamic_text. These items impose significantly less on the CPU, and have much
smoother refresh characteristics.
If your application employs large CSTOL procedures, compile them just after startup.
Compiling procedures takes a fair amount of work. Decompile procedures once they are
used.
A-1
A-2