Home

(UCL) Reference Manual

image

Contents

1. unit mph 1609 m h miles per hour type Mph REAL mph variable Speed REAL m s variable X REAL X REAL Mph Speed Speed is converted to Mph then to REAL INTEGER UNSIGNED INTEGER Conversion INTEGER unsigned integer value UNSIGNED INTEGER integer value These conversions are implicitly carried out whenever necessary They may however also be done explicitly A check will be done that the allowed range of the target type is not violated Examples Unsigned Integer Value UNSIGNED INTEGER Integer Value 2 REAL LONG REAL Conversion REAL long real value LONG REAL real value These conversions are implicitly carried out whenever necessary They may however also be done explicitly Examples Long Real Value LONG REAL Real Value 1 0E50 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nna berarbtg Rev Datum Date 2010 01 29 Seite Page 4 58 von of 4 96 Type to Subtype Conversion subtype value The base type of value must be the same as the base type of subt ype The effect of this conversion is to interpret the value as belonging to the subtype A check will be done to insure that the value does not violate possible con
2. Examples variable Flags BITSET variable I INTEGER Flags 3 5 12 I INTEGER Flags Bitset Constants Bitset constants are written in braces like set literals see 4 8 2 3 but the preceding type name may be omitted e g ly Sy Se Ty 9 20 as 31 0 se 31 An empty bitset is written as an empty pair of braces Representation in memory A bitset is represented like a set see 4 8 2 3 in one 32 bit word Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 32 voniof 4 96 4 8 2 5 String Types String types are used to store character or byte sequences of variable lengths A string type is declared with the keyword string followed by the maximum length of the string in parentheses and optionally an indication of the component type CHARACTER or BYTE If the component type indication is omitted CHARACTER is assumed so string 80 string 80 of CHARACTER have identical meaning and denote character strings whereas string 80 of BYTE denotes a byte string The actual length of a variable of a string type may vary between 0 and the declared maximum length The actual length may be obtained with the predefined function LENGTH In a stri
3. ode er oon ed ok OY ee hod 4 69 4 11 5 4 for Statement lllllllleeeeeeeee eh 4 70 4 11 6 return Statement 4214 2x axe a aha naar an 4 72 4 11 7 halt Statement 0 RI e 4 72 4 11 8 exit Statement nnno eee hes 4 73 4 12 Subprogram Declarations essssssessssssssesesssceseeoeoso 4 74 4 12 1 Procedure Declaration 0 0 0 ccc cet eee eens 4 74 4 12 2 Function Declaration lleeeeeeeeee ee 4 76 4 12 3 Guarded Procedures Functions and Parameters LL 4 T 4 13 Standard Functions and Procedures 5 5 05 ne 4 78 4 16 Compilation Units 2 2 0 060655045 006 Y ETTAOEESA E 8 80 E YS 4 81 4 16 1 Automated Procedures 0 00 ccc eee eee eens 4 82 4 16 2 anne a na eS c S PU 4 85 4 16 3 Formal Parameter List 261111005 eee 4 9 4 16 4 Derived Values nonon cc ce eee eee eee hn 4 92 4 15 Privileges and 107123000 4 94 4 15 1 Determining the Privileges of a Subprogram or Compilation Unit 4 94 4 15 2 Guarded Library Procedures and Functions 5 4 95 4 15 3 Guarded Parameters 0 0 siirad ad eee eens 4 95 4 15 4 Dependencies Imposed by Privileges 2222202222 5 4 96 5 Compilation aussah a u 5 1 5 1 References and Dependencies eeeeeeeeeeeeeeeee 5 1 5 2 Compilation Order 5 4 eosasohesohwahausabt amp rheathasnesekues 5 1 Appendix A Acronyms 0 A 1 Appendix B Definitions
4. Dok Nr Doc No CGS RIBRE STD 0001 6 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 43 vonlof 4 96 4 11 3 Predefined Units Within a target system based on UCL there are two groups of predefined units e UCL predefined UCL itself predefines only the names of the seven SI base units These are available and identical in any UCL based system Project predefined The target system may predefine further project specific unit names both new base units and derived units by means of the Mission Database These units must not overwrite SI base units Both of these groups of units are automatically available in any UCL compilation unit and need not be declared by the user 4 11 4 Unit Declaration New base units can be defined in the form unit unit identifier and new identifiers for derived units can be declared in a unit declaration which takes the form unit unit identifier unit expression Units cannot be declared local to a procedure or function Unit names are always global For conve nience it is however possible to redeclare an existing unit name but only identical to the existing unit Formal syntax Unit Declaration unit Unit Identifier Unit Unit P Unit Expression Unit Expression Numerator Denominator Offset Offset Offset Number Number
5. C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 21 vonlof 4 96 4 8 1 6 Type CHARACTER The value of a variable of type CHARACTER is an 8 bit character whose literals are defined by the ASCII character set A character literal is written between single quotes or apostrophes see 4 1 2 6 Values of type CHARACTER are ordered according to its 8 bit code whose 7 bit first half is the ASCII character set see Appendix E The relational operators may therefore be applied CHARACTER values may also be used in string operations see 4 8 2 5 Type conversions to and from INTEGER can be used to convert between a character value and its ordinal number its ASCH code see 4 12 4 The predefined procedures functions MIN and MAX may be used for CHARACTER see 4 15 Representation in memory A CHARACTER value is internally represented as an unsigned integer in the range 0 255 contained in one 32 bit word where the subrange 0 127 is the ASCII character set Within strings 4 characters are packed in one 32 bit word see 4 8 2 5 4 8 1 7 Low Level Types BYTE WORD LONG WORD The low level types BYTE WORD and LONG WORD represent individually accessible untyped storage units of 8 32 or 64 bits respectively No operation is defined on these types their values can only be assigned and passed as parameters If the target variable of an assignment or t
6. High resolution TIME DURATION format String conversions Qualified identifier syntax enhanced to better fit alias usage Derived Values can access their own old values Different editorial changes COL RIBRE SPR 10651 New function LOW generalized HIGH Generalized Min Max functions Privileges authorization I O format Qualified predefined identifiers xyz I O format Imports in library spec available in body Privileges inherited on subprogram level Extended string conversions Counting units unit string conversion for pathname types declaration of new base units unitized integer types declaration of new base units Substrings slices Predefined procedure PUT Constraints removed Annotations Explicitly numbered system library subprograms New keywords union entity void Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 4 9 4 3 4 5 2 1 4 5 2 5 4 11 4 12 4 14 4 9 4 3 4 82 49 4 1 4 9 4 3 4 8 4 8 4 9 4 1 4 13 4 4 5 2 5 4 12 Appendix H 4 1 4 4 4 16 2 4 1 2 2 EADS SPACE TRANSPORTATION DATE Affected Paragraph Page 2002 02 01 2002 06 03 2003 01 15 2004 05 19 2004 09 01 2004 12 14 2005 02 20 2005 06 08 2005 08 30 2005 12 01 2008 07 02 2009 02 01 2010 01 29 ISSUE REV Dok NriDos No CGS RIBRE STD 0001 EADS C 5 Ausgabe lssue 5 Datum Date 2009 02 01 SPACE berarbtg Rev Datum D
7. Scalar in parameter are passed by copying the value into the subprogram structured in parameters are passed by reference out and in out parameters are always passed by reference MDB items and subitems are passed by copy the input value in in out is copied into the procedure the output value n out out is copied back to the location of the runtime value of the item If a formal parameter type denotes an array structure its corresponding actual parameter must be an array of identical type i e same bounds same component types unless the array is defined as an unbound array or unbound string in which case only the component types must match also see unbound array and unbound string in subprogram declarations 4 6 A procedure call is inherently synchronous i e control is returned to the caller only after execution of the called procedure is completed Note A procedure or function may invoke itself recursive call Indirect recursion which occurs for example when a procedure A calls a procedure B which in turn calls A is also allowed e The order of evaluation of actual parameters is not defined and a program must not depend on the evaluation order Formal Syntax Procedure Call Qualified Identifier Actual Parameters Actual Parameters Parameter Parameter Parameter Identifier Expression Qualified Identifier see 4 3 4 Identifier see 4 1 2 2 Expression see4 1
8. String with max 255 bytes variable B80 string 80 of BYTE String with max 80 bytes S Hello world 580 S implies length check 5 S80 B d 7 280 B implies length check B B80 5 1 X s 2601806 first character in 5 580 Hello string concatenation B 1 16 FF replace first byte in B B B 280 BYTE 0 string concatenation Examples of substrings S80 2 S 11 20 selects a character substring of length 10 B80 B 11 20 selects a byte substring of length 10 Examples of LOW and HIGH type String 80 string 80 variable 5 80 String 80 variable S string HIGH String 80 20 LOW String 80 1 HIGH String 80 80 LOW S 80 1 HIGH S 80 80 LOW S 1 HIGH 5 0 Representation in memory A string is represented as one 32 bit word holding the actual length of the string as an unsigned integer followed by zero or more words holding a byte array with 4 bytes characters each packed in one word The number of bytes is the maximum length of the string filled up to a multiple of 4 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 34 von of 6 4 8 3 Pathname Types The values comprised by pat
9. The relational operators lt lt lt gt gt gt are also applicable to this type and yield BOOLEAN values The predefined procedures functions MIN MAX ABS ODD INC and DEC may be used for INTEGER see 4 15 The operator denotes integer division which always yields an integer result possibly leaving a remainder No rounding is performed e g 9 4 22 9 5 1 The result of an integer division is zero whenever the divisor is greater than the dividend Representation in memory An Integer value is internally represented as one 32 bit word in 2 s complement representation 4 8 1 2 Type UNSIGNED_INTEGER The type UNSIGNED_INTEGER comprises non negative whole numbers in the range 0 to 232 1 These bounds correspond to the predefined constants MIN UNSIGNED_INTEGER and MAX UN SIGNED INTEGER respectively The compiler issues an error message if this range constraint is violated All operators defined for type INTEGER also apply to UNSIGNED_INTEGER The arithmetic operators have cyclic semantics i e the values do not overflow or underflow but wrap around within the above mentioned range It is however not possible to assign values outside the range Values of type UNSIGNED_INTEGER and INTEGER are mutually compatible Thus also mixed expressions consisting of both INTEGER and UNSIGNED_INTEGER values are allowed Representat
10. eee nn B 1 Appendix C deleted 2 4 0s4046 026605enGo 5504500 06s eae RA ES KS C 1 Appendix D UCL Syntax 1222552222 22 50 54 a a a D 1 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok NriDos No CGS RIBRE STD 0001 EADS C S Ausgabe lssue 5 Datum Date 2009 02 01 SPACE berarbtg Rev Datum Date 2010 01 29 TRANSPORTATION Seite Page V von of V Appendix E ASCII Character Set eee E 1 Appendix F UCL MDB Type Correspondence Table F 1 Appendix G Engineering Units G 1 G 1 Base Units nr EY ERR C BEN ERI d Rd Wwe C RA G 1 G 2 SI Units ann aan G 1 G 3 Non SI Units ns ks Era E sae Nie ERR AA ERARYESGaS TY A G 6 G 4 Prefix Names and Values 0 cece cee e ccc c cece eee e cece eee G 6 Appendix H Implementation Constraints H 1 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 F AD 5 6 5 Ausgabe ssue 5 Datum Date 2009 02 01 ud berarbtg Rev Datum Date 2010 01 29 ssEr um Seite Page 1 1 voniof 1 1 1 Introduction 1 1 Identification This is the Language Reference Manual for the CGS User Control Language UCL Document CGS RIBRE STD 0001 The first issue is derived from the Columbus document COL RIBRE STD 0010 issue 4 A Changes to this base document are marked with change bars
11. Constant Expression String Type string Constant Expression of Identifier Statecode Type statecode Statecode List Statecode List Statecode Statecode Pathname Type pathname Identifier List Subitem Pathname Type pathname Identifier List Array Type array Index Range Index Range of Qualified Identifier Unit Index Range Constant Expression Constant Expression Qualified Identifier Set Type set of Simple Type Record Type record Fields end record Fields Identifier List Qualified Identifier Unit case Identifier Qualified Identifier Variant Part end case m Variant Part when Case Label List Fields else Fields Case Label List Case Labels Case Labels Statecode List Case Labels Constant Expression Constant Expression Identifier List Identifier Identifier Inherited Type type of Name Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 5 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page D 4 von of D 7 Statements Procedure Call Repeat Statement Exit Statement If Statement Case Statement Loop Statement For Statement Return St
12. S hello C o07X A I 1 I 1 Bg Rec X Comp A 100 PM TTC STAT SNOGO 4 13 2 Procedure Call A procedure call activates the specified procedure It is denoted by stating the procedure s name possibly followed by one or more parameters in parentheses These parameters the actual parameters are substituted for the formal parameters specified in the corresponding procedure declaration The association between actual and formal parameter may be specified either in positional or in named notation In the positional form the correspondence between actual and formal parameters is established by the positions of the respective parameters in the list In anamed parameter association the parameter must be named explicitly Named parameters may be given in any order If both positional and named associations are used in one procedure call the positional associations must occur first For each formal parameter there must be exactly one actual parameter either explicitly specified or by default If a default value exists the actual parameter may be omitted In this case all remaining actual parameters must be denoted by name For example if the procedure P is defined as procedure P X INTEGER 0 Y REAL 0 0 Z BOOLEAN FALSE then the following procedure calls are all valid P 5 3 14 TRUE all parameters positional P 1 Z TRUE X positional Y omitted Z named
13. rl 25 052095 X and Y named Z omitted P 0 all parameters omitted ps same as P Note that the use of commas to indicate omitted default parameters is not allowed Thus P 5 TRUE is invalid In a procedure call the types of the actual parameters must be compatible with those of the formal parameters Subprogram parameters belong to one of three classes in parameters allow to pass values into a subprogram Within the subprogram only read access is allowed The actual parameter for a formal IN parameter may be an expression The keyword in may be omitted in the parameter declaration out parameters allow to pass values out of a subprogram Within the subprogram read access is allowed but only to obtain a value that was previously assigned within the same subprogram call The actual parameter for a formal out parameter must be a variable or an MDB item or subitem with READ WRITE access Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 65 von ot 4 96 in out parameters allow to pass values into and out of a subprogram Both read and write access are allowed within the subprogram The actual parameter for a formal in out parameter must be a variable or an MDB item or subitem with READ WRITE access
14. 1 2 Purpose This document provides the language definition for UCL Its primary goal is to establish formal requirements on syntax and semantics of UCL for the development of language processing tools such as compiler and interpreter It may also be used as a language reference manual Please note that this reference manual covers only the UCL language itself it does not define system libraries for specific target systems The definition of UCL system libraries is part of the interface documentation of the respective target systems e g the CGS ICD DMS ICD etc 1 3 Document Outline This reference manual is divided into main chapters 3 and 4 and several appendices which for the most part summarise information provided elsewhere in the document Chapter 3 gives a general overview it briefly explains the underlying concept and puts UCL in perspective showing how it fits into the CGS language scenario UCL HLCL Chapter 4 deals with the basic language definition It is organised into sections each covering a specific language element This is first explained in narrative form followed by the formal syntax using a variant of the Backus Naur Form and finally illustrated by one or more examples The appendices A through H have the following contents e Appendix A and B explain the acronyms and terms used e Appendix C is empty e Appendix D summarizes the syntax of UCL e Appendix E shows the ASCII character set e Appendix F
15. CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 31 von of 4 96 Set Constants A set constant may be written by enumerating the set elements in braces with the type name preceding the bracketed expression Each element can be a constant expression type name value value value Ranges of adjacent values may be written in the form first e g Char Bet taf sa 7872 TAP sa 82 t Y An empty set is written as an empty pair of braces Char Set Representation in memory A set is represented by a number of bits packed in one or more 32 bit words one bit for each possible member of the set A member is present in the set if its bit is set it 18 absent otherwise The first member is expressed by bit 0 the last member by bit n 1 4 8 2 4 Type BITSET The predefined type BITSET is defined as type BITSET set of INTEGER 0 31 It thus represents a set of 32 elements corresponding to the width of a storage unit All operations applicable to the set types equally apply to BITSET see 4 8 2 3 but BITSET has additional special characteristics It may be used to access a 32 bit storage word as a sequence of bits The i th bit of a bitset B for example is 1 if i is a member of B 0 otherwise Values of type INTEGER and UN SIGNED INTEGER may be converted to BITSET and vice versa see 4 12 4
16. Expression Identifier Path Identifier Pathname Simple Name Identifier v V Path Identifier Path Identifier Name Identifier Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 605 __ eubriurnm Constant Expression Expression Aggregate Relation Simple Expression Term Factor Primary Set Constant Element Function Call Type Conversion String Conversion Format Width Aft Exp Qualified Identifier Designator Slice Expression List Simple Name Name Pathname Subitem Pathname Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page D 6 von of D 7 EADS 5 eubriurnm Unit Expressions Unit l Unit Expression Unit Expression Numerator Denominator Offset Offset Offset Number Number Numerator Unit Term Unit Term Denominator Number Unit Factor Unit Term Unit Term Number Unit Factor Unit Factor Number Unit Factor Unit Identifier Digit Unit Identifier Letter Letter Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 CGS RIBRE STD 0001 Datum Date 2009 02 01 Datum Date 2010 01 29 von of D 7 Dok Nr Doc No Ausgabe ssue 5 berarbt
17. Like an array a record is a structured type In a record however the components are not constrained to be of identical type In the record declaration each component or field must be specified by a name field identifier and a type To reference a field the name of the record is followed by a period dot and the respective field identifier e g BIRTHDAY MONTH Records may be nested The scope of a field identifier is the innermost record in which it is defined Hence field identifiers i e the names of record components may be reused outside the scope of that record definition A record type may have several variants based on the values of a specific field the tag field These variants may differ in the number and type of components and thus allow for alternate forms of the same record They are enclosed by the keywords case and end case Each keyword when introduces a variant that is to be part of the record for the list of tag field values given after the keyword Note that changing the value of the tag field e g by an assignment may select a different variant and thus change the structure of the record variable Access to fields outside the currently selected variant 1 6 to undefined components may have unpredictable effects This is not checked and may be used for low level programming purposes to circumvent UCL s type checking mechanisms exploiting the fact that all variants occupy the same location in memory and t
18. Numerator Unit_Term Unit Term Denominator Number Unit_Factor Unit Term Unit_Term Number Unit_Factor Unit_Factor Number Unit_Factor Unit Identifier Digit Unit Identifier Letter Letter Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS e berarbtg Rev Datum Date 2010 01 29 Seite Page 4 44 vonlof 4 96 4 11 5 Unit Syntax A unit is expressed with a syntax production defined somehow like a string with an imposed syntax enclosed in brackets and Note that no space may be used between the Unit Identifier and the following Digit in the syntax production Unit Factor A Unit Identifier is composed of letters only The following conventions are used for unit expressions Identifiers are case sensitive mA MeV Multiplication is denoted by a space kg m Nm 1000 m Division is denoted by a slash 7 7 m s 1 s Exponentiation is denoted by an attached digit m3 2 For numbers reals or integers may be used 0 0254 m 10 8080 18 320 18 An expression with or creates an absolute unit Kabs 273 15 it defines the offset of the two zero points A single number defines a counting unit 12 for dozen Parentheses may be used to clarify the order of evaluation but no nested parentheses are suppo
19. 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 23 vonlof 4 96 4 8 1 9 Types TIME and DURATION UCL distinguishes between absolute and relative time references Two predefined data types are provided TIME whose values are absolute points in time and DURATION whose values are time distances TIME values range from 1901 to 2099 the lowest and highest allowed values can be obtained with the standard functions MIN TIME and MAX TIME The resolution of TIME values is 1 nanosecond The type DURATION comprises LONG_REAL values expressed in seconds the lowest and highest al lowed values can be obtained with the standard functions MIN DURATION andMAX DURATION The predefined type DURATION is declared as type DURATION LONG REAL s The following operations may be performed on TIME DURATION objects time duration time duration time time time duration time time time duration duration real duration duration real duration duration duration duration duration duration duration Furthermore all comparison operations are provided for both types e g time time boolean duration gt duration boolean Time values may be with or without a date In the second case the date is ignored in any operations If in an operation an operand is without a date it is assumed to refer to the same d
20. 4 52 vonlof 4 96 4 12 2 2 Concatenation Operator Symbol Operation string concatenation This operator joins two strings of the same base type i e string literals string constants or variables or string elements characters bytes The result is a string containing the left and right operands concatenated 4 12 2 3 Logical or Boolean Operators Symbol Operation logical or amp logical and logical negation unary operator Their operands must have the type BOOLEAN The definition of the Boolean operators amp and is as follows p amp q if p then q else FALSE p q if p then TRUE else q This definition implies that the second operand will not be evaluated if the result is already known from the evaluation of the first operand short circuit evaluation 4 12 2 4 Relational or Comparison Operators Symbol Operation equal lt gt unequal lt less lt less or equal gt greater or equal gt greater These operators are applicable to all ordered types i e INTEGER UNSIGNED_INTEGER REAL LONG_REAL CHARACTER TIME and enumeration types They may also be used for string operands and except lt and gt for set operands The equality operands and lt gt can also be applied to statecode set pathname and subitem pathname operands as well as to BYTE WORD and LONG_WORD operands 4 12 2 5 Set Operators Symbol Operation in contained in set union set diff
21. Control operations via target specific system library routines Access to database items as global objects via their path name e Support for physical measurement units Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 E A D 5 4 berarbtg Rev Datum Date 2010 01 29 ascr um Seite Page 3 4 von of 3 5 e Statements Assignments Procedure calls Function calls Conditional statements if statement with elsif and else clauses case statement with when and else clauses Iteration general loop statement with exit repeat while and for loops Transfer of Controls halt return exit Declarations constant variable type unit and alias declarations Declaration of variables is mandatory Objects must be declared before they are referenced e Certain keywords are reserved and cannot be used as identifiers e The semicolon is a statement terminator not a separator e Data types predefined Integers real numbers with single and double precision Booleans enumerated types state codes times durations sets character strings byte strings arrays records pathnames and low level types for bytes words and long words user defined e Arrays and strings may be of arbitrary dimension with arbitrary bounds array bounds are constant
22. Digit Digit Digit Digit Time Hours Minutes Seconds Fraction Hours Digit Digit Minutes Digit Digit Seconds Digit Digit Fraction Digits Digits 66 1 Digit see4 1 2 4 1 Examples 30 05 1992 12 34 17 48 date and time 13430 time only date is ignored 24 12 1991 date only at 00 00 h Ai undefined time 4 1 2 9 Duration Literals A duration literalis written as a real number with a time unit e g seconds minutes or hours Unit literals are described in 4 1 2 10 the unit concept is described in 4 11 Examples each representing a duration of one hour 3600 0 s in seconds 60 0 min in minutes 1 0 h in hours Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 8 von of 4 96 Kbps 4 1 2 10 Unit Literals A unit literal denotes a physical measurement unit It is enclosed in square brackets The unit expression follows the ISO 1000 conventions see section 4 11 and reference document 2 2 4 Exponentiation is denoted by placing the exponent directly behind a unit identifier with no blanks between them e g m2 stands for m Note that in contrast to ordinary identifiers unit identifiers used in unit expressions kg m A MeV etc are case sensitive l Unit Expressi
23. Eng Unit Type when Discrete State statecode end case end record b Record with variant parts type Measurement Type type Eng Unit Type type Measurement Representation in memory A record is represented as the sequence of its fields in their respective representation All variants of the same variant part are mapped to the same location in memory The size of a variant part is determined by its longest variant Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS mea berarbtg Rev Datum Date 2010 01 29 Seite Page 4 30 voniof 4 96 4 8 2 3 Set Types A set is a collection of objects of the same type the base type The latter must be a discrete type with at most 210 values i e a set may contain as many elements as can be expressed using an unsigned 16 bit integer A set type declaration is denoted by the keywords set of followed by the appropriate type identifier A set constant is represented by a list of its members enclosed in braces curly brackets and preceded by the respective type identifier base type e g CharSet a b Ifthe type identifier is omitted the predefined type BITSET is assumed e g 3 5 15 isaliteral of type BITSET If the members of a set are consecutive values they may be expressed as a ra
24. Formal Parameters see 4 14 1 Declaration see4 3 Statement Sequence see 4 13 Qualified Identifier see 4 3 4 Identifier see 4 1 2 2 Unit see 4 11 and 4 1 2 10 Examples function Square N INTEGER INTEGER begin return N N end Square function Is Printable C CHARACTER BOOLEAN begin return C CHARACTER 31 amp C CHARACTER 127 end Is Printable Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS na berarbtg Rev Datum Date 2010 01 29 ecbriL i rm Seite Page 4 77 vonlof 4 96 function Sum Of A array of INTEGER INTEGER variable Sum INTEGER 0 begin for I 0 to HIGH A do Sum Sum A I end for return Sum end Sum_Of 4 14 3 Guarded Procedures Functions and Parameters Procedures and functions may be marked as guarded in the form guarded procedure Name guarded function Name Type Also the formal parameters of a procedure or function may be marked as guarded procedure Name guarded Name Type function Name guarded Name Type Type A subprogram that calls a guarded subprogram or a subprogram with a guarded parameter will inherit the privileges attached to the accessed entity and calls to this subprogram w
25. The assignment of privileges is done outside UCL with a system tool Required privileges are configured in the database with each single item UCL compilation units and subprograms that reference other privileged items recursively inherit the privileges of all items referenced directly or indirectly UCL does not assume a specific meaning of the privileges it just keeps track of all privileges inherited by each item When using a privileged item in an HLCL command window e g starting an AP HLCL will deny access to the item if the user lacks any privileges required by the item For details see the HLCL Reference Manual 2 2 1 4 17 1 Determining the Privileges of a Subprogram or Compilation Unit When compiling a UCL item the compiler determines the full set of required privileges i e the assigned privileges of the item itself plus all privileges inherited through references to other items and stores them together with the compiled item in the database The privileges of items used within a compilation unit are evaluated only if used in a guarded position In non guarded positions the privileges are ignored e Imports are always guarded Assignments to software variables are always guarded as well as passing a software variable as an out or in out parameter to a procedure Procedure and function calls are guarded either if the call is to a library procedure or function explicitly marked with the keyword guarded in its declar
26. exit Examples loop A A 1 if A gt 10 then exit end if B B end loop lt execution continues here when A gt 10 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 74 vonlof 4 96 4 14 Subprogram Declarations A subprogram or subroutine is a code segment or sequence of statements which can be invoked by name UCL supports two kinds of subprograms procedures and functions 4 14 1 Procedure Declaration A procedure declaration comprises e a procedure header consisting of the reserved word procedure followed by the procedure name and an optional parameter list in which the procedure s formal parameters are defined e aprocedure body which may contain declarations and statements It must not however contain procedure or function declarations In other words procedures and functions cannot be nested inside other procedures and functions Formal Parameters Formal parameters are identifiers which denote values or objects to be passed with the call There are three modes of formal parameters in parameters are treated as place holders to which the result of the evaluation of the corresponding actual parameter is assigned as an initial value They may be assigned default values via
27. i e constant variable type procedure etc with the exception of the predefined standard identifiers Mission Database objects and imported objects must be explicitly introduced via an object declaration before they can be used in the program The object declaration associates the object with a name and at the same time establishes the object s attributes or properties Declaration of all UCL objects is described in the following sections Once an object has been declared it may be referenced by its name or identifier An identifier used in a declaration must have been declared in a previous declaration i e an identifier must not be used in its own declaration Within the same scope all identifiers must be unique 4 3 2 Scope of Identifiers A UCL program AP may be structured it may contain subprograms procedures and functions which are nested within the main program The main program as well as each subprogram form a scope which may contain its own set of locally declared objects Parameters belong to the local scope of the AP or subprogram The scope of an identifier is the section of a program or subprogram in which the object denoted by the identifier exists In general the scope of an object extends from its declaration to the end of the block in which it is declared see figure 4 below Whithin its scope an identifier is visible and can be used e An identifier declared in an outer scope e g an AP may be redeclared i
28. if Expression then Statement Sequence elsi Expression then Statement Sequence else Statement Sequence end i dt Statement Sequence see 4 13 Expression see4 12 Examples if PM TTC TRANSMITTER STATUS 1 then end if if X gt Y then statements elsif X Y then statements else end if 4 13 4 case Statement The case statement is used when a choice from among several mutually exclusive alternatives must be made on the basis of the value of an expression It thus represents a generalization of the if statement It has the form case expression when labels 1 statement sequence 1 when labels 2 statement sequence 2 else statement sequence n end case The case statement causes one of its statement sequences to be selected according to the value of an expression the case selector which must be of a discrete type INTEGER UNSIGNED INTEGER Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 ssrcr um Seite Page 4 67 von of 4 96 CHARACTER enumeration type or constrained statecode type The different values that may be taken by this selector appear in the case statement as case labels or case label ranges The branches in a case statement must be uniquely identified by its l
29. parameter is then said to be an open or unbound array parameter and array parameters of any size but with the given element type are accepted Within the subprogram the actual index range and its type is always mapped to a corresponding INTEGER range with a lower bound of 0 its lower and upper bounds can be obtained through the standard functions LOW and HIGH Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 75 von of 4 96 Kbps X e The parameter type may be one of the open forms any pathname types any subitem pathname types any statecode types pathname pathname statecode If the parameter is of a pathname type it may require actual parameters to be given together with their actual parameter list For parameterized MDB items see 4 3 6 The pathname type specification is then suffixed with an empty pair of parentheses pathname typename Subitem pathnames cannot be parameterized Procedure body The procedure body contains a statement sequence bracketed by the reserved words begin and end possibly preceded by local constant type variable or alias declarations These local declarations effectively hide any identically named objects in the enclosing main program AP as well as imported and
30. the first contains the short identifier SID of the database item the second the subitem identifier both as unsigned integers Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS e berarbtg Rev Datum Date 2010 01 29 Seite Page 4 37 vonlof 4 96 4 8 5 Inherited Types An inherited type inherits the software type UCL type of a database item defined together with the item in the database Note that only items with access class READ and READ WRITE have a software type see 4 3 6 for a description An object variable constant parameter declared with an inherited type thus has the same type properties as the corresponding database item including any constraints and engineering units Formal Syntax Inherited_Type type of Name Name is a possibly aliased pathname Name see4 3 4 Example type Voltage type of MAPMNFLTSYSMMEASNVo1t1 variable V Voltage V has the same type as APM FLTSYS MEAS Voltl V X implies a check against the constraints of APM FLTSYS MEAS Volt1 Representation in memory Inherited types are not separate types They always correspond to one of the above described types and are represented like these Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok
31. then M 50 0 km commensurable units are converted by the compiler S 0 5 hl m h m s A S 2 0 h m s h lt m s2 C 24 bit px C 3 Byte px implies a conversion Byte px lt bit px Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS eet berarbtg Rev Datum Date 2010 01 29 Seite Page 4 48 voniof 4 96 4 11 11 Unitized Integer Values Integer values with units require special care e In expressions with unitized integer or unsigned integer values integer arithmetic applies like for non unitized values 5 m 2 s 2 m s e When converting between commensurable units the resulting value will be rounded to the nearest integer km h km h 4 5 km 2803 km 1 m s 0 gt 3 mi gt 4 8 gt e Expressions with mixed commensurable units may imply inadvertent unit conversions that lead to loss of precision and even worse to unwanted zero values The rules given in 4 11 10 try to reduce such loss as much as possible but cannot avoid it completely variable K INTEGER km km 1 mi 2 1 km 2 km 2 2 km 1 km 400 m 1000 m 400 m 600 m 1 km 1 km h 1 s 1 1000 3600 m 0 m 0 km 1 Unit conversions and normalizations can much more e
32. 2 2 Examples procedure P X pathname begin end P unconstrained type Monitor Item pathname EGSE INTEGER MEASUREMENT constrained EGSE FLOAT MEASUREMENT EGSE INTEGER SW VARIABLE EGSE FLOAT SW VARIABLE type AP Item pathname UCL AUTOMATED PROCEDURE constrained If a formal parameter is of a possibly constrained pathname type and followed by the syntax the actual parameter must be followed by its own actual parameter list if one is declared within the database Such a formal parameter is then known to be of a parameterized pathname type For such a parameter only pathnames of items that may have parameters can be passed The property whether or not an item can have parameters is an attribute stored together with the item in the database Parameters of a parameterized pathname type can only be of mode in see 4 14 1 Whithin the subprogram they may be accessed as parameterized items passed to other subprograms or non parameterized items e g assigned to a variable or passed to a subprogram that requires a non parameterized item as parameter Examples procedure Acquire Item Measurement non parameterized item procedure Execute AP AP Item parameterized item Note that all checks concerning constraints and parameterisation of pathname types are performed at compilation time not at runtime Whenever a pathname value is assigned to a variable or passed as a
33. 3 Within the syntax productions between any terminal symbols blanks tabs or line and page breaks may be arbitrarily inserted Within terminal symbols no blanks tabs line or page breaks are allowed A comment starts with two hyphens and extends to the end of a line In identifiers and reserved words as well as for the letter e E in real literals lower and upper case letters are not distinghuished These letters are shown here in lower case only they are to be undestood as representing both the lower case and upper case variant Please note Annotations are not explicitly shown in the syntax They are syntactically treated like comments but may appear only at defined positions in a compilation unit see 4 4 Compilation Units Compilation Unit Main Procedure Library Specification Library Body Formal Parameter List Definition Derived Value Main Procedure Import Unit Declaration Constant Declaration Type Declaration Alias Declaration procedure Identifier Formal Parameters Import Declaration begin Statement Sequence end Identifier Library Specification library Identifier Import Definition end Identifier Library Body library body Identifier Import Declaration begin Statement Sequence end Identifier Formal Parameter List Definition Import Unit Declaration Constant Declaration Type
34. 4022 a 48 Zar ar san RAS REA E AERE 4 48 LH BXBPOSSIONS ars ner rien 4 49 A Alek Operands 2 00 4 50 4 2 Operators 2 0 4242 dare EE 50 edd sr aem 4 51 4 11 2 1 Arithmetical perstots i ss ur 4 51 4 11 2 2 Concatenation Operator 2020222222 4 52 4 11 2 3 Logical or Boolean Operators 2202222222 4 52 4 11 2 4 Relational or Comparison Operators 222222202 rennen 4 52 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok NriDos No CGS RIBRE STD 0001 EADS C S Ausgabe lssue 5 Datum Date 2009 02 01 SPACE berarbtg Rev Datum Date 2010 01 29 TRANSPORTATION Seite Page IV von of V 4 11 2 5 Set Operators cass ka eu RR reader 4 52 4 11 3 Fonction Calls 22 2 eine en 4 53 4 11 4 Type Conversions 2 2 4 54 4 11 4 1 High Level Conversions 20 RR 4 54 4 11 4 2 Low Level Conversions 0 4 59 4 11 4 3 String Conversions 22 24 usas e RR RR Re RR RR et 4 60 4 11 4 4 Input Output Format 0000022222 4 62 4 11 Statements u nun 4 63 4 11 gt gt sees oe EQ LEX Tavra eX ap qeu debes qun d 2 0 ege 4 63 4 11 2 Procedure Call lsllleeeeeeeee Re 4 64 4 11 3 if Statement 4 66 4 11 4 case Statement lllllieeeeeeeee e 4 66 4 11 5 Loop Statements core od qr eg dores doe Rara WR Nest 4 67 4 1 5 1 Simple loop Statement 2 2 22 4 68 4 11 5 2 while Statement co ooeeeen nennen eh 4 68 4 11 5 3 repeat
35. CODE as well Representation in memory COMPLETION CODE values are represented like other enumeration types with SUCCESS and FAILURE l 4 8 1 11 Enumeration Types An enumeration consists of an ordered sequence of identifiers These identifiers are constants defining the list of values that may be assumed by a variable of that type Enumerated types are ordered by the sequence of values in the enumeration in the example below Red is smaller or less than Green In an enumeration with n elements the first element has the ordinal number 0 and the last element the ordinal number n 1 All comparison operators can therefore be used on enumeration values according to this ordering Type conversions see 4 12 4 can be used to convert between an enumeration value and its ordinal number The predefined procedures functions MIN MAX INC and DEC may be used for enumeration types see 4 15 Note that BOOLEAN and COMPLETION CODE are enumeration types Whenever an enumeration type may be used it includes these two types Formal Syntax Enumeration Identifier List Identifier List Identifier Identifier Identifier see4 1 2 2 Examples type Color White Red Green Blue Black type State Ready Active Suspended Representation in memory Enumeration values are represented like INTEGER the 32 bit word stores the ordinal value Daimler Benz Aerospace AG D 28199 Bremen All Ri
36. DEC x This procedure decrements the variable x by 1 If x is an enumeration type or CHARACTER value it is replaced by its predecessor DEC x n This procedure decrements the variable x by n Regardless of the type of x n must be an expression of type INTEGER or UNSIGNED_INTEGER If x is an enumeration type or CHARACTER value it is replaced by its n th predecessor INCL Procedure INCL s x This procedure includes the element x into the set variable s x must be an expression of the element type of s EXCL Procedure EXCL s x This procedure excludes the element x from the set variable s x must be an expression of the element type of s Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS e berarbtg Rev Datum Date 2010 01 29 ssrcr um Seite Page 4 80 von ot 4 96 PUT Procedure PUT S This procedure prints the string s on the standard output channel UNTYPED Function UNTYPED x This function supports low level conversion It removes the type from the expression x and makes it convertible to any other type For details see 4 12 4 2 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datu
37. DIN 34 end Split Time Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS M d berarbtg Rev Datum Date 2010 01 29 Seite Page 4 89 von of 4 96 function Time Of Year UNSIGNED INTEGER Month UNSIGNED INTEGER Day UNSIGNED INTEGER Seconds DURATION TIME variable Overlay Time Overlay begin Check for validity and handling of and dateless times omitted for simplicity Int UNSIGNED INTEGER LONG REAL Seconds truncate Fraction Seconds DURATION LONG REAL Int Overlay Word 1 Year 1900 2 24 Month 2 20 Day 2 15 Int 2 2 Overlay Word 2 Int 2 2 2 30 UNSIGNED INTEGER LONG REAL Fraction LONG REAL 2 30 return Overlay Time Fielg end Time Of end Time Library Example 3 The following library does not need a body It contains no executable parts but only passive declarations It might be implemented both as a user library or as a system library non SI engineering units inch foot yard mile ounce pound grain hundredweight ton degree Celsius degr Fahrenheit Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Library specification This library defines a set of useful library Non SI Units
38. Date 2010 01 29 rium Seite Page 4 54 vonlof 4 96 4 12 4 Type Conversions Expressions of one type may be converted to certain other types UCL provides the following types of conversions e high level conversions between closely related types low level conversions to circumvent typing rules string conversions to convert between values and their textual representation 4 12 4 1 High Level Conversions High level conversions preserve the strong typing properties of the language they can only be done between closely related types A type conversion is specified by prefixing the expression to be converted in parentheses with the name of the target type one of the above A type conversion is an expression syntactically it corresponds to a function call Note that type conversions done automatically by the compiler may be written explicitly as well Type Conversion Qualified Identifier Expression String Conversion String Conversion see 4 12 4 3 Qualified Identifier see 4 3 4 Expression see4 12 Formal Syntax Scalar and byte string to BYTE WORD LONG WORD Conversion BYTE 8 bit_scalar_value 1 element byte string WORD 32 bit scalar value or 4 element byte string LONG WORD 64 bit scalar value or 8 element byte string These conversions are implicitly carried out whenever necessary see 4 8 1 7 They may however also be done explicitly Examples B BYTE x ch
39. Declaration Alias Declaration Identifier Formal Parameters Derived Value Import Unit Declaration Constant Declaration Type Declaration Variable Declaration Alias Declaration If Statement Case Statement Return Statement Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe ssue 5 Datum Date 2009 02 01 EADS nna berarbtg Rev Datum Date 2010 01 29 rium Seite Page D 2 von of D 7 Declarations Import import Name Definition Unit Declaration Constant Declaration Type Declaration Variable Declaration Alias Declaration Procedure Heading Function Heading Declaration Unit Declaration Constant Declaration Type Declaration Variable Declaration Alias Declaration Procedure Declaration Function Declaration Unit Declaration unit Unit Identifier Unit Constant Declaration constant Identifier Constant Type Constant Expression Constant Type Qualified Identifier Unit string statecode pathname 2 Type_Declaration type Identifier Type Variable Declaration variable Identifier Variable Type Constant Expression Variable Type Qualified Identifier Unit String Type statecode pathname pia Alias_Declarati
40. HK_TM HK_PFE DC_POWER_SUPPLY XTP0104 EGSE HK_TM HK_PFE DC_POWER_SUPPLY XTP0804 Example alias FNY1016 PLM INSTR SARR_TM_FLIGHT RTRF FNY1016 alias FNY1017 PLM INSTR SARR_TM_FLIGHT RTRF FNY1017 alias FNY1019 PLM INSTR SARR_TM_FLIGHT RTRF FNY1019 alias FNY1020 PLM INSTR SARR_TM_FLIGHT RTRF FNY1020 if FNY1016 gt 0 1 A amp FNY1019 gt 10 0 V then return 2 elsif FNY1017 gt 0 1 A amp FNY1019 gt 10 0 V then return 3 elsif FNY1016 gt 0 1 A amp FNY1020 gt 10 0 V then return 4 elsif FNY1017 gt 0 1 A amp FNY1020 gt 10 0 V then return 5 else return 1 end if Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 94 von of 4 96 4 17 Privileges and Authorization Systems using UCL may assign user privileges to users and to single entities managed by the system such as commands measurements variables APs libraries and other items maintained in the Mission Database Furthermore individual library procedures and functions can be assigned privileges A privilege is named with a single identifier that corresponds to UCL identifier syntax Any number of privileges may be defined and any subset of privileges may be assigned to users and items
41. Page G 6 von of G 6 cgs e EADS 6 3 Non SI Units For convenience the following non SI units are also supported Unit Sym Supported multiples of this unit Definition lin 25 4 mm inch in An inch is defined to be exactly 25 4 mm It is used as the base unit for imperial lengths 1ft 12in lyd 3 ft 1 mi yd 1 Ib 453 592 g foot ft yard yd mile mi pound Ib A pound is defined to be exactly 453 592 It is used as the base unit for imperial masses 1 02 1 16 Ib 1 gr 1 4371 oz 1 cwt 112 lb 1 ton 20 cwt 1 degF 10 18 degC 320 18 ounce OZ grain gr hundredweightcwt ton ton degree Fahrenheit degF Quantity length mass temperature G 4 Prefix Names and Values The SI prefixes also in the ISO 1000 standard are used with the unit symbols defined above should be U mu but this is not in the ASCII character set Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 1018 1015 1012 10 106 103 exa peta tera giga mega kilo hecto deca deci centi milli micro nano pico femto atto 2 5 2 2 m Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page H 1 von of H 1 Appendix H Implementation Constraints The following restrictions are n
42. Printable eol Printable any of the printable Characters in the underlying character set eol end of line Examples unit cwt 112 1b lt hundredweight variable Default Width Integer 10 Default output width for numeric values gt Changing this value will globally change the output format type States Enabled gt Device switched on Disabled lt Device switched off Locked gt Access to device blocked gt Possible states of a device type Device record Name string 20 gt Device nam Address Unsigned Integer gt Device address State States gt Current state of device end record Description of a device procedure Enqueue in out Container Queue gt queue container in Element Object gt element to be enqueued Append an element to the end of the queue gt If queue is full global Status is set to Failed begin end Enqueue Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS berarbtg Rev Datum Date 2010 01 29 Seite Page 4 17 vonlof 4 96 4 7 Constant Declarations A constant declaration associates an identifier aname with a value The associated value must be a constant or a constant expression The latter is an expression consisting of literal consta
43. Set Constant Date Time Time Statecode Designator Function Call Type Conversion Expression Primary Designator Name Identifier Expression List Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS ed berarbtg Rev Datum Date 2010 01 29 Seite Page 4 50 voniof 4 96 Slice Designator Expression Expression Name see 4 3 4 Expression_List Expression Expression Number Simple_Integer Based Integer Real Identifier see4 1 2 2 Simple Integer see4 1 2 4 1 Based Integer see 4 1 2 4 1 Real see 4 1 2 4 3 String see 4 1 2 7 Character see 4 1 2 6 Set_Constant see 4 8 2 3 Date see 4 1 2 8 Time see 4 1 2 8 Statecode see 4 1 2 5 Function Call see 4 12 3 Type_Conversion see 4 12 4 Unit see 4 1 Constant expressions An expression may be required to be constant Constant expressions are expressions whose operands are all constants or constant expressions such that its value can be determined at compilation time Constant_Expression Expression 4 12 1 Operands The various components of an expression are called operands Valid operands are e literal constants see 4 1 e declared or imported constants see 4 4 and 4 2 e declared or imported varia
44. UNSIGNED_INTEGER expression A B same as A b I 1 J 1 same as I 1 J 1 A N B same as A N B A N M same as A N M associates right to left A N M same as A N M associates left to right 4 12 2 1 Arithmetical Operators Symbol Operation addition subtraction multiplication division exponentiation modulus oe All operators apply to variables of the type INTEGER UNSIGNED INTEGER and their subranges The operators and apply to REAL and LONG REAL variables The operators and apply to TIME and DURATION variables as well For exponentiation however the right operand called the exponent must be of the type INTEGER UNSIGNED INTEGER and the result type is the type of the left operand Further the operators and may be used as unary operators to denote the sign of a number Integer division and modulus are defined by the relation A A B B A B where A B has the sign of A and an absolute value less than the absolute value of B During divisions and modulus operations a runtime error occurs if the right operand is zero Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page
45. a new value The item keeps its old value The expression will typically involve the runtime value of other database items but it can also use constants declared locally as well as constants and variables imported from libraries and it may call imported functions A derived value may access itself in which case its old value will be used Indirect cyclic references through other items are not allowed Termination of execution must always be explicitly done through a return statement otherwise a runtime error will occur There may be more than one return statement Derived value items may be used in other compilation units via their pathname in order to obtain their current value like any other database item that has a value Formal Syntax Derived Value Import Unit Declaration Constant Declaration Type Declaration Variable Declaration Alias Declaration If Statement Case Statement Return Statement Import 466 2 Unit_Declaration 866 1 Constant Declaration see 4 Type_Declaration see 4 8 Alias_Declaration see 4 10 If Statement see 4 13 3 Case_Statement see 4 13 4 Return_Statement see 4 13 6 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS na berarbtg Rev Datum Date 2010 01 29 Seite Page 4 93 von of 4 96 Example return EGSE
46. a variable associated with a constant or passed as a parameter are of one of the subitem types allowed for the target object All declared subitem pathname types are subtypes of the general predefined type pathname Formal Syntax Pathname Type pathname Identifier List Identifier_List Identifier Identifier Identifier see 4 1 2 2 Examples type Subitem pathname unconstrained type Input pathname FB_IO_INPUT constrained to FB_IO_INPUT procedure P X pathname begin end P unconstrained parameter procedure 0 X Input begin end O constrained parameter Note that all checks concerning constraints of subitem pathname types are performed at compilation time not at runtime Whenever a subitem pathname value is assigned to a variable or passed as a parameter it is checked that the type of the source value has at least the constraints of the target object Example procedure P X pathname Y Input variable P pathname variable I Input begin P X OK P may be assigned any type of subitem pathnames P Xy I X Error X is not constrained at all but I is I Y OK Same constraints on both sides 0 X Error Formal parameter is constrained but X is not 0 OK Formal and actual parameter have same constraints end P Representation in memory Subitem pathname values are represented as two 32 bit words
47. and must be recompiled Likewise when an item is changed or recompiled its privileges may have changed and so may the privileges of the depending item Hence all items depending on this item directly or indirectly must be recompiled The compiler will keep track of all dependencies and enforce recompilations where necessary Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS E d berarbtg Rev Datum Date 2010 01 29 Seite Page 5 1 vonlof 5 1 5 Compilation 5 1 References and Dependencies When a compilation unit references another unit by importing it or just by using its pathname or alias in the source text this reference creates a dependency between the two compilation units All references are kept in the database and checked by the compiler The kind of reference determines the strength of the dependency and possibly consequences for the compilation process e g e Simple references like declaring an alias for a pathname or using the pathname as a non parameterized subprogram parameter just require the referenced unit to exist e References to the value of an item e g a sensor or a software variable imply a dependency on the item s software type properties thus changing the referenced item will invalidate the referencing compilation unit It is no longer up to date
48. detail UCL predefines the seven base units defined by the international system of units Systeme Internatio nale d Unit s SD but allows the user to define additional base units It can handle all units derived from these base units by means of the usual arithmetical operations as shown above Additional unit names can then be defined for units derived from existing units by means of UCL unit declarations For a defi nition of the SI base units see the ISO 1000 standard annex B Quantity Unit SI symbol UCL symbol length meter m m mass kilogram kg kg time second S S electric current ampere A A temperature kelvin K Kabs temperature difference kelvin K K amount of substance mole mol mol luminosity candela cd cd Note the distinction made between temperature and temperature difference expressed with different UCL unit symbols Kabs K absolute and K This is necessary to allow conversions between e g C and K The temperature relationship 0 9C 273 15 K is not reflected for temperature differences where 9C 21K 4 11 2 Counting Units Beside the normal physical units UCL supports counting units like pair or dozen These are pseudo units that represent a grouping of non dimensional quantities All counting units are commensurable with one another and with pure scalar values They are resolved to scalar values whenever appropriate Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34
49. floating point format 4 8 1 4 Type LONG REAL Values of the type LONG REAL represent approximations of the mathematical real numbers like the REAL type but with a better precision and a larger exponent range Their range is given by the predefined constants MIN LONG REAL and MAX LONG REAL corresponding approximately to the range 1 7969E 308 to 1 7969E 308 The syntax of LONG REAL literals is the same as for REAL values and the same operators may be applied Note that values of type REAL are compatible with those of type LONG REAL and vice versa Thus mixed expressions consisting of both REAL and LONG REAL values are allowed Representation in memory A LONG REAL value is internally represented as two 32 bit words in IEEE standard double floating point format 4 8 1 5 Type BOOLEAN The standard type BOOLEAN is an enumeration type defined as follows type BOOLEAN FALSE TRUE All properties and operations defined for enumeration types apply to BOOLEAN as well For a definition of enumeration types see 4 8 1 11 In addition there are three special BOOLEAN operators amp corresponding to and or and not respectively Representation in memory A BOOLEAN value 18 internally represented like enumeration types FALSE 0 TRUE 1 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001
50. in parentheses asin INTEGER 10 100 The two dots are part of the syntax Formal Syntax Subrange Qualified Identifier Constant Expression Constant Expression Qualified Identifier see 4 3 4 Constant_Expression see 4 12 Examples type Index INTEGER 0 25 type Light Colors Colors Red Blue type Digit CHARACTER 0 9 Representation in memory Subrange values are represented like values of their base type Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 26 voniof 4 96 4 8 2 Structured Types 4 8 2 1 Array Types An array is a structure consisting of a fixed number of components which are all of the same type Each component can be denoted and directly accessed by the name of the array variable followed by the array index in parentheses e g A i indicates the i th element of the array A For matrices A i j or A i j are both valid ways to access an element where i is the row and j the column of the matrix The number of dimensions of an array is determined by the number of indices it is not restricted by the language A runtime error occurs if the array index is outside the defined ranges Each index belongs to a speci
51. is located behind all other scopes i e its identifiers will be hidden by equal identifiers declared in any other scope Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 12 voniof 4 96 4 3 4 Qualified Identifiers A qualified identifier is an identifier prefixed with a pathname or alias designating the library or other importable module in which the qualified identifier is defined The prefix and the identifier are separated by a period dot The qualified form can be used to access imported objects It is the only way to access imported objects whose identifier is hidden Predefined identifiers can be qualified by preceding them with just a single dot e g INTEGER MIN LENGTH This may be used to access a predefined identifier if it is hidden by a local declaration of the same identifier The qualified form can also be used to access identifiers predeclared in the database The pathname denoting the database scope is the root pathname a single backslash Formal syntax Qualified_Identifier Name Identifier Simple_Name Identifier Path Identifier Pathname Name Simple_Name Identifier Pathname see 4 3 6 Identifier
52. of real numbers 24 575 5 8e3 300 6E 05 0 1E23 1 2e 3 0 000_000_1 4 1 2 5 Statecode Literals In the MDB a statecode is a literal constant identifying one specific state e g Open Closed of a discrete type MDB object When such an object is created like a switch or a valve its allowable states are also defined and appropriate symbolic names or statecodes assigned to them In UCL each statecode identifier must be prefixed by a dollar sign The following identifier may be up to 8 characters long not including the sign A special statecode literal is the constant 5 5 which stands for an undefined statecode value Formal syntax Statecode Identifier Identifier see4 1 2 2 Examples of statecode literals SOFF SACTIVE SOPEN SS 4 1 2 6 Character Literals A character literal consists of any one of the 95 graphic ASCII characters including the space character enclosed between single quotes apostrophe The single quote character itself is represented in a similar manner i e also enclosed between single quotes Examples of character literals Fr r a 1 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 4 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 46 von ot 4 96 4 1 2 7 String Literals Strings
53. of the line Note the contents of a comment are not interpreted Hence a comment may contain any characters even those prohibited outside a comment Anannotation is a special comment that can be attached to declared items It begins with an annotation marker gt and terminates with the end of the line Unlike a comment an annotation is not ignored by the compiler but kept as a textual description of the item It can be displayed in an HLCL command window as part of the help information for the item For a description of annotations see 4 4 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 2 vonlof 4 96 4 1 2 Lexical Elements The text of a UCL program may consist of the following lexical elements delimiters identifiers predefined and user defined and literals numeric character string state code time and unit literals 4 1 2 1 Delimiters Delimiters are either one character or two consecutive characters used as punctuation symbols or as operators They are listed below left parenthesis right parenthesis asterisk multiplication operator exponentiation operator plus addition operator comma minus subtraction operator dot double dot range symbol slash division operator percent modulus op
54. parameter it is checked that the type of the source value has at least the constraints of the target object Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS nna berarbtg Rev Datum Date 2010 01 29 Seite Page 4 35 von of 4 96 Example type Measurement pathname EGSE_INTEGER_MEASUREMENT EGSE_FLOAT_MEASUREMENT procedure P X pathname Y Monitor Item Z AP Item variable P pathname variable M Measurement variable A AP Item begin P X OK P may be assigned any type of pathnames P Y P 7 even parameterized pathnames Y Error M is more constrained than M X Error X is not constrained at all but M is A 2 OK Non parameterized access to parameterized item Execute Z OK Z is parameterized and thus accepted by Execute Execute A Error A is not parameterized even if Z was assigned end P Representation in memory Non parameterized pathname values are represented as one 32 bit word containing the short identifier SID of the item as an unsigned integer Parameterized pathname values can only occur as parameters to a subprogram When the subprogram is called a parameter block is constructed in memory that describes the item together with its act
55. that imports the library An item must be compiled before any compilation unit that passes it as a parameterized parameter Before executing an AP all its constituents including bodies must be compiled The compiler provides both a single compilation mode to compile one specific compilation unit and a special make mode that recompiles not only the unit itself but also all constituents of all units referenced directly or indirectly in a valid order and leaves the compilation unit in complete state Moreover in make mode the compiler performs only the necessary steps 1 e constituents that are already up to date will not be compiled So in case the unit is already complete the compiler will do nothing Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 S Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page von of APPENDICES Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 CGS RIBRE STD 0001 Dok Nr Doc No C 5 Ausgabe lssue e berarbtg Rev Seite Page EADS astcrium Appendix A Acronyms Automated Procedure Attached Pressurized Module Laboratory American Standard Code for Information Interchange Backus Naur Form syntax Core Simulation Software DataBase Data Management Subsystem Extended Backus Naur Form Electri
56. to Blue do statement sequence end for type Level statecode SLOW for L in Level do Process L end for Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 72 vonlof 4 96 4 13 6 return Statement A return statement consists of the keyword return possibly followed by an expression It indicates the end of a procedure or function execution There may be several return statements in one procedure or function although only one will be executed In a function the return statement is mandatory and it must be followed by an expression which specifies the value returned by the function In a procedure the return statement is optional It is implied by the end of the procedure body When a return statement is executed control returns to the caller of the procedure or function In a Derived Value the return statement terminates execution and returns the computed value It may be used with or without an expression see 4 16 4 for details Formal Syntax return Expression Return_statement Expression see4 12 Examples return I J in a function return in a procedure 4 13 7 halt Statement The halt statement is used within an AP to terminate the AP itself It further provides an optional facility for reporting the AP completion status successful non successful to the runtime sy
57. unit in 0 0254 m unit ft 12 in unit yd EER unit mi 1760 yd unit oz 0 282495 unit lb 16 oz unit gr 10 7000 unit cwt 112 1b unit ton 20 cwt unit degC 273 15 Kabs unit degF 10 degC 18 320 18 end Non_SI_Units Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nna berarbtg Rev Datum Date 2010 01 29 Seite Page 4 90 von of 4 96 The following system library declares explicitly numbered subprograms The numbers are non contiguous in order to group related subprograms Example 4 The subprograms are annotated Library specification library IO Library gt Simple input output operations lt The subprograms operate on standard input and standard output Input operations 1 procedure Get Char out C CHARACTER Read character from standard input 2 procedure Get String out 5 string gt Read string from standard input 3 procedure Get Integer out I INTEGER gt Read an Integer literal from standard input 4 procedure Get Real out R REAL gt Read a Real literal from standard input Output operations 11 procedure Put Char C CHARACTER Write a character on standard ouput 12 procedure Put String S string Width INTEGER 0 Write a character on standard ouput 13 procedu
58. unitized value 1 0 m s 1 0 m s Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 Seite Page 4 63 von ot 4 96 4 13 Statements The following kinds of statements are supported in UCL e Assignments e Procedure calls Conditional statements if case e Iteration statements while repeat loop for e Others exit return halt UCL requires each statement to be terminated by a semicolon In many places a possibly empty sequence of statements is allowed Individual statement descriptions follow Formal syntax Statement Assignment Procedure Call f Statement Case Statement While Statement Repeat Statement Loop Statement For Statement Halt Statement Exit_Statement Return_Statement Statement Sequence Statement 4 13 1 Assignment An assignment serves to replace the current value of a variable or an array or record element by a new value indicated by an expression The assignment operator is Variable and expression must be compatible see Section 4 8 6 The designator to the left of the assignment operator must be a variable or an MDB item or subitem given by its pathname in the latter case the assignment changes the runtime value of the item or
59. 0 01 29 Seite Page 4 70 voniof 4 96 4 13 5 4 for Statement The for statement is used when a statement sequence is to be executed a known number of times while a progression of values is assigned to a control variable the loop index It takes two alternative forms 1 Iterative or statement for loop index start value to limit by increment do statement sequenc end for The iterative for statement is used to loop over a range of values whose start value and limit are explicitly specified The iterative for statement cannot be used for statecode types since statecode types are not ordered The type of limit must be compatible with the type of start value and the increment must be an INTEGER constant or constant expression 2 Collective for statement for loop index in type name by increment do statement sequence end for The collective for statement is used to loop over all values of a discrete type including constrained statecode types For non statecode types the start value and limit are implicitly determined by the min and max value of the type Since statecode types are unordered the order in which the values are processed is undefined and the by clause cannot be used The increment must be an INTEGER constant or constant expression Note that start value limit and increment are evaluated only once and in that order before the loop body Further the value of the index c
60. 2 Examples Assuming the following procedure declarations procedure Calculate New Limit Threshold REAL Ref Factor REAL out New Limit REAL procedure Get Total First REAL 0 0 How many INTEGER 50 out Total REAL procedure Finish Up then these are valid procedure calls Calculate New Limit Rvall Rval2 Rlim Calculate New Limit 100 0 2 5 Rlim Get Total 5 5 Total T Get Total First 5 5 How Many 100 Total T Get Total Total T Finish Up Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS mea berarbtg Rev Datum Date 2010 01 29 Seite Page 4 66 von of 4 96 4 13 3 if Statement The if statement denotes conditional execution of one or more statements It takes the form if condition 1 then statement sequence 1 elsif condition 2 then statement sequence 2 elsif else statement sequence 1 end if where condition 1 and condition 2 are Boolean expressions These expressions are evaluated one after the other and as soon as one yields the value TRUE the corre sponding statement sequence is executed and no further conditions are tested The else part if pres ent is executed if none of the conditions was true The e1sif and else parts are optional Formal Syntax If Statement
61. 4 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page G 5 von of G 6 Definition GOhm m MOhm m KOhm m mOhm m Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 cgs Sym Supported multiples of this unit A m2 A mm2 A m A mm Wb m H m uH m nH m A m2 A mm Wbm Ohm m S m MS m kS m 1 H W sr W sr m2 W m2 ims cd m2 Im m2 lx s Im W N s m kg mol g mol m3 mol l mol KJ mol J mol K mol m3 mol kg e EADS SI unit A m A m Wb m H m Am A m Wbm Om S m H Wisr W sr m W m ims cd m Quantity current density linear current density magnetic vector potential permeability electromagnetic moment magnetization magnetic dipole moment resistivity conductivity reluctance radiant intensity radiance irradiance quantity of light luminance luminous exitance Im m lxs Im W N s m kg mol m mol J mol J mol K mol m mol kg light exposure Iuminous efficacy mechanical impedance molar mass molar volume molar internal energy molar heat capacity concentration of substance B molality of solute substance B Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite
62. 4 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS ee berarbtg Rev Datum Date 2010 01 29 asEcr um Seite Page G 1 von of G 6 Appendix G Engineering Units This section is based on the International Standard ISO 1000 SI units and recommendations for the use of their multiples and of certain other units G 1 Base Units The international system of units Systeme International d Unit s SI defines seven base units For a definition of the SI base units see the ISO 1000 standard annex B Quantity Unit SI symbol UCL symbol 1 length meter m m 2 mass kilogram kg kg 3 time second 8 8 4 electric current ampere A A 5 temperature kelvin K Kabs temperature difference kelvin K K 6 amount of substance mole mol mol 7 luminosity candela cd cd Note that UCL makes the distinction between absolute temperature Kabs and temperature difference K The distinction is necessary to allow conversions between e g C and K in particular the relationship 0 C 273 15 Kabs does not hold for temperature differences G 2 SI Units In the table of SI units given below the column SI unit refers to the name of the unit as defined by ISO 1000 and the international system of units Systeme International d Unit s SI or to unit names composed by SI unit names e g m s The column Sym symbol shows the recommended string to be used in UCL to denote such a unit the
63. 82045 reed eier 4 26 4 8 2 2 Record Types urs 442s 4414 Ra RR i n EATER HERES GRE 4 28 DE CAN Ng PPM 4 30 3 5 14 Type BITSET 2 22 68 26 RE TRECE lese REPRE 4 31 2 82 5 Srina Ly Pes 2202 oe nen te dhe ech see kn ee 4 32 25 3 Palhname Iypes s scorso nee 02 0568058 er 4 34 4 8 4 Subitem Pathname Types 2 2202022222 nenn 4 36 4 8 5 Inherited pen see ee ches cher 4 37 4 8 6 Compatibility of Types i RE RR 3 REEREXGa ec 4 38 4 8 6 1 General Rules iesus ee Rx EG DN TUE AE a a RR d 4 38 4 8 6 2 Structural Compatibility 422 4040 s Rhea RR en 4 39 47 Variable Declarations 411800 ee ee 4 40 4 8 Alias Declarations 4252 v ea rh ee ER RA nen sh 4 41 4 9 Unitized Values and Types eeeeeeeeee ehh nnn 4 42 4291 M as re 25 4 dads Saa ede op daos qw ews 4 42 4 9 2 Counting Units ica c bL ea ke 442 2 0 5 Predefined UMIS ous edu huh cose eke oe ye eles elie Bow dod es eke oe 4 43 4 94 Unit Declaration gt gt gt 24384 N rear ee 4 43 4 9 5 Unit Syntax gt 25 nen 865 RES eda E Rd EA d RE da 4 44 4 9 6 Unitized Types aussen e acr neuer een elc E egg 4 45 4 9 7 Unitized Variables and Constants 2022222225 4 45 4 9 8 Compatibility of Unitized Types 0000202222252 eee 4 45 4 9 9 Unitized Literals amp Constants san er md hd Ioa ded aed 4 46 4 9 10 Expressions with Unitized Values 022 4 46 4 9 1T Unitized Integer Values 222
64. B objects fall into several classes or types The item type of an MDB object not to be confused with the corresponding UCL type defines the object s characteristics or properties and by implication the semantic rules governing its usage In the UCL environment several kinds of operations or user interactions may be performed on MDB objects In particular all monitoring and control operations measurement acquisition stimuli commands etc are performed via dedicated system library procedures functions Also other kinds of interactions are available via a system library e g a procedure that causes a specific MDB object of type automated procedure to be executed A pathname designator tells the UCL compiler to retrieve an object s definition classification type etc from the Mission Database to check its semantics Depending on the context a pathname designa tor represents either a value or a reference to an MDB item In assignments expressions conditions or when used as parameters of a type other than pathname pathname designators refer to objects whose runtime values may change independently of the execut ing UCL program e g value of sensor data periodically updated by data acquisition software In all other cases they are references to specific object definitions in the MDB A pathname designator by itself does not refer to any particular occurrence or version of the object Such information must be provided to the compiler
65. DB item allows faster retrieval identifier character string denoting one of many possible states of a discrete end item e g SOPEN SCLOSED SHIGH SMEDIUM LOW any lower level item in the SW architecture e g module object Test and operations language used for real time control amp monitoring purposes in both the onboard and ground environment Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 EADS _ sscr um Parent Pathname Semantics Short identifier SID Statecode Unit User Control Language Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe lssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page B 3 von of B 2 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 im plenario Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EA D 5 pera berarbtg Rev Datum Date 2010 01 29 Seite Page C 1 1 Appendix 6 DELETED Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe ssue 5 Datum Date 2009 02 01 EA D 5 n berarbtg Rev Datum Date 2010 01 29 Seite Page D 1 von of D 7 Appendix D UCL Syntax The following syntax definition uses the variant of BNF described in section 3
66. Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 13 vonlof 4 96 4 3 6 MDB Objects Pathnames Mission Database MDB objects are by default visible to the UCL program i e they need not be explicitly declared Their definitions are inherited from the MDB An MDB object or MDB item is identified by a pathname reflecting its respective position in the hierarchical name tree Some MDB items may have subitems These are denoted by a subitem pathname i e an identifier prefixed with the pathname of the MDB item separated with a dot Note that the subitem identifier may be identical to a reserved word Formal syntax Pathname V Path Identifier Path Identifier Subitem Pathname Path Identifier Path Identifier Identifier Identifier see4 1 2 2 Path Identifier see 4 1 2 3 Examples NAPMNPAYLOADNEQUIPMENT UNIT A a pathname NAPMNPAYLOADNEQUIPMENT UNIT A INPUT 1 a subitem pathname MDB objects may have parameters e g APs messages stimuli It depends on the program context whether or not an actual parameter list must be supplied with the pathname of such items see 4 8 3 for details The parameter list is then given together with the pathname e g NEGSENTESOINAP 1 3 14 MD
67. Datum Date 2009 02 01 EADS nna berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 79 von of 4 96 HIGH Function HIGH a returns the uppermost index of the array or string type or variable a The return value has the type of the corresponding index for open arrays and strings it is always INTEGER HIGH a n returns the uppermost index of the n th dimension of the multidimensional array type or variable a The return value has the type of the corresponding index LENGTH Function LENGTH a returns the current actual length of string a For an empty string LENGTH returns 0 The return value is of type INTEGER ODD Function ODD x returns the Boolean value TRUE if x is odd i e x 2 lt gt 0 else FALSE x must be of type INTEGER or UNSIGNED INTEGER INC Procedure This procedure increments a variable The parameter can be of any discrete type except statecode types INC x This procedure increments the variable x by 1 If x is an enumeration type or CHARACTER value it is replaced by its successor INC x n This procedure increments the variable x by n Regardless of the type of x n must be an expression of type INTEGER or UNSIGNED INTEGER If x is an enumeration type or CHARACTER value it is replaced by its n th successor DEC Procedure This procedure decrements a variable The parameter can be of any discrete type except statecode types
68. Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe lssue 5 Datum Date 2009 02 01 EADS cgs berarbtg Rev Datum Date 2010 01 29 ssEer um Dokument Typ Standard Document Type Titel User Control Language UCL Reference Manual Title Lieferbedingungs Nr Klassifikations Nr DRL DRD Classification No Produktgruppe Konfigurationsteil Nr Product Group Configuration Item No Schlagw rter UCL Porduktklassifizierungs Nr Headings User Control Language Classifying Product Code AP Freigabe Ordnungs Nr Release Orde No Bisherige Dok Nr CGS RIBRE STD 0001 previous doc no EADS Astrium Bremen Unternehmen Company EADS Astrium Bremen Unternehmen Company EADS Astrium Bremen Unternehmen Company Unternehmen Company Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Automated Procedure Bearbeitet Franz Kruse Org Einh TE 55 Prepared by Orgin Unit Gepr ft Stephan Marz Org Ein TE 55 Agreed by Orgin Unit Genehmigt J rgen Frank Org Einh TE 55 Approved by Orgin Unit Genehmigt Org Einh Approved by Orgin Unit Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 1 berarbtg Rev Datum Date 2010 01 29 Seite Page l von of V 5 DOCUMENT CHANGE RECORD DESCRIPTION OF CHANGE First version including 32 bit UNSIGNED INTEGER type Database aliases nicknames
69. ER type 4 21 commensurable unit 4 42 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page I 2 von of 4 LONG_WORD type 4 21 loop index 4 70 implicitly declared 4 70 loop statement 4 68 LOW function 4 26 4 32 4 74 4 78 low level conversion 4 59 4 80 low level programming 4 28 Low Level Type 4 21 MAX function 4 19 4 20 4 21 4 23 4 78 MDB 3 1 4 13 MDB item 4 13 MDB object 4 13 MIN function 4 19 4 20 4 21 4 23 4 24 4 25 4 78 Mission Database 3 1 4 13 multidimensional array 4 26 N name 4 10 name tree 3 2 3 nickname 4 11 4 41 no pathname 4 3 node name 4 15 numeric literal 4 4 0 ODD function 4 19 4 79 open array 4 65 4 74 open string 4 65 4 74 operand 4 50 operator 4 51 out parameter 4 64 4 74 6 overlay 4 28 P path identifier 4 3 pathname 4 3 4 13 pathname type 4 18 4 34 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 605 cgs rium for statement 4 70 formal parameter 4 74 formal parameter list definition 4 91 4 92 function call 4 53 function declaration 4 76 H halt statement 4 72 HIGH function 4 26 4 32 4 74 4 79 HLCL 3 1 10 format 4 62 identifier 4 3 4 10 if statement 4 66 implementation constraints 1 import 4 9 4 82 in out para
70. Identifiers 0 22 SEXE REX ker 4 10 4 3 3 Database Scope and Aliases nicknames 5 4 11 4 3 4 Qualified Identifiers 222 4 12 4 3 5 Lifetime of Objects u ee eines Ta T SEXE 4 12 4 3 5 MDB Objects Pathnames 2u0u 4 dass 4 13 4 3 7 Node Names 0 4 15 4 4 Annotations 6 19 ee ane i rie 4 16 4 5 Constant 1200172 1105 n n n 4 17 4 8 Type Decliralolls 2 13 9 43 ee 4 18 4 8 1 Elementary Types 00 20 224 0 8 4 19 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok NriDos No CGS RIBRE STD 0001 EADS C 5 Ausgabe lssue 5 Datum Date 2009 02 01 SPACE berarbtg Rev Datum Date 2010 01 29 TRANSPORTATION Seite Page I von of V 4 8 1 1 Type INTEGER 0 a ana 4 19 4 8 1 2 Type UNSIGNED INTEGER 242 2i2003 lt dnh ces edeadovedenied 4 19 4 8 1 3 Type REAL 2 24 62 32 65 8265 EE ERE ecra RE RP S EPI PE 4 20 4 8 1 4 Type LONG REAL 4 20 ORAS Type BOOLEAN unse 4 20 4 8 1 6 Iype CHARACTER 6 5 65 520 0 4 21 4 8 1 7 Low Level Types BYTE WORD LONG WORD 4 21 d 5 15 Statecode Types 24 022 G serie 4 22 4 8 1 9 Types TIME and DURATION eese 4 23 4 8 1 10 Type COMPLETION CODE 2 44 4 24 4 8 1 11 Enumeration Types used 3E E RPSPEA RE EE ERE RS 4 24 45 1 12 Subrange Types 2 22 t RR ea a as 4 25 4 8 2 Structured Types Los gt gt 0500 4 26 4 8 2 1 Attay VDOS 22043542
71. L compiler see Appendix H Adjacent lexical elements may be separated by one or more special characters e g blank space called separators Separators are allowed between any two tokens and also before the first and after the last token in particular the end of a line is a separator Within lexical elements separators are not allowed except if a separator is part of the element character and string literals A separator is mandatory whenever its absence would result in an ambiguous token sequence For example it is not required between identifiers and non alphanumeric symbols e g the arithmetical operators but it is required between identifiers and keywords or numeric constants Thus A B C is equivalent to A B C However IFA B THEN is invalid because of the missing separator between the keyword if and the identifier A The UCL separators are e Blank space Horizontal tabulator e Vertical tabulation character LF line feed and VT vertical tabulator e End of line e Page separator ASCII form feed FF character M Annotation e Comment These ASCII graphic symbols printable characters and the separator symbols are the only characters allowed in UCL source code The other non graphic symbols so called control characters e g backspace or escape are not allowed except in comments see below and are rejected by the UCL compiler A comment begins with two consecutive hyphens and terminates with the end
72. NSIGNED INTEGER type 4 19 UNTYPED function 4 59 4 80 V variable declaration 4 40
73. Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 38 von ot 4 96 4 8 6 Compatibility of Types 4 8 6 1 General Rules Whenever a value is assigned to a variable passed as a parameter to a subprogram or used as an operand in an operation it is required that it be compatible to the target object or to other operands in the operation Usually two objects are compatible if they are of the same type they are incompatible if they are of different types Two types declared in different type declarations are considered different and incompatible types even if the declarations are identical except in the following cases e The type is declared to be identical to another type In this case both type identifiers denote the same type e The type is declared to constrain some other type In this case the type is a subtype of the other type All subtypes of the same base type are compatible to the base type and to each other For some closely related types a value of one type is implicitly converted to the other type if needed e INTEGER and UNSIGNED INTEGER types are always compatible REAL and LONG REAL types are always compatible CHARACTER values are compatible to string values in certain contexts see 4 8 2 5 Values of certain types may be explicitly converted to certain other types without violating the strict
74. SE VICOS SYSTEM alias Lib SystemNGROUND LIBRARY asubitem pathname alias Input 1 NMAPMNSIMULATIONNPAYLOADNEQUIPMENT UNIT A INPUT 1 e aqualified name an identifier prefixed with the pathname of an imported module e g a library import EGSE VICOS SYSTEM GROUND_LIBRARY alias Issue EGSE VICOS SYSTEM GROUND_LIBRARY Issue Note that for any compilation unit the name identifier of the unit is implicitly declared as an alias for the pathname of the unit see 4 16 1 4 16 2 and 4 16 3 When importing a library or some other module the name alias of the module is imported together with the other identifiers from the module and may then be used instead of the long pathname import EGSE VICOS SYSTEM GROUND_LIBRARY alias Issue Ground Library Issue Formal Syntax Alias Declaration alias Identifier Name Name see4 3 4 Identifier 466 2 Please note that the Mission Database may itself predefine a set of aliases called nicknames see 4 3 3 These predefined aliases may be used like any user declared alias Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 Seite Page 4 42 vonlof 4 96 4 11 Unitized Values and Types The types and valu
75. TA MI type inherited from database variable M Matrix M APM EGSE DATA M1 M and APM EGSE DATA M1 have the same typ Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 40 vonlof 4 96 4 9 Variable Declarations A variable declaration associates a variable with a unique identifier and a data type The type determines the set of values that the variable may assume and the operators that are applicable it also defines the structure of the variable see 4 8 Type Declaration In a variable declaration either a predefined type as in example a or anamed user defined type may be specified as in example b String variables may be declared directly where the maximum length is specified within the variable declaration see example c A variable declaration is introduced by the reserved word variable followed by the name of the variable an identifier A colon introduces the type Optionally the variable may be given a constant initial value indicated with the assignment symbol If no initial value is given the value of the variable is undefined Using an uninitialized variable is an error that is not automatically detected Formal Syntax Variable Declaration var
76. UCL typing rules see 4 12 4 For formal array and string parameters of subprograms there are open forms that allow for less restrictive compatibility rules see 4 13 2 and 4 12 3 For unitized types in addition to type compatibility compatibility and commensurability of the involved measurement units must be observed see 4 11 Examples type Arr 1 array 1 10 of REAL different types type Arr 2 array 1 10 of REAL although textually identical type Number INTEGER identical types type Arr 3 Arr 1 type Short INTEGER 0 2 16 1 subtypes type Switch statecode SOFF SON cd type Node pathname EGSE NODE type Input pathname FB_IO_INPUT variable Al Arr 1 Al and A2 are incompatible variable A2 Arr 2 variable A3 Arr 1 A3 and 24 are compatible variable A4 Arr 3 Expressions are always evaluated in terms of the base type of the operands see 4 12 constraints are therefore not relevant But when a value is assigned to a variable or passed as a parameter to a subprogram it is checked that the value does not violate the constraints of the target variable see 4 13 1 or formal parameter see 4 13 2 and 4 12 3 The check whether a value violates a constraint is normally performed at runtime If the value is a constant und hence known at compile time the check will be done by the compiler Pathname and Daimler Benz Aerospace AG D 28199 B
77. _Library procedure Split Time in Item TIME out Year UNSIGNED INTEGER out Month UNSIGNED INTEGER out Day UNSIGNED INTEGER out Seconds DURATION function Time Of Year UNSIGNED INTEGER Month UNSIGNED INTEGER Day UNSIGNED INTEGER Seconds DURATION TIME packed components end Time Library Library body library body Time Library Use a record with variants to overlay time values year 1900 8 bits month 4 bits day 5 bits seconds since midnight fix point 47 bits 17 bits fore 30 bits aft type Time Overlay record case Tag BOOLEAN when False Word 1 UNSIGNED INTEGER Word 2 UNSIGNED INTEGER when True Time Field Time end case end record procedure Split Time in Item TIME out Year UNSIGNED INTEGER out Month UNSIGNED INTEGER out Day UNSIGNED INTEGER out Seconds DURATION variable Overlay Time Overlay begin Handling of and dateless times omitted for simplicity Overlay Time Field Item Year Overlay Word 1 2 24 1900 Month UNSIGNED INTEGER BITSET Overlay Word 1 20 23 2 20 Day UNSIGNED INTEGER BITSET Overlay Word 1 15 193 2 15 Seconds DURATION LONG REAL Overlay Word 1 2 15 2 2 DURATION LONG REAL Overlay Word 2 2 30 DURATION LONG REAL Overlay Word 2 2 30 LONG REAL 2 30 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per
78. abels i e a label may appear only once in a case statement The union of labels and label ranges in a case statements must cover all possible values of the selector type either explicitly or implicitly by an else branch that collects all label values not explicitly specified in previous branches If there is an else branch it must be the last branch in the case statement The case labels must be constants or constant expressions and they must be unique within a particular case statement i e no label may occur more than once When the same action is required for several different values of the case selector these values may be written in a list separated by commas Ranges of contiguous values may be written in range notation lower upper Statecode labels cannot form ranges because statecode types are unordered The type of all case labels must be compatible with the type of the case selector When the case statement is executed the selector 18 first evaluated If there is a case label with the same value as the case selector the corresponding statement sequence is executed Otherwise the statement sequence specified in the 61 56 clause if present is executed The else clause is optional if omitted however the specified case labels must cover the entire value range of the case selector type Formal Syntax Case Statement case Expression Case Case else Statement Sequence end case EN Case when Case Label Lis
79. ame an optional import list see 4 2 and an optional declaration part see 4 3 It is terminated by the keyword end The library s name may be repeated at the end after the end keyword in which case it obviously must match the name specified in the header The library name is implicitly declared as an alias for the library s pathname in the database This alias is visible to client units Only the entities declared in a library specification can be imported by other compilation units The declaration part may contain any kind of declarations but system libraries cannot declare variables For procedures and functions only the subprogram header is given the subprogram body must be given in the library body Subprograms declared in system libraries are identified in the system by a unique number This number is assigned implicitly starting at 1 but may also be given explicitly by prefixing the subprogram header with the number followed by a semicolon Implicit and explicit numbering may be mixed but as soon as explicit numbering is used all following subprograms must be explicitly numbered The numbers must be unique but need not be contiguous or in any order Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 ssrcr um Seite Page 4 86 von ot 4 96 Library
80. and will have to be recompiled A library body implies a dependency on its specification So before a body can be compiled its specification must be compiled and up to date mporting an item implies a dependency on its specification and hence requires the specification to be compiled and up to date before usage The body is not concerned it need not even exist e Passing an item as a parameterized parameter implies a dependency on its formal parameter list and hence requires the item to be compiled and up to date before usage e Using an item in a guarded position implies a dependency on that item s privileges see 4 17 Changing the privileges of referenced items requires the referencing compilation unit to be recompiled norder to execute an AP it must of course be complete 1 e it must be compiled and up to date which implies that all its references meet the above mentioned conditions and all its constituents including library bodies must be compiled and up to date as well The compiler will check all these different kinds of dependencies and enforce all mentioned conditions If any of its references fails to meet the conditions the unit cannot be compiled 5 2 Compilation Order A consequence of the conditions stated in 5 1 is that compilation units have to be compiled in a specific order A library specification must be compiled before its body A library specification must be compiled before any compilation unit
81. annot be altered by the statements inside the for loop The ordinal value of start value and limit for both forms must always lie within the bounds of type INTEGER The for statement causes the statement sequence enclosed in the for end for bracket to be repeatedly executed until the value of the index has covered all values of the range start value to limit or type After each iteration the oop index is incremented by the specified increment value which may be negative If no increment is specified 1 is assumed For a negative increment the values are processed in descending order In contrast to other forms of loop for loops always terminate A for statement with a positive increment is equivalent to the following loop Loop Index start value Saved Limit limit Saved Increment increment 1 by default while Loop Index Saved Limit do statement sequence Loop Index Loop Index Saved Increment end while With a negative increment the relational operator in the while statement would be The oop index need not be declared in the UCL program it is implicitly that is automatically created its type is derived from the type of start value and limit or from the specified type resp and its scope is limited to the body of the loop only Should an object of the same name exist it is hidden inside the for loop by the loop index and thus become inaccessible as shown in the followin
82. aracter to BYTE W WORD FF000000 byte string to WORD L LONG WORD SOFF statecode to LONG WORD REAL LONG REAL to INTEGER UNSIGNED INTEGER Conversion INTEGER real value INTEGER long real value UNSIGNED INTEGER real value UNSIGNED INTEGER long real value The result of this type conversion is the integer value obtained by truncating the value expressed by real valueorlong real value toward zero Examples INTEGER 3 6 value is 3 INTEGER 1 5 value is 1 INTEGER 1 3 value is 1 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS berarbtg Rev Datum Date 2010 01 29 Seite Page 4 55 von ot 4 96 INTEGER UNSIGNED INTEGER to REAL LONG REAL Conversion REAL integer value ONG REAL integer value REAL unsigned integer value ONG REAL unsigned integer value The result of this type conversion is the floating point value corresponding to the value of inte ger value or unsigned integer value Examples REAL I 5 value converted to floating point CHARACTER to INTEGER UNSIGNED INTEGER Conversion INTEGER character value UNSIGNED INTEGER character value The result of this type conversion is the integer co
83. ary body Identifier Import Declaration begin Statement Sequence end Identifier Definition Unit Declaration Constant Declaration Type Declaration Variable Declaration Alias Declaration Simple_Integer Procedure_Heading ELI Simple Integer Function Heading Import 466 2 Declaration see4 3 Statement_Sequence see 4 13 Unit_Declaration 866 1 Constant_Declaration see 4 7 Type_Declaration see 4 8 Variable Declaration see 4 9 Alias Declaration see4 l0 Procedure Heading see 4 14 1 Function_Heading see 4 14 2 Identifier see 4 1 2 2 i Simple_Integer see 4 1 2 4 1 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 87 von of 4 96 Example 1 This library keeps a buffer of pathnames The buffer implementation is invisible to the user the library provides operations to put get items in from the buffer and to inquire the number of items in the buffer Library specification library Pathname Buffer constant Buffer Size INTEGER 72 type Buffer_Error No_Error Buffer_Full Buffer_Empty procedure Put Buffer in Item pathname out Error Buffer Error procedure Get Buffer out Item pathname out Error Buffer Error
84. asily lead to overflows or underflows than for unitized real values e Divisions whose operands have units that are not commensurable but have common base units like 1 km h 1 min present a specific problem Due to its internal unit representation the compiler cannot decide how to adapt these units to each other Expressions of this kind are therefore not allowed This does not affect division of unrelated units like 1 kg m 1 s 1 kg m s e The right operand of the mod operator must not be unitized 1 m OK s not allowed e The increment parameter of the INC and DEC functions see 4 15 must not be unitized X 2 m s INC X OK X 3 m s INC X 2 OK X 5 m s INC X 2 m s not allowed Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 49 von of 4 96 4 12 Expressions Expressions are syntactical constructs used to calculate values of variables or generate new values They represent combinations of operands and operators whereby an operand may itself contain an expression 1 6 expressions can be constructed recursively At runtime when the expression is evaluated the respective current values denoted by the operands are combined using the specifi
85. ate 2010 01 29 rium Seite Page 4 82 voniof 4 96 4 16 1 Automated Procedures An Automated Procedure AP corresponds to a UCL main program An AP declaration consists of the following an optional import and declarations section before the AP header e an AP header e an optional list of imported libraries or other modules e an optional declarations section e a statement sequence bracketed by begin and end The AP header comprises the keyword procedure followed by the AP s name and an optional parameter list The AP name is implicitly declared as an alias for the AP s pathname in the database The parameter list is similar to the formal parameter list of a procedure or function see 4 14 1 except that no in out or out parameters are allowed The optional import list contains import directives of the form import pathname where pathname denotes an importable item e g a library from which objects are imported The im port clause makes all objects declared in the imported module s specification directly visible See section 4 2 for details The optional declaration part of an AP may declare constants types variables aliases and units as well as procedures and functions See sections 4 3 and 4 6 for details The AP s name may be repeated at the end after the end keyword in this case it obviously must match the name following the procedure keyword in the header The AP definition may be preceded by unit constant
86. ate 2010 01 29 TRANSPORTATION Seite Page Il von of V Table of Contents 1 Introduction aoe oho nese Saw Ea ER VESTE YE 1 1 1 1 Identification eere rr er em 1 1 1 2 POPPO8e 493 kk nd nern 1 1 1 3 Document Outline 1 1 2 Applicable and Reference Documents eeeeee 2 1 2 1 Applicable Documents 4 vaso o ukes ne na aa an 2 1 2 2 Reference 1206116685 n n n n n 211 I ONEVIEW ann 3 1 3 1 Conceptual Overview 4 iie ois cs hoes a RES 3 1 3 2 Language Summary ss 3 3 3 3 Syntax Notation 6565 gtk RCROCREOC ROCA shse Rowen eevekeebeennen hee 3 5 3 4 Conventions Used in Examples 2 2558 3 5 4 Language Definition 0 cc ccc ccc ccc 8 4 1 4 1 Vocabulary amp Lexical Elements 25 55 5500 ne 4 1 4 1 1 Character Set bec cd eR RD Y bad ee 4 1 4 1 2 Lexical Elements RR REG RES eh hs 4 2 4 1 2 1 Delimiters 4 2 4 1 2 2 Identifiers lecce RR RR ers 4 3 4 1 2 3 Path Identifiers and Pathnames ellen 4 3 4 1 2 4 Numeric Literals 4 4 4 1 2 5 Statecode Literals cee ce cee IIR 4 5 4 1 2 6 Character Literals 4 4 RERE ES E ERU CRANE 4 5 4 1 27 DE Literals 2 sr neuesten d ee ER LES nenne 4 6 24 1 2 8 Time Literals E E RR VIR IER TER E 4 7 4 1 2 9 Duration Literals 4 7 4 1 2 10 Unit Literals 4 8 42 Import sah 4 9 4 3 Declarations Names and Scopes 2222555550 nn 4 10 4 3 1 Identifiers 4 10 4 3 2 Scope of
87. ate as the other oper and e g 01 09 1997 13 00 12 00 3600 0 s 12 00 13 00 3600 0 8 The special time literal denotes no time This may be used e g as a default value for TIME parameters or variables It can only be compared on equality lt gt and must not be used in other operations Representation in memory A TIME value is internally represented using two 32 bit words They contain the following time components in packed format in this order year 1900 8 bit integer month 4 bit integer day 5 bit integer seconds since midnight 47 bit fixed point value with 17 bits before and 30 bits after the decimal point Times without a date are represented with the year month and day fields The constant no time is represented with all bits in both words set to 1 DURATION values are represented like LONG REAL values see 4 8 1 4 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 24 vonlof 4 96 4 8 1 10 Type COMPLETION_CODE The predefined type COMPLETION_CODE is an enumeration type defined as type COMPLETION CODE SUCCESS FAILURE All characteristics and operations defined for enumeration types see 4 8 1 11 apply to COMPLE TION
88. atement Assignment While Statement Halt Statement Designator Expression Qualified Identifier Actual Parameters Parameter Parameter Identifier Expression i Expression then Statement Sequence elsi Expression then Statement Sequence else Statement Sequence end if case Expression Case Case else Statement Sequence end case when Case Label List Statement Sequence while Expression do Statement Sequence end while repeat Statement Sequence until Expression loop Statement Sequence end loop id Iterative For Statement Collective For Statement for Identifier Expression to Expression by Constant Expression do Statement Sequence end for m M T eubriurnm EADS Statement Assignment Procedure_Call Actual_ Parameters Parameter If Statement Case_Statement Case While_Statement Repeat_Statement Loop_ Statement For_Statement Iterative For Statement Collective For Statement for Identifier in Qualified Identifier by Constant Expression do Statement Sequence end for ira halt Expression exit return Expression Statement Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Halt Statement Exit Statement Return Statement St
89. atement Sequence Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page D 5 von of D 7 Expressions Expression Relation amp Relation Relation Relation Aggregate C Expression Expression Simple Expression Simple Expression gt lt Simple Expression Simple Expression Simple Expression gt Simple_Expression gt Simple Expression in Simple_Expression y o Term am Term o Term Factor Factor Factor Factor Primary Factor Number Unit String Character Set Constant Date Time Time Statecode Designator Function Call Type Conversion 6 Expression Primary Qualified Identifier Element Element Constant Expression Constant Expression Qualified Identifier Actual Parameters Qualified Identifier Expression String Conversion pathname alias unit Qualified Identifier Expression Format pathname alias unit string Expression Format Width Aft Exp Expression Name Identifier Name Identifier Expression List Designator Expression Expression Expression
90. ation or if the called subprogram directly or indirectly accesses any guarded entities e Passing a pathname as a parameter is guarded only if the formal parameter was explicitly marked with the keyword guarded in the procedure function declaration A compilation unit accessing any entities that are guarded in the above described way will itself inherit the privilegs of the accessed entities The privileges themselves do not appear in the UCL source text they are exclusively configured in the database The source text just marks the guarded positions Therefore no UCL items need to be rewritten and recompiled if privileges change Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 E ADS e berarbtg Rev Datum Date 2010 01 29 Seite Page 4 95 von of 4 96 4 17 2 Guarded Library Procedures and Functions Library procedures and functions can be marked as guarded as shown in the example library Ground Library procedure Write Message To User not guarded procedure Read Message From User not guarded guarded procedure Enable Monitoring guarded guarded procedure Disable Monitoring guarded guarded procedure Issue guarded prosadure Pathname To String not guarded end Ground Library 4 17 3 Guarded Parameters Parameters of procedures a
91. berarbtg Rev Datum Date 2010 01 29 Seite Page 4 76 voniof 4 96 Example procedure Accumulate First INTEGER Last INTEGER out Result INTEGER variable Sum INTEGER begin Sum First for I First 1 to Last do Sum Sum I end for Result Sum end Accumulate 4 14 2 Function Declaration A function is a subprogram that returns a value A function declaration starts with the reserved word function followed by the function name an optional list of formal parameters and the function result type Formal parameters and body of functions are specified in the same way as procedures see 4 14 1 The type of the function return value is restricted to scalar types and pathname types The statements of the function body must include one or more return statements see 4 13 6 specifying the returned value but only one return statement is executed A runtime error occurs if a function is left otherwise than by a return statement Note that the expression following the re turn keyword must yield a value of the function result type stated in the function header Neither out nor in out parameters are allowed for functions Formal Syntax Function Declaration Function Heading Block Function Heading function Identifier Formal Parameters Qualified Identifier Unit Block Declaration begin Statement Sequence end Identifier
92. bles see 4 9 and 4 2 array components see 4 8 2 1 e array aggregates see 4 8 2 1 e substrings slices see 4 8 2 5 record components see 4 8 2 2 MDB items and subitems see 4 3 6 e function calls see 4 12 3 e type conversions see 4 12 4 expressions Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 51 von of 4 96 4 12 2 Operators There exists a precedence hierarchy among operators It determines the order of evaluation of operands in an expression The not operator and the exponentiation operator have the highest precedence followed by the so called multiplying operators the so called adding operators and the relational operators Boolean operators have the lowest precedence Sequences of operators of the same precedence are evaluated from left to right except for sequences of exponentiation operators which are evaluated from right to left The order of evaluation may be altered by using parentheses The precedence of operators is highest 1 Boolean negation unary exponentiation 2 0 y multiplying operators 3 adding operators 4 lt gt lt lt gt gt in relational operators lowest 5 amp Boolean operators Examples I J K INTEGER
93. body A library body starts with the keywords library body followed by the library s name an optional import list see 4 2 an optional declaration part see 4 3 and finally by the actual body containing the respective implementations for all functions and procedures defined in the corresponding library specification Note that identifiers declared in the specification part of a library are visible in the corre sponding body i e may be used in the body without declarations Items imported into a library specifi cation are available to the library body as well A library body may optionally contain an initialization section consisting of a statement sequence de limited by begin and end which is used to initialize its local objects This initialization section will be automatically executed before the client AP or library is executed A library is initialized only once even if it is imported many times by different imported units If multiple libraries are imported they are initialized in the order in which they textually appear Circular references for example A imports B which imports C which imports A are not allowed and result in error messages At runtime all APs share the same system libraries but user libraries are not shared between APs each AP has its own copy of user libraries Formal Syntax Library Specification library Identifier Import Definition end Identifier Library Body libr
94. by the user Notes The definition of analog measurement objects in the MDB includes the physical quantity voltage temperature etc and the respective engineering units associated with the particular measurement Similarly discrete measurement objects are associated with statecodes names identifying the states the object may be in such as SON SOFF SOPEN SCLOSED SLOW SMEDIUM SHIGH Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 14 vonlof 4 96 The runtime values of analog measurement objects are expressed in engineering values i e the acquired raw values are converted to the predefined engineering units using the appropriate calibration curves For discrete objects the runtime values correspond to the predefined statecodes e The runtime values of MDB items have a software type according to the UCL type system See Type Correspondence Table between MDB and UCL objects in Appendix F MDB items are further classified by an access class Some of these access classes define the allowed usage of an item in UCL and HLCL these are marked with YCL and or HLOL superscripts READ HLCL indicates that the item has a runtime value that is read only 1 6 it may be read but
95. c Each production rule is terminated by a period A complete syntax summary is given in appendix D 3 4 Conventions Used in Examples UCL source text in examples is written in a mono spaced font Courier Strict conventions are followed for the representation of word classes e UCL reserved words are written in bold and all lower case begin if case etc e Predefined identifiers are written in all upper case INTEGER REAL INCL DECL etc e Other identifiers are written with upper case initial letters for each word part e g 116 Name Min Value Control structures are uniformly indented according to the logical program structure Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 1 vonlof 4 96 4 Language Definition 4 1 Vocabulary amp Lexical Elements 4 1 1 Character Set The text of a UCL program also called the source code is a sequence of lexical elements or tokens each consisting of one or more characters These characters may be any of the ASCII graphic symbols defined in the ISO standard 646 The UCL source code can be freely broken into lines whereby the length of the line is restricted to 256 characters This is a restriction imposed by the particular implementation of the UC
96. cal Ground Support Equipment FLight Automated Procedure onboard Greenwich Mean Time Human Computer Interface High Level Command Language HardWare Interface Control Document Institute of Electrical and Electronics Engineers International Organisation for Standardization Input Output Mission DataBase Not Applicable National Aeronautics and Space Administration USA Onboard DataBase Operating System Systeme Internationale metric unit standards Short IDentifier SoftWare To Be Confirmed To Be Defined User Control Language User Interface Language Verification Integration and Check Out Software Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 AP APM ASCII BNF CSS DB DMS EBNF EGSE FLAP GMT HCI HW ICD IEEE ISO I O MDB N A NASA ODB OS SI SID SW TBC TBD UCL UIL VICOS Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EA DS e berarbtg Rev Datum Date 2010 01 29 sascr um Seite Page B 1 von of B 2 Appendix B Definitions Access rights permission users or applications have to access objects or entities Application program or set of programs performing some specialized user oriented function as opposed to general purpose programs like an operating system Automated Procedure program main procedure written in User Control Language UCL Child in a hierarchical structure denotes an imm
97. cannot be altered by a UCL program The corresponding pathnames may be used in an expression may appear on the right hand side in an assignment statement or as an in parameter In expression evaluation the current i e most recent runtime value of the MDB item is used READ WRITE indicates that the item has a runtime value that may be read and altered by a UCL program Items of this class may be regarded as global software variables The corresponding pathnames may be used in expressions assignments on either side of the assignment symbol or in parameter lists as in in out orout parameters IMPORT HLCL applies to UCL libraries that may be imported by other compilation units EXECUTE tcr applies to MDB items of type automated procedure which may be invoked by other APs PATH SELECT tct applies to parent virtual MDB items i e those at non terminal nodes of the MDB name tree NODE SELECT tct applies to MDB items of type network node The corresponding pathnames designate a specific computer in the network SEND applies to items that represent commands stimuli telecommands that may be sent to specific target systems none applies to all other MDB items Note A compilation unit may reference itself directly or indirectly in non parameterized form Parameterized references require the referenced unit to be compiled and up to date this prohibits self references and cyclic references Example
98. cter or byte assigned to a string variable or constant or passed as a string parameter e g rear Pet cars ral hl ap AA BB BYTE 255 AA_BB FF BYTE 1 BYTE 2 01 02 The predefined functions LOW and HIGH can be used to determine the lower or upper bound respectively of a string type or variable LOW will always return 1 HIGH returns the maximum length of the string type or variable Substrings In expressions a substring slice may be selected from a string by giving the substring index range in parentheses The lower and upper bounds may be outside the actual index range of the string The result is the part of the string that lies within the given bounds S 5 10 selects range 5 10 S 5 22 3 selects range 1 3 S 1 0 selects an empty substring lower upper Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS nna berarbtg Rev Datum Date 2010 01 29 Seite Page 4 33 von of 4 96 Formal syntax String_Type string Constant Expression of Identifier Constant_Expression see 4 12 Identifier see 4 1 2 2 Examples variable S string 255 String with max 255 characters variable 580 string 80 String with max 80 characters variable B string 255 of BYTE
99. dures or APs automatically inherit the definitions of objects contained in the MDB These objects are thus directly visible and may be referenced by their Database path names see Fig 1 UCL also supports on line interactive commands These facilities are provided by the High Level Command Language HLCL in the ground SW environment HLCL is somewhat a modification of UCL i e it extends UCL with respect to interactive commanding e g HLCL allows abbreviations and shares the same system libraries In this manner UCL s monitoring and control facilities also become available on line as HLCL keyboard commands HLCL is described in reference document 2 2 1 UCL programs are edited and compiled off line This process is depicted in Figure 3 During the compilation process the UCL code is transformed into a binary intermediate code which is later executed interpreted in the target environment e g DMS EGSE by a dedicated program interpreter Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EA D 5 n berarbtg Rev Datum Date 2010 01 29 Seite Page 3 2 von of 3 5 ascr um switch positiop input voltage Cfemperatur amp shut off gt 4 output_voltage Example of end item name APM SubSystems TCS Equip_A switch_position Figure 1 Hierarchical Name Tree example Subsystems Equipm
100. e used to logically group the bytes in a string They have no effect on the value of the literal Byte string literals are mapped to the predefined string of BYTE type 4 8 2 5 Bytes in a string are packed with four bytes in a 32 bit word Formal syntax E Hex Digit Hex Digit Hex Digit Hex Digit Hex Digit 886 2 Byte_String Examples of byte string literals 0000 0001 0000 0002 0000 0003 FF 0102 AE F1 0103 EO 00 01 02 03 04 05 06 07 08 09 OA empty string Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 47 4 96 4 1 2 8 Time Literals A time literal consists of two separate lexical elements date and hour specification If the date is omitted UCL ignores it in any related time operation Other omitted parts are assumed as zero A special time literal is the constant which stands for an undefined time value It can only be used in assignments and as parameters and tested for equality no further operations are defined on it The date is restricted to the range from year 1901 to year 2099 Formal syntax Time_Literal Date Time Time Date Day Month Year Day Digit Digit Month Digit Digit Year
101. ecification library body missing for system libraries The library specification is the list of all entities which are visible to APs or other libraries i e they may be imported The library body on the other hand contains the actual implementations of these entities as well as other entities that are invisible from the outside For system libraries the body is missing since their implementation is part of the runtime system This partitioning of libraries into specification and implementation part allows e torestrict the number of entities visible to users and e to hide implementation details information hiding principle It also improves maintainability by allowing changes to be made to a library implementation without affecting its clients UCL allows a library to be composed of a specification part only i e without a corresponding body For example a library could contain constant and type declarations only Note that the specification and body parts logically belong to the same library and must share the same name The specification part of a library represents the interface between the library on one side and the library s clients on the other side Any change to the specification will require changes to the body On the other hand the body may change without affecting the definition part and hence its clients Library specification A library specification starts with the keyword library followed by the library s n
102. ed operators to yield a new value An error will occur if the computed value cannot be represented on the current target machine e g division by zero The arithmetical operators e g applied to INTEGER UNSIGNED INTEGER REAL or LONG REAL operands form arithmetical expressions whereas the logical relational and some set operators together with their respective operands yield Boolean expressions If an MDB object is used in an expression through a pathname designator its meaning depends on the expected target type e If the target type is a pathname type the pathname stands for itself as a reference to the item Otherwise the pathname denotes the runtime value of the item The item must then be accessible in READ or READ WRITE mode see section 4 2 The same holds analogously for subitem pathnames Formal Syntax Expression Relation amp Relation Relation Relation Aggregate Aggregate Component Component Component Identifier Expression Relation Simple Expression Simple Expression Simple Expression gt Simple Expression Simple Expression Simple Expression 2 2 Simple Expression Simple Expression Simple Expression Term Term Term Term Factor Factor Factor Factor Factor Primary Factor Primary Number Unit String Character
103. ediate descendant of a network or tree component A child is thus located one hierarchical level below its parent Compilation unit smallest unit of code that is accepted by the compiler In UCL there are different types of Compilation Units Automated Procedure AP Library Specification Library Body Formal Parameter List Definition Derived Value Database common or integrated collection of interrelated data whose purpose is to serve one or more applications Default a value supplied by the system when a user does not specify a required parameter qualifier or attribute Derived Value a database item whose value is computed from the values of other database items End item MDB item located at the lowest hierarchical level leaf or terminal node and hence cannot be further decomposed Intermediate code I code binary code generated by the UCL compiler interpreted at run time Item type type of an MDB item defines the properties attributes and the set operations that may be performed on that item MDB item MDB object used interchangeably uniquely identifiable entity defined in the Mission Database and corresponds to a real world HW or SW entity An MDB Object or Item may be decomposed into lower level items according to the hierarchical name tree conventions see Name tree Mission Database MDB the central repository for all HW SW configuration information about Flight Elements Payloads and associated Ground Support Equ
104. ent Acquisition Monitoring amp runtime data Control SW tables SIDs Attributes Runtime UCL I code Interpreter predefined Configuration data Figure 2 UCL runtime environment Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EA D 5 berarbtg Rev Datum Date 2010 01 29 ascr um Seite Page 3 3 von of 3 5 to DB data extraction services to EGSE source Configuration DB UCL source I code code Figure 3 Off line preparation of an AP 3 2 Language Summary e Compilation Units Automated Procedures main program Libraries Formal parameter list definitions Derived Values e A Library consists of Library specification Library body implementation part e Automated Procedures Library specifications and Library bodies are compiled separately e Two kinds of subprograms Procedures Functions e Subprograms must be defined within main programs APs or Libraries they may not be nested inside other subprograms Their parameters may have default values and may be unbound arrays or strings Parameter associations are either named or positional Subprograms may be called recursively e Predefined Subprograms ABS MAX MIN HIGH LENGTH ODD INC DEC INCL EXCL gt All I O Monitoring amp
105. entifiers with no spaces between them The pathname NAPMNDMSNASSEMBLY XNUNIT Y consists of 4 consecutive path identifiers Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 44 vonlof 4 96 4 1 2 4 Numeric Literals In the UCL source code numeric literals constants may take three possible forms integer simple integer based integer or real numbers 4 1 2 4 1 Integers An integer is simply a sequence of digits 0 9 The underscore character may be used to logically group digits it has no effect on the numeric value of the literal The value of an integer must be in the range 0 MAX UNSIGNED INTEGER The compiler issues an error message if this range constraint is violated Formal syntax Simple Integer Digits Digits Digit Digit Digit 0 1 2 9 A 5 e p 8g 9 Examples 5 123 027 10 000 4 1 2 4 2 Based Integers A based integer has the form Base Value where Base is a decimal number indicating the base of the numbering system it must be in the range 2 16 Some bases are particularly useful 2 for binary 8 for octal 10 for decimal the default or 16 for hexadecimal Value must be a sequence of ex
106. erator logical AND logical OR logical NOT colon assignment operator semicolon also used as statement terminator gt less than lt less than or equal lt gt not equal equal gt greater than or equal left bracket right bracket left brace lt ze oo So ne right brace annotation marker comment marker Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 43 voniof 4 96 4 1 2 2 Identifiers Identifiers are the names used in a UCL program to designate various UCL entities such as constants variables types etc An identifier begins with a letter which may be followed by any combination of letters digits and underscore characters Not allowed are consecutive underscore characters 29 29 a b and underscore character at the end of a name abc UCL is not case sensitive i e does not distinguish between upper and lower case letters Thus the three identifiers SENsor A SENSOR A and sensor a are equivalent Since end of line is a separator an identifier must fit on one line The maximum length of an identifier is thus restricted to 256 characters All characters in an identifier are significant Formal syntax Identifier Letter Letter Or Digi
107. erence set intersection symmetric set difference lt inclusion left operand included in right operand gt inclusion right operand included in left operand Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS berarbtg Rev Datum Date 2010 01 29 Seite Page 4 53 von of 4 96 4 12 3 Function Calls Like a procedure a function is invoked by its name followed by the appropriate actual parameters In contrast to a procedure call which denotes an action a function call returns a value and corresponds therefore to an expression The specification of actual parameters in function calls follow the same syntax rules as in procedure calls see 4 13 2 Formal Syntax Function Call Qualified Identifier Actual Parameters Actual Parameters Parameter Parameter Parameter Identifier Expression Qualified ldentifier2 see 4 3 4 Identifier see4 1 2 2 Expression see4 12 Examples X Average First Val Last Val function Average if Is Empty Buffer then Boolean function Is Empty Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum
108. es introduced in the previous sections were all referring to unitless values UCL also provides the facility for defining and operating on unitized values i e real or integer values associated with a unit of measure This facility improves the readability of the source code and at the same time enables additional semantic checking at compilation time 4 11 1 Units of Measure Every measurement system defines a number of base units each describing a physical quantity The currently world wide used unit system is the SI system which defines 7 base units meter to measure the length second to measure the time kilogram to measure the mass etc It is standardized under ISO 1000 The units of measure in UCL are based on this International Standard All other units can be derived from the base units by multiplication or division of two or more base units or by multiplication and or addition with constants Such units are called derived units For example the unit volt is defined as m2 kg 83 A or m kgl 873 A l The second expression shows that derived units are products of base units raised to positive or negative integer power The same physical quantity can be described by more than one unit For example the length can be measured in meters or in inches Such units are called commensurable units They are assignment com patible The UCL compiler automatically converts between commensurable units This is explained later in more
109. ew 3 1 Conceptual Overview Although its basic syntax is that of a general purpose programming language UCL is a dedicated test and operations language for monitoring and control of spacecraft subsystems It is intended for use in both the on board operational and the ground checkout environment UCL is a procedural language representing the set of all commands or instructions that can be predefined and stored as so called Automated Procedures APs and User Libraries in the Mission Database MDB Automated procedures play the role of amain program They can be executed like an individual program but can typically also be part of some higher level actions which are stored in the form of hierarchical tree structures For better manageability and adaptability to specific target environments the monitoring and control features of UCL have been removed from the actual language definition and encapsulated in system libraries These libraries are specific for the respective target systems they are defined in the interface documentation for these systems e g the DMS ICD the CGS ICD etc The library construct of UCL corresponds to the Ada package or the module in Modula 2 It supports the information hiding concept which allows the separation of a module s specification from its implementation The library concept is not restricted to system libraries but a user may implement his own user libraries in UCL UCL programs Automated Proce
110. ex Digit Digit String Char String Byte String Character Printable Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page E 1 von of E 1 ascr um Appendix E ASCII Character Set see ISO standard 646 Ref doc 2 2 5 for details 104 112 120 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 E A D S 0 2 0 berarbtg Rev Datum Date 2010 01 29 EcbriL irm Seite Page F 1 von of F 1 Appendix F UCL MDB Type Correspondence Table The following table shows for a few examples the principle how MDB item types map on UCL access classes and software types This is to be understood as an example only the actual MDB item types the corresponding access classes and software types are defined in the database documentation for the respective target system MDB object type MDB item type class access class Dee ee oo an 9e UCL object type SW variable READ WRITE INTEGER REAL BOOLEAN Deme meme mm pem o Dee mw D emm none means MDB objects of this type can be accessed only via System Library procedures functions Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 3
111. fall in two classes character strings and byte strings 4 1 2 7 1 Character Strings A character string is a sequence of zero or more characters from the 95 graphic ASCII characters including the space enclosed between quotation marks double quote characters The quotation mark itself has to be doubled if it appears within the string The empty string is denoted by two adjacent quotation marks Since end of line is a separator a string must not extend over the end of a line The maximum length of a string literal including the quotes 1s thus 256 characters Character string literals are mapped to the predefined st ring type 4 8 2 5 Characters in a string are packed with one character per byte Formal syntax Char String 39999 ASCII 399999 39999 399999 Character ASCII ASCII any of the ASCII Characters in range 32 126 Examples of character string literals String 1 String with quoted word empty string 4 1 2 7 2 Byte Strings A byte string is a sequence of zero or more bytes A byte string literal is written in hexadecimal form enclosed in quotation marks like a character string prefixed with The number of hexadecimal digits must always be even The empty byte string is denoted as 1 Like for character strings the maximum length of a byte string literal including the quotes is restricted to 256 characters Underscore characters and blank characters may b
112. fic index type This must be a discrete type INTEGER UNSIGNED_IN TEGER CHARACTER enumeration type or constrained statecode type If a constrained statecode type is used as the index type of an array the order in which the array components are arranged is not defined since statecode types are unordered A program must not rely on a specific order An array type is specified in the form array index_range of element_type The index range may either be given as an explicit range in the form min max or as the name of a discrete type In the latter case the index range comprises all values of the type 1 array min max of element type Y 2 array type name of element type For statecode types 2 is the only allowed form The type of an array element may itself be an array this leads to multidimensional arrays In that case the following two notations are identical 1 array 0 10 of array 0 20 of INTEGER 2 array 0 10 0 20 of INTEGER No operations are defined on array objects They can only be assigned and passed as parameters to subprograms The predefined functions LOW and HIGH can be used to determine the lower or upper bound respectively of an array type or variable For an array with more than one dimension the bounds of the second third etc dimension can be obtained by specifying the dimension as the second parameter of LOW and HIGH Formal Syntax array Index Ra
113. fiers declared in the specification of the imported module become visible throughout the compilation unit see 4 2 Note that unit identifiers such as kg A MeV etc are not ordinary identifiers They are not bound to scopes but are always global see 4 11 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS nna berarbtg Rev Datum Date 2010 01 29 Seite Page 4 11 von of 4 96 AP with 2 local procedures Procl and Proc2 import APM Sys_Lib exports T1 type T2 statecode OFF ON procedure AP X T1 Y T2 import APM User_Lib variable A INTEGE procedure Procl outer A visible variable A INTEGE variable B INTEGE iu imported egin objects scope of e scope E inner A visible end Procl imported objects variable C REAL visible scope of outer A procedure Proc2 begin outer A end Proc2 visible begin AP main part end AP Figure 4 Scope and Visibility of Identifiers 4 3 3 Database Scope and Aliases nicknames The database represents a name scope too It may contain certain identifiers e g predefined aliases nicknames for database items These identifiers can be used like any other identifiers and like these they can be hidden by identifiers from other scopes The database scope
114. function Buffer Level UNSIGNED INTEGER end Pathname Buffer Library body library body Pathname Buffer type Buffer Type array 1 Buffer Size of pathname pathname Buffer Error pathname Buffer Error INTE Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 variable Buffer Buffer Type variable Index UNSIGNED INTEG procedure Put Buffer in Item out Error begin if Index Buffer Size then INC Index Buffer Index Item Error No Error else Error Buffer Full end if end Put Buffer procedure Get Buffer out Item out Error begin if Index 0 then Item Buffer Index DEC Index Error No Error else Error Buffer Empty end if end Get Buffer function Buffer Level UNSIGNED begin return Index end Buffer Level end Pathname Buffer Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 88 von of 4 96 Example 2 This user library provides operations to split TIME values into their components and to construct TIME values from components This is an example of how to use low level conversions with overlayed record variants in a safe and controlled way see 4 12 4 2 For the TIME representation in memory see 4 8 1 9 Library specification library Time
115. g Rev Seite Page cgs D 7 Terminal Symbols Unit Identifier Digit V Letter Digit Letter Digit Identifier Letter Letter Or Digit Letter Letter Letter Digit a b c d e ud g Rn vi i 6 a m n o p q 4 g a Uu ny Ww yx y Simple Integer Based Integer Real Digits Digits Hex Digit Hex Digit Digits Digits e Digits Day Month Year Digit Digit Digit Digit Digit Digit Digit Digit Hours Minutes Seconds Fraction Digit Digit Digit Digit Digit Digit Digits Digit Digit Digit a b c d e P 0 1 2 8 4 5 6 7 8 9 Char String Byte String ASCII mom iP Hex Digit Hex Digit Hex Digit Hex Digit Printable any of the printable characters of the underlying character set Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 en EADS eubriurnm Unit Factor Path Identifier Statecode Identifier Unit Identifier Letter Or Digit Letter Number Simple Integer Based Integer Real Date Day Month Year Time Hours Minutes Seconds Fraction Digits H
116. g example For a discussion of scoping rules see 4 3 2 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 71 von of 4 96 declaration of a variable named Index The variable Index is accessible here loop index also called Index only the loop index is visible here the variable Index is hidden by the loop index variable Index is now accessible again and it still has its original value terative For Statement cgs INTEGER to 100 do variable Index begin for Index end for end Formal Syntax For Statement Collective For Statement for Identifier Expression to Expression by Const Expression do Statement Sequence end for m for Identifier in Qualified Identifier by Constant Expression do Statement Sequence SHIGH Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 EDIUM SM Iterative For Statement Collective For Statement end for t Identifier 466 2 Qualified Identifier see4 3 4 Expression 66 2 Constant_Expression see4 12 Statement Sequence see 4 13 Examples for I 1 to 1000 do Sum Sum I end for for i 10 to 10 by 2 do statement sequence end for for C Red
117. ghts reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 25 voniof 4 96 4 8 1 12 Subrange Types A subrange type denotes a restricted range of consecutive values from some other type called the base type The latter must be one of the following types INTEGER UNS IGNED_IN TEGER REAL LONG_REAL CHARACTER or enumeration type They are not separate types but subtypes of other types All characteristics and operations defined for the base type apply to the subtype as well However a value to be assigned to a variable of a subrange type must lie within the specified interval otherwise a runtime error occurs A subrange type is specified by its bounds i e the lowest and highest allowable values The lower bound must not be greater than the upper bound further they must be both specified as constants or constant expressions Both bounds must be compatible with the given base type The predefined constant functions MIN and MAX may be used to obtain the lower and upper bound resp It is possible to define a subrange type of another subrange type Then both subrange types have the same base type and the bounds of the new type must not lie outside the bounds of the old type A subrange type declaration is given by the name of the base type followed by the range enclosed
118. he formal parameter of a subprogram is of a low level type the assigned value or passed actual parameter respectively may be of any scalar type but the value must not occupy more than the corresponding number of bits In particular BYTE The type BYTE represents untyped 8 bit objects BYTE variables and formal BY TE parameters may be assigned passed values of any scalar type that fit into 8 bits CHARACTER BOOLEAN INTEGER and small enumeration types with up to 256 values as well as byte strings of length 1 For integer values a check is done that the value will fit in 8 bits i 6 it is in the range 0 255 for non static values the check will be performed at runtime Note however that byte values are held in 32 bit words in memory Only in strings 4 bytes are packed in a word see 4 8 2 5 WORD The type WORD represents untyped 32 bit objects WORD variables and formal WORD parameters may be assigned passed values of any scalar type that are represented in 32 bit words CHAR ACTER BOOLEAN INTEGER REAL BITSET pathname types enumeration types as well as byte strings of length 4 LONG WORD The type LONG WORD represents untyped 64 bit objects LONG WORD variables and formal LONG WORD parameters may be assigned passed values of any scalar type that is represented in 64 bits LONG REAL TIME statecode types subitem pathname types as well as byte strings of length 8 Representation in memo
119. he two forms may be preceeded by an additional modifier keyword pathname or alias pathname string expression alias string expression pathname typename expression alias typename expression With the pathname keyword the pathname will be chosen as the textual representation the alias keyword requests the database alias to be generated instead If the item does not have a database alias the result will be an empty string The pathname will be used as the default text representation if neither of the two keywords is present For unitized types and for pathname types the unit itself may be obtained as a string with the following forms the unit is not enclosed in brackets unit string expression unit typename expression All forms allow to specify simple string formatting string expression width for all types typename expression width string expression width aft for REAL LONG_REAL and TIME typename expression width aft string expression width aft exp for REAL and LONG_REAL typename expression width aft exp width specifies a minimum total width of the resulting string Negative values request left justification positive values right justification If the string is larger than the specified minimum width the actual size will be taken aft specifies the number of digits after the decimal point For TIME values aft affects the fraction part of the seconds component 0 suppresses the fractio
120. hname types are references to database objects themselves not to their runtime value Pathnames are regarded as literals that denote the values of these types The special literal NN means no pathname It may be used e g as a default value for pathname parameters or as an initial or dummy value for pathname variables NN is compatible to all pathname types regardless of constraints or parameterisation see below Pathname values can be assigned and compared on equality lt gt Pathname types can be unconstrained or constrained e An unconstrained pathname type is denoted by the keyword pathname it comprises all valid pathnames e A constrained pathname type is restricted to a specific set of MDB item types This is denoted by the keyword pathname followed by the list of allowed item types in parentheses The item types are represented by a special set of identifiers defined in the database the item type names These identifiers may appear only in this specific context they do not interfere with normal UCL identifiers The compiler will check that pathnames assigned to a variable associated with a constant or passed as a parameter are of one of the item types allowed for the target object All declared pathname types are subtypes of the general predefined type pathname Formal Syntax Pathname_Type Identifier List pathname Identifier List Identifier Identifier Identifier seed4 1
121. hus overlay each other This is not normal programming practice and should be avoided If necessary for special and exceptional cases great care must be taken For an example see chapter Libraries 4 16 2 example 2 No operations are defined on record objects They can only be assigned and passed as parameters to subprograms Formal Syntax Record Type record Fields end record Fields dentifier List Qualified Identifier Unit case Identifier Qualified Identifier Variant Part end case ms Variant_Part when Case Label List Fields else Fields Case Label List Case Labels Case Labels Case Labels Constant Expression Constant Expression Identifier List Identifier Identifier Qualified Identifier see 4 3 4 Identifier see 4 1 2 2 Constant_Expression see 4 12 Unit see 4 11 and 4 1 2 10 Examples a Simple record record Day INTEGER Month INTEGER Year INTEGER end record Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 29 von of 4 96 Analog Discrete array 1 4 of CHARACTER record Channel No INTEGER case Measure Measurement Type when Analog Eng Value REAL Eng Unit
122. iable Identifier Variable Type Constant Expression Variable Type Qualified Identifier Unit String Type statecode pathname Mk Identifier see 4 1 2 2 Constant_Expression see 4 12 Qualified Identifier see 4 3 4 Unit see 4 11 and 4 1 2 10 String_Type see 4 8 2 5 Examples a variable declaration with predefined types variable Index INTEGER variable State statecode b variable declaration with user defined types type Primary_Color Red Green Blue variable Color Primary_Color c string variable declaration variable s string 80 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS berarbtg Rev Datum Date 2010 01 29 Seite Page 4 4 vonlof 4 96 4 10 Alias Declarations An alias declaration associates a simple name an identifier with a complex name that includes a pathname and thus provides a shorthand for the long name The alias name may then be used instead of the corresponding long name The long name may be one of the following a pathname alias Lib NXEGSENVICOSNSYSTEMNGROUND LIBRARY The pathname may be incomplete 1 6 denote a virtual node in the database name tree In this case the alias may be used as a prefix in other pathnames alias System EG
123. ical dimension Examples type Furnace_Temperatur REAL Kabs type Coolant_Temperature REAL degC type Power REAL m2 kg s3 type Dozen REAL doz constant Freezing Point Furnace Temperature 0 0 K variable Curr Power Power 0 0 m2 kg s3 variable Count Dozen Only REAL LONG REAL INTEGER and UNSIGNED INTEGER types may be unitized 1 6 asso ciated with a unit of measure via a unit expression A unitized type may be part of a structured type e g array record however the structured type itself must not be unitized Thus in the following example type Rval Array array Lo Hi of REAL type Temperature Array Rval Array degC not allowed type Voltage Array array Lo Hi of REAL V the type declaration for Temperature Array isinvalid the type Vo1tage Array on the other hand is a valid UCL construct In type variable and constant declarations a unit clause is used to indicate a unitized value type or unitized type for short The associated type is given first then a unit expression 4 11 7 Unitized Variables and Constants UCL also allows variables and constants to be associated directly with a unit of measure This is syntac tically analogous to declaring an unnamed structured type For example constant Max Speed REAL m s 1000 0 m s variable Mass REAL kg The variable declaration associates the variable mass with the mass unit
124. icitly imported by their clients A library specification and its corresponding body form two separate compilation units The library body may be modified without affecting the library s clients whereas a modification of the library specification implies recompilation of the corresponding body and of all clients UCL requires compilation units to be compiled in the following order 1 A library specification must be compiled before its clients 2 Alibrary specification must be compiled before its body 1f one exists Note that the body of a user library must have been compiled before its services can actually be used executed by a client Formal Parameter List Definitions Database items may have formal parameter lists When using such an item in a context that requires a parameterized item see 4 14 1 the item name must be given together with its actual parameter list The UCL Compiler can be used to create the formal parameter lists of such database items Items with formal parameter lists can be imported by other objects see 4 2 Derived Values A derived value is a database item that returns a value computed from the values of other database items Its compilation unit describes the algorithm for the value computation Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum D
125. ill themselves be guarded If the compilation unit itself in its body or initialization part resp calls such a subprogram the compilation unit will inherit the privileges attached to the guarded items For a description of privileges and authorization see 4 17 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 78 vonlof 4 96 4 15 Standard Functions and Procedures The following functions and procedures are predefined Some of them are generic in the sense that they may have several possible parameter list forms For example the procedures INC DEC may have one or two actual parameters and the first parameter may be an INTEGER UNSIGNED INTEGER or an enumerated type value ABS Function ABS x returns the absolute value of the expression or variable x x must be of type INTEGER UNSIGNED INTEGER REAL or LONG REAL The result has the type of x MAX Function MAX t denotes a constant equal to the maximum highest value of the type t where t may be one of the basic types or subtypes thereof INTEGER UNSIGNED INTEGER REAL LONG REAL TIME DURATION enumeration types MAX X2 Xn determines the maximum of a group of values The values must be of one
126. ily terminate endless loops are valid constructs A loop is of course implicitly terminated when a return or halt statement is executed see 4 13 6 and 4 13 7 4 13 5 1 Simple Loop Statement The basic form of iteration is the loop statement It specifies that a statement sequence is to be repeatedly executed until an exit statement is executed A typical Loop statement with an exit statement is shown below loop statement_sequence_l if condition then exit end if statement sequence 1 end loop Formal Syntax Loop Statement loop Statement Sequence end loop bd Statement Sequence see 4 13 Example loop if A gt 10 then exit end if end loop 4 13 5 2 while Statement The while statement specifies the repeated execution of a statement sequence depending on the value of a Boolean expression The expression is evaluated before each subsequent execution of the statement sequence hence the statement sequence may not be executed at all The repetition stops as soon as the evaluation of the expression yields the value FALSE A while statement has the following form and is equivalent to the shown loop statement while expression do loop statement_sequence if expression then exit end if end while statement sequence end loop Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe ls
127. ion in memory An unsigned integer value is internally represented as one 32 bit word Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 20 voniof 4 96 4 8 1 3 Type REAL Values of the type REAL represent approximations of the mathematical real numbers Their range is given by the predefined constants MIN REAL and MAX REAL corresponding approximately to the range 3 4028 E438 to 3 4028 E438 Real values may be written either in decimal notation with integer part and fractional part separated by a decimal point or in the scientific or exponential notation as defined in 4 1 2 4 3 The operators that may be used with REAL operands are and which represent addition subtraction multiplication division and exponentiation respectively For the exponentiation operator the right operand must be of type INTEGER or UNSIGNED INTEGER The relational operators lt lt lt gt gt gt are also applicable to this type they yield BOOLEAN values The predefined procedures functions MIN MAX and ABS may be used for REAL see 4 15 Representation in memory A REAL value is internally represented using one 32 bit word in IEEE standard single
128. ipment Name tree hierarchical tree structure within the MDB which decomposes the system into subsystems equipment etc The topmost node of the name tree is called the root node whereas terminal nodes leaf nodes represent the items that cannot or need not be further decomposed the end items Each MDB object is identifiable by a pathname indicating the succession of nodes to be traversed to reach that particular object in the name tree Network group of computers workstations and or terminals that are linked together to allow the sharing of resources data and peripherals Nickname an alias for a database item that may be used instead of a pathname Nicknames are predefined in the database Node component of a network or tree structure Operating system OS system software that controls the computer and its parts performing the basic tasks such as allocating memory and allowing computer components to communicate Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 2 2 von of B 2 in a hierarchical structure denotes an immediate ancestor of a network or tree component see Name tree rules dealing with the meaning of the language elements symbols constants variables statements etc software generated unique number assigned to each M
129. ison on equality and inequality lt gt Statecode types may be unconstrained or constrained e An unconstrained statecode type is denoted by the keyword statecode it comprises all possible statecode literals e A constrained statecode type is restricted to a specific set of statecode literals This is denoted by the keyword statecode followed by the list of allowed literals in parentheses All declared statecode types are subtypes of the general predefined type statecode Formal Syntax Statecode Type Statecode List statecode Statecode List Statecode Statecode Statecode Identifier Identifier see 4 1 2 2 Examples type Code statecode unconstrained type type Switch statecode SON SOFF constrained type variable 51 statecode unconstrained variable variable S2 Code unconstrained variable variable S3 Switch constrained S1 7 S2 S3 7 not allowed constraint violation 52 SON S3 SOFF Representation in memory Internally a statecode variable is represented by two 32 bit words containing the corresponding statecode literal as an ASCII character sequence up to 8 characters in all upper case left justified and padded with blanks The literal is represented as 8 blanks Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date
130. kelvin degree Celsius kelvin mole candela radian steradian hertz 1 newton pascal bar Quantity length area volume mass time electric current temperature temp difference amount of substance luminosity plane angle solid angle frequency rotational freq force pressure CGS RIBRE STD 0001 Dok Nr Doc No C 5 Ausgabe lssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page G 3 von of G 6 Sym Supported multiples of this unit Definition J TJ GJ MJ kJ mJ 1J21Nm 1 eV 1 60219 S 10 19 J INm INm 1J 1 8 188 1 Ah z 3 6 kC 1V 1JC 1F 1C V 1W 1 V A 1S21W l 1Wb 1Vs 1 T 1Wb m 1H 1Wb A 1 Im 1 cd sr 1 1x 1 Im m 1Bq 1s 1 Gy J kg 1 Sv 1 J kg 1 km h 1 3 6 m s 1 knot 0 514 m s eV GeV MeV keV Nm MNm kNm mNm uNm W GW MW kW mW uW C MC kC mC uC nC pC Ah mAh uAh V MV kV mV uV F mF uF nF pF Ohm GOhm MOhm kOhm mOhm 5 kS mS uS mWb T mT uT nT H mH uH nH pH Im Bq Gy Sv m s km h knot rad s m s2 kg m3 kg l gll kg m mg m Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 e EADS SI unit joule electronvolt Nm watt coulomb Ah volt farad ohm Q siemens weber tesla henry lumen lux becquerel gray sievert rad s m s2 kg m kg m Quantity energy work hea
131. kilogram This variable is com patible with other variables of type REAL which are associated with a unit commensurable to kilogram Unitized types are forbidden in such declarations For example variable Temp Furnace Temperature degC is not allowed because Furnace Temperature is already a unitized type 4 11 8 Compatibility of Unitized Types Two unitized types are compatible if the types are compatible without the unit and the two units are commensurable i e of the same physical dimension A type conversion both converts the value to the representation of the other type and rescales the value to the other unit if necessary Types that are im plicitly converted to each other INTEGER UNSIGNED INTEGER and REAL LONG REAL will also be implicitly converted if they are associated with a measurement unit Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 46 von of 4 96 4 11 9 Unitized Literals amp Constants In the UCL source code unitized values may be formed by suffixing a real or integer value with their appropriate unit which is written in brackets in the syntax described below As stated above it is possible to derive other units using the and operat
132. lared before the AP header the implicit AP alias and the parameter list not the items within the AP e for parameterized MDB items formal parameter lists the items declared together with the parameter list and the implicit alias if defined An imported identifier will be hidden if e the same identifier is imported from more than one module The conflicting imported identifiers are then hidden throughout the compilation unit e the same identifier is declared within the importing compilation unit The imported identifier is then hidden throughout the scope of the local identifier e there is an identical predefined identifier The imported identifier is then hidden throughout the compilation unit An imported identifier can thus never hide a predefined identifier or an identifier declared in the compilation unit Imported identifiers even if hidden can always be accessed with a qualified identifier see section 4 3 4 Formal Syntax Import import Name Names see 4 3 4 Example import APM ONBOARD DMS SYSLIB import GROUND_LIBRARY import via alias nickname Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 10 von of 4 96 4 3 Declarations Names and Scopes 4 3 1 Identifiers All UCL objects
133. m Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 18 von of 4 96 cgs Kbps 4 8 Type Declarations Every UCL object has a type defining the set of valid values that it may take and the set of operations that may be performed on it UCL types fall into the following broad categories NTEGER REAL etc as well as the e Elementary types comprise all predefined types 1 enumeration types section 4 8 1 11 and subrange types section 4 8 1 12 which enable users to create new data types Such user defined types make code more readable and let the user exclude illegal values from storage in variables e Structured types allow the definition of data structures arrays records sets strings e Unitized types are for dimensioned quantities i e associated with a unit of measure e Pathname types and subitem pathname types represent references to MDB items or their subitems resp e Inherited types are types inherited from the software types of database items A type declaration is introduced with the reserved word type followed by the type identifier The symbol associates the identfier with the type definition Note that atype declaration need not introduce a new type it may define a synonym to an existing type ns type Identifier Type Uni Simple Type String Type Statecode Type Pathname Type Array Type Set Type Reco
134. m Date 2010 01 29 rium Seite Page 4 81 von of 4 96 4 16 Compilation Units A text which is accepted by the compiler as a unit is called a compilation unit There are four kinds of compilation units in UCL e Main program called Automated Procedure in the COLUMBUS UCL environment e Library specification e Library body e Formal parameter list definition e Derived value Automated Procedures An Automated Procedure AP constitutes a parameterized UCL program or main procedure It may import objects defined in separately compiled units called libraries and it can also be imported by other objects see 4 2 Libraries A UCL library like a package in Ada or a module in Modula 2 is a collection of computational resources procedures functions data types variables etc that may be used by the library s clients by importing the provided objects or services In the UCL context these clients may be any kind of compilation unit A UCL library consists of two parts a library specification and a library body implementation part Each part is compiled separately The library specification identifies the resources that are visible to its clients whereas the body contains the corresponding implementation details and is hidden from the clients All objects declared in a library specification are available in the corresponding body without explicit import Also note that all libraries including system libraries must be expl
135. m of an aggregate with the array elements enumerated in parentheses value value value Aggregates of multidimensional arrays are expressed in nested form A matrix is written as a vector line 1 line 2 line n of line vectors value value value value value value value value value A three dimensional array as a vector of two dimensional planes which are written as vectors of line vectors This concept is recursively applied to any dimensionality plane 1 plane n value value value value value value value value value value value value value value value value value value An empty aggregate for an array with no element is written as an empty pair of parentheses Aggregates are expressions see 4 12 Representation in memory An array is represented as a sequence of its elements in their respective representation Arrays with more than one dimension are stored column wise i e such that for all index positions i and 1 indices on position 1 1 vary faster than on position 1 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 28 voniof 4 96 4 8 2 2 Record Types
136. meter 4 65 4 74 6 in parameter 4 64 4 74 INC procedure 4 19 4 24 4 79 INCL procedure 4 30 4 79 index 4 26 index type 4 26 inherited type 4 18 4 37 integer number 4 4 INTEGER type 4 19 interactive commands 3 1 L LENGTH function 4 32 9 lexical element 4 1 4 2 library 4 85 library body 4 86 library implementation 4 86 library specification 4 85 lifetime of objects 4 12 line length 4 1 logical operator 4 52 LONG_REAL type 4 20 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page I 3 von of 4 SI system 4 42 slice 4 32 software type 4 14 source code 4 1 standard function 4 78 standard procedure 4 78 statecode literal 4 5 statecode type 4 22 statement 4 63 statement sequence 4 63 string conversion 4 60 string literal 4 6 string type 4 32 structural compatibility 4 39 structured type 4 18 4 26 subitem 4 13 subitem pathname 4 13 subitem pathname type 4 18 4 36 subprogram declaration 4 74 subrange type 4 25 substring 4 32 symmetric set difference 4 30 syntax notation 3 5 T tag field 4 28 temperatures special treatment for 4 46 time literal 7 TIME type 4 23 type 4 18 type conversion 4 54 type declaration 4 18 U unbound array 4 74 See also procedure declaration unbound string 4 65 4 74 u
137. n an inner scope a subprogram In this case two different objects are denoted by the same identifier and the identifier declared in the inner scope hides the same identifier declared in the outer scope Within the inner scope the hidden variable from the outer scope still exists but is not visible and cannot be accessed e The predefined identifiers INTEGER REAL BOOLEAN etc belong to a global scope outside the compilation unit Like any other identifiers they may be redeclared within inner scopes main program or subprogram This will hide the predefined identifier for the rest of the block Redeclarations of predefined identifiers are legal but usually they obscure the program and should be avoided e The scope of record field names is the record Since record field names are always written in dot notation prefixed with the name of the record variable there is never a name conflict e The scope of a for loop variable is the body of the for loop see 4 13 5 4 Since for loops may be nested the loop variable of an inner loop may hide a loop variable of an outer loop and loop variables may hide identifiers declared outside the loop Libraries and other importable modules have their own scope The scope of an identifier declared in a library specification comprises both the specification up from its declaration and the body of the library Identifiers declared in a library body are visible in the body only When imported all identi
138. n part Note that the syntax of REAL and LONG_REAL values requires at least one digit after the decimal point exp specifies the width of the exponent in REAL LONG_REAL floating point representation For exp 0 fix point notation no exponent will be used Omitted format parameters default to 0 If all format parameters are 0 or omitted UCL standard format will be used Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 61 von of 4 96 pathname alias unit Qualified Identifier Expression Format Formal Syntax String_Conversion pathname alias unit string Expression Format 123 123 123 1 23 1 230000 1 230000E 00 13 30 00 13 30 00 000 FF FF FF FF abc tid IL some path name xyz if xyz is the database alias of some path name m s if some path name has the unit m s m s Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Format Width Aft Exp Width Aft Exp Expression Qualified Identifier see 4 3 4 Expression see4 12 Examples string 123 string 123 5 string 123 5 string 1 23 stri
139. n unit 4 81 COMPLETION CODE type 4 24 concatenation 4 32 concatenation operator 4 52 constant 4 17 constant declaration 4 17 constant expression 4 50 conversion 4 54 counting units 4 42 4 56 D database 80000 1 DEC procedure 4 19 4 24 4 79 declaration 4 10 default value 4 74 delimiter 4 2 dependency 5 1 dimension 4 26 dollar sign for state code identifiers 4 5 duration literal 4 7 DURATION type 4 23 E element type 4 26 elementary type 4 18 4 19 end of line 4 3 enumeration type 4 20 4 24 EXCL procedure 4 30 4 79 4 80 exit statement 4 73 expression 4 49 F floating point 4 5 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 005 __ A ABS function 4 19 4 20 4 78 access class 4 14 actual parameter 4 53 aggregate 4 27 4 32 alias declaration 4 41 analog measurement 4 13 annotation 4 16 AP 3 1 arithmetical operator 4 51 array index 4 26 array type 4 26 ASCII 4 5 assignment 4 63 automated procedure 3 1 4 82 B base unit 442 based integer number 4 4 bitset constant 4 31 BITSET type 4 31 Boolean operator 4 52 BOOLEAN type 4 20 byte string 4 6 byte string literal 4 6 BYTE type 4 21 C case sensitive 4 3 case statement 4 66 character literal 4 5 character set 4 1 character string 4 6 character string literal 4 6 CHARACT
140. nd functions can be marked as guarded as shown in the example library Ground Library guarded procedure Enable Monitoring guarded Item Monitor Item guarded procedure Disable Monitoring guarded Item Monitor Item guarded procedure Issue guarded Command Command Item end Ground Library Guarded parameters must be of a pathname or parameterized pathname type When the procedure or function is called the calling subprogram or the compilation unit resp inherits the privileges of the items that are passed as parameters procedure AP import VsomeNpathNGround Library Import is always guarded wad inherit the library s privileges begin Issue Issue is guarded NsomeNpathNCmd 1 command parameter is guarded other parameters are not guarded oe so inherit the privileges of Issue nae and some path Cmd_1 end AP Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 96 voniof 4 96 4 17 4 Dependencies Imposed by Privileges Please note that inheriting privileges from another item imposes a dependency on that item This may create a hierarchy of dependencies between a group of items When the privileges of an item are changed the item becomes outdated
141. ng 1 23 0 6 string 1 23 0 6 4 string 13 30 string 13 30 0 3 string FFFFFFFF string abc 5 pathname string Path_Variable alias string Path_Variable unit string Path_Variable unit string 10 0 m s Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 62 voniof 4 96 4 12 4 4 Input Output Format When converted to string representation see 4 12 4 3 some lexical elements take a form different from their literal form discribed above Characters are shown without enclosing single quotes e Strings are shown without enclosing quotation marks and quotation marks within the string are not doubled e Byte strings are shown without enclosing quotation marks e Statecode values are shown without the leading dollar sign The no statecode value remains e The low level types BYTE WORD and LONG_WORD are shown as byte strings with the corresponding length e Measurement units are not enclosed in square brackets The table below gives examples for these different forms Type UCL literal 1 O format CHARACTER ral a string hello hello string with quotes string with quotes byte string OlFE 0203 AFFE 01 FE 02 03 AF FE 2 statecode SOFF OFF SCLOSED CLOSED BYTE WORD no literal like byte strings LONG_WORD
142. ng each 32 bit word stores four consecutive characters or bytes One may access individual string elements like in array indexing if S is a string variable then S 1 denotes the first character or byte in the string The first element has index 1 etc Strings of different lengths may be assigned and compared If a string with an actual length longer than the maximum length of the target string is to be assigned a run time error occurs i e there is no implicit truncation run time error also occurs if one tries to assign or retrieve an element outside the actual length of the string Character string values are written as string literals of the form and may contain any printable ASCII characters Byte string literals have a prefix and may contain only an even number of hexadecimal digits grouped with underscore and blank characters see 4 1 2 7 An empty string is written as or respectively Supported operations on string variables are comparison and the concatenation of two strings with the operator The comparison operators gt lt gt gt compare strings in lexicographic order based on the ASCII values of the characters or on the unsigned numerical value of the bytes respectively e g aux attention character strings FF gt AAO012FF byte strings A character or byte is treated as a string of length 1 if it is concatenated with a string or another chara
143. nge Index Range of Qualified Identifier Unit Array Type Index Range Constant Expression Constant Expression Qualified Identifier Constant Expression see 4 12 Qualified Identifier see 4 3 4 Unit see 4 11 and 4 1 2 10 Examples type Row_Index INTEGER 0 10 type Col_Index INTEGER 0 20 type Vector array 1 3 of REAL type Matrix array Row Index Col Index of REAL Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS eet berarbtg Rev Datum Date 2010 01 29 Seite Page 4 27 vonlof 4 96 type Color White Red Green Blue Yellow Cyan Magenta Black type RGB Color Red Blue type Bool_Array array Red Magenta of BOOLEAN type Color_Table array Color RGB of REAL SMEDIUM S HIGH type Level statecode SLOW type Level_Array array Level of REAL Examples of LOW and HIGH variable 7 Vector variable M Matrix variable C Color_Table LOW Vector 1 HIGH Vector 3 LOW V 1 HIGH V 3 LOW Matrix 1 0 HIGH Matrix 1 10 LOW M 2 0 HIGH M 2 20 LOW C 1 White HIGH C 1 Black LOW C 2 Red HIGH C 2 Blue Aggregates An array value may be written in for
144. nge e g 5 6 7 8 9 may be written 5 9 A set may have no members at all in which case it is called the empty set and is written The operations applicable to ser variables are Operation Operator set union t set difference set intersection symmetric set difference set inclusion lt gt set comparison lt gt membership tests in The union of two sets is a set containing the members of both sets The difference of two sets is a set containing all the members of the first set that are not members of the second set The intersection of two sets is the set of objects that are members of both sets The symmetric set difference of two sets is a set containing those elements that are members of exactly one of the two sets not of both The membership operator in is used to test for set membership in is treated as a relational operator The expression I in S is of type BOOLEAN returning TRUE if I is a member of the set S The predefined procedures INCL and EXCL see 4 15 may be used to include a member in or exclude a member from resp a set variable Formal Syntax Set_Type get of Simple Type Simple Type see4 8 Examples type Id INTEGER 0 100 type Id Set set of Id type Traffic Light set of Red Green Blue type Spectrum set of Color Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No
145. nit declaration 4 43 unit expression 444 unit identifier 4 10 unit literal 4 8 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Kps _ cgs rium precedence of operators 4 51 predefined type 4 18 predefined units 4 43 privileges authorization 4 94 procedure body 4 74 4 75 procedure call 4 64 procedure declaration 4 74 4 77 procedure header 4 74 Q qualified identifier 2 R range constraint 4 4 4 25 real number 4 5 REAL type 4 20 record field 4 28 record type 4 28 recursive call 4 12 4 65 reference 5 1 relational operator 4 52 repeat statement 4 69 reserved words 4 3 return statement 4 72 root pathname 4 3 S scope 4 10 of loop index 4 70 separator 4 1 set comparison 4 30 set constant 4 31 set difference 4 30 set inclusion 4 30 set intersection 4 30 set membership test 4 30 set operator 4 52 set type 4 30 set union 4 30 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 von of 4 variant 4 28 vocabulary 4 1 W while statement 4 68 WORD type 4 21 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Kos cgs rium unitized constants 4 46 unitized type 4 18 4 42 unitized value 4 42 units of measure 4 42 U
146. nts and already defined constant identifiers it can thus be computed at compile time A constant declaration is introduced with the reserved word constant followed by the name of the constant A colon associates the constant with a type the becomes symbol associates it with a value For string constants the type may be given as just string the maximum length need not be specified it is then assumed from the assigned string value Formal Syntax Constant_Declaration constant Identifier Constant Type Constant_Expression Constant_Type Qualified Identifier Unit string of Identifier statecode pathname 6 Mk Qualified Identifier see 4 1 2 2 Constant Expression Expression Expression see4 12 Unit see 4 11 and 4 1 2 10 Examples constant Two REAL 2 0 constant Lower Limit REAL 25 36 constant Upper_Limit REAL Two Lower Limit constant Warning string Value exceeds upper limit constant Code string of Byte FF 0102 AE F1 0103 EO 00 constant On statecode SON constant Max_Voltage Voltage 100 0 V see unitized values constant High Value INTEGER MAX INTEGER constant Set Value i BITSET 0 3 4 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datu
147. nversion yields the effective quantity Examples REAL 3 6 km h returns 3 6 INTEGER 3 6 km h returns 3 conversion REAL to INTEGER truncates REAL 2 5 doz returns 30 0 INTEGER 2 5 doz returns 30 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS e berarbtg Rev Datum Date 2010 01 29 Seite Page 4 57 von of 4 96 Non Unitized Type to Unitized Type Conversion real value long real value integer value unsigend integer value unitized type unitized type unitized type unitized type anana The result of type conversion is the unitless value expressed in units of unitized_type A conversion between real and integer values is done if necessary Examples type Velocity REAL m s type Distance INTEGER km type Dozen REAL doz Velocity 3 6 returns 3 6 m s Distance 3 6 returns 3 km Dozen 24 0 returns 2 0 doz Unitized Type to Unitized Type Conversion unitized_type unitized_value The type of unitized_value must be commensurable with unitized_type The result of this type conversion is the value of unitized_value expressed in units of unitized_type A conversion between real and integer values is done if necessary Example
148. o their MDB pathnames Node names and pathnames are thus syntactically equivalent Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 16 von of 4 96 4 4 Annotations Declared items can have a so called annotation attached An annotation is a descriptive text that is kept together with the item and can be displayed in an HLCL command window as part of the help output for the item Annotations will typically be used in library specifications 4 16 2 but can be used in any compilation unit for any type of declaration The form of an annotation is very similar to a list of comments the only syntactic difference is that annotation lines start with while comment lines start with both extend to the end of the line An annotations given directly after a declaration is attached to the item defined by that declaration For subprogram declarations an annotation is given after the subprogram header 4 5 For AP and library declarations 4 16 it is given after the AP or library header respectively Annotations may be applied to all declared items including enumeration literals 4 8 1 11 fields of a record 4 8 2 2 and formal parameters 4 6 Formal Syntax Annotation Annotation Line Annotation Line Annotation Line gt
149. of the above mentioned types and all must be of the same type or implicitly convertible to each other MAX a determines the maximum element of the array a The array may be of any dimension and the elements must be of one the above mentioned types MIN Function MIN t denotes a constant equal to the minimum lowest value of the type 5 where t may be one of the basic types INTEGER UNSIGNED INTEGER REAL LONG REAL TIME DURATION enumeration types MIN X1 X2 Xn determines the minimum of a group of values The values must be of one of the above mentioned types and all must be of the same type or implicitly convertible to each other MIN a determines the minimum element of the array a The array may be of any dimension and the elements must be of one the above mentioned types LOW Function LOW a returns the lowest index of the array or string type or variable a For strings it is always 1 The return value has the type of the corresponding index for open arrays and strings it is always INTEGER 0 for open arrays 1 for open strings LOW a n returns the lowest index of the n th dimension of the multidimensional array type or variable a The return value has the type of the corresponding index Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5
150. on Numerator Denominator Offset Offset Number Number Unit Term Unit Term Number Unit Factor Unit Term Number Unit Factor Unit Factor Number Unit Identifier Digit Letter Letter Simple Integer Based Integer Real see 4 1 2 4 1 see 4 1 2 4 2 see 4 1 2 4 3 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Formal syntax Unit Unit Expression Offset Numerator Denominator Unit Term Unit Factor Unit Identifier Number Simple Integer Based Integer Real Examples kg kg m s A s N m s2 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 49 von ot 496 4 2 Import Import is used to make objects declared in other compilation units e g libraries available to the current compilation unit Importable modules are libraries automated procedures and parameterized MDB items The module is given by its pathname see section 4 3 6 When imported all identifiers exported by the imported module units constants types variables aliases procedures and functions become visible throughout the compilation unit For the different types of modules the exported part is for libraries the library specification e for automated procedures the items dec
151. on alias Identifier Name Identifier Procedure Heading guarded procedure Identifier Formal Parameters Procedure Declaration Procedure Heading Block Function Heading guarded function Identifier Formal Parameters Qualified Identifier Unit Function Declaration Function Heading Block Block Declaration begin Statement Sequence end Identifier Formal Parameters Parameter List Parameter List Parameter List guarded in out Identifier List Formal Type Constant Expression Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe ssue 5 Datum Date 2009 02 01 EADS ed berarbtg Rev Datum Date 2010 01 29 eubriurnm Seite Page D 3 voniof D 7 Types Formal Type Formal Simple Type array of Formal Simple Type string of Identifier Formal Simple Type Qualified Identifier Unit statecode pathname pathname Type Simple Type String Type Statecode Type Pathname Type Subitem Pathname Type Array Type Set Type Record Type Inherited Type Simple Type Qualified Identifier Unit Enumeration Subrange Enumeration Identifier List Subrange Qualified Identifier Constant Expression
152. ors offsets and exponenti ations with integer numbers Such unit expressions described below must be enclosed in square brack ets They follow a syntax which allows unit expressions as close as possible to the normally used scien tific syntax as defined in ISO 1000 Examples 10 0 degC 1 3E 3 K 35 5 m s 100 0 m2 kg s2 2 0 doz 4 11 10 Expressions with Unitized Values Unitized values can be used in arithmetical expressions according to the following rules In assignments both operands must have commensurable units The UCL compiler converts units as necessary Example variable X REAL Kabs X 25 0 degC automatic conversion from Celsius to Kelvin e n additions or subtractions both operands must have commensurable units The UCL compiler converts units as necessary choosing the smaller finer of the two units as the resulting unit The other operand is adapted converted to this smaller unit before the operation is performed Note that counting units are commensurable with unitless values When different counting units are involved those operands are converted to scalars Special treatment is needed to handle conversion between temperatures correctly as there are temperatures and temperature differences Also special conversion rules apply to measurements of temperatures because the subtraction of two temperatures yields a temperature difference for any other unit it results in the unit it
153. ot inherent to the language rather they are due to the specific implementation of the UCL compiler and its runtime environment Restrictions on UCL procedures also apply to UCL functions e Maximum length of a line of text and hence of an identifier is 256 characters e Maximum number of local variables parameters in one procedure is restricted to 65536 or 216 e Maximum number of global variables parameters in one compilation unit is 65536 or 219 e Maximum number of procedures in one compilation unit is 65536 or 216 e Maximum size of a record variable is 65536 words or 216 e Maximum number of elements in a set is 65536 or 216 e Maximum number of components in an array is 231 1 e Maximum number of characters in a string is 231 1 e Maximum number of imported user libraries in one AP is 65536 or 216 e Maximum number of imported system libraries in one AP is 65536 or 216 e Maximum size of a boolean expression containing amp or operators is 65536 or 216 bytes The UCL Compiler is part of the Columbus Ground System CGS Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page I 1 von of 4 cgs INDEX annotation 4 1 comment 4 1 comparison operator 4 52 compatibility 4 38 compilation 5 1 compilation order 5 1 compilatio
154. predefined identifiers A procedure or function declaration may appear within an AP or a library but not within another procedure or function After the end keyword the name of the procedure may be repeated Also note that parameters of mode in may not be modified within a procedure body i e they are not allowed as targets in an assignment statement and must not be passed as an out orin out parameter to another subprogram Formal Syntax Procedure_Declaration Procedure_Heading Block PROCEDURE Identifier Formal Parameters Declaration begin Statement Sequence end Identifier Parameter List Parameter List in out Identifier List Formal Type Constant Expression Identifier Identifier Formal_Simple_Type array of Formal Simple Type string of Identifier Qualified Identifier statecode pathname C pathname see 3 see 4 13 see 4 1 2 2 see 4 3 4 see 4 12 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Procedure Heading Block Formal Parameters Parameter List Identifier List u Formal_Type Formal_Simple_Type Declaration Statement_Sequence Identifier Qualified Identifier Constant Expression Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS ed
155. r and types of parameters Such operational restrictions must be observed by the programmer and will not be checked by the compiler The parameter list definition may be preceded by unit constant type and alias declarations This allows to have parameter types other than the predefined types and named default values Units constants types and aliases may also be obtained by importing them from libraries or other parameterized items Database items with formal parameter lists may be imported like libraries in any compilation unit An import makes all objects declared in the formal parameter list definition visible in the importing compilation unit This comprises explicitly declared units constants types and aliases as well as the implicitly declared alias for the item s path name Without an import a parameterized item can be used without any restrictions but any additional identifiers declared together with the formal parameter list will not be visible Formal Syntax Formal Parameter List Definition Import Unit Declaration Constant Declaration Type Declaration Alias Declaration Identifier Formal Parameters Import see4 2 Unit_Declaration see4 ll Constant_Declaration see 4 7 Type_Declaration see 4 8 Alias_Declaration see 4 10 Formal Parameters see 4 14 1 Identifier see 4 1 2 2 Example import APM GLOBAL COMMON_TYPES import common type declarations constant Lo
156. rd Type Pathname Type Subitem Pathname Type Inherited Type Qualified Identifier Enumeration Type Subrange Type see 4 3 4 see 4 8 1 11 see 4 8 1 12 see 4 8 2 5 see 4 8 1 8 see 4 8 3 see 4 8 4 see 4 8 2 1 see 4 8 2 3 see 4 8 2 2 see 4 8 5 see 4 11 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Formal Syntax Type Declaration Type Simple Type Qualified Identifier Enumeration Type Subrange Type String Type Statecode Type Pathname Type Subitem Pathname Type Array Type Set Type Record Type Inherited Type Unit Dok Nr Doc No CGS RIBRE STD 0001 6 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 ascr um Seite Page 4 19 von of 4 96 4 8 1 Elementary Types 4 8 1 1 Type INTEGER Values of type INTEGER are whole numbers which may be positive or negative Its range is given by the predefined constants MIN INTEGER and MAX INTEGER corresponding to 23 and 231 1 respectively Integer literals are defined in 4 1 2 4 1 The operators and may be applied to values of this type and represent addition subtraction multiplication division exponentiation and modulus respectively These operators are infix operators which means that they are written between their operands The and operators may also be used as unary operators to denote the sign of a value
157. re Put Integer I INTEGER Width INTEGER 1 Write a character on standard ouput 14 procedure Put Real R REAL Width INTEGER 0 Write a character on standard ouput Line and column control 21 procedure New Line Terminate current output line 30 function Column Unsigned Integer Return the current output column 31 procedure Set Column Column Unsigned Integer gt Set a new output column end IO Library Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 ascr um Seite Page 4 91 von of 4 96 4 16 3 Formal Parameter List Definitions Items in the database may have formal parameter lists When such an item is used in a context that requires parameters the item name must be given together with actual parameters conforming to the formal parameter list The formal parameter list can be defined in UCL syntax and compiled with the UCL compiler The parameter list definition is given in the same form as for an AP or a subprogram identifier formal parameter formal parameter The identifier is optional If present it will be implicitly declared as an alias for the item s path name For specific item types there may be restrictions on the allowed numbe
158. re is no such restriction e Ifthe target is an open array parameter there is no upper limit for the size but the size in bytes must be a multiple of the array element size A check is performed to enforce this restriction e For other target types the size of the value must be identical to the size of the target Example declarations as above S UNTYPED R size of R must not be greater than 10 I UNTYPED S length of S must be 4 Proc UNTYPED S length of S must be a multiple of 4 Proc UNTYPED R no check Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 60 voniof 4 96 4 12 4 3 String Conversions Values of scalar types and string types both character strings and byte strings may be converted to their textual representation according to UCL syntax by just converting them to some character string type using the high level conversion syntax Two syntactical forms are available string expression typename expression The first form creates a general string without any size restrictions The second form creates a string of the indicated specific type A check will be performed that the resulting string fits the declared size constraint of the type For pathname types t
159. remen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS e berarbtg Rev Datum Date 2010 01 29 Seite Page 4 39 von ot 4 96 subitem pathname constraints are always checked at compile time see 4 8 3 and 4 8 4 in order to avoid database queries at runtime which would otherwise be necessary to complete the check 4 8 6 2 Structural Compatibility When accessing structured runtime values of database items the strict compatibility rules described above cannot be applied e g a local array value would always be incompatible to the array value of a database item since their types can never stem from the same type declaration For this case a less restrictive compatibility concept called structural compatibility is applied Two types are structurally compatible if they have identical structure e g for array types the index types index range and element types must be identical Example type Matrix array 1 3 1 3 of REAL variable M Matrix M APM EGSE DATA M1 The assignment is legal if M and the database item are structurally compatible i e if the type of the database item is structurally identical to the type Mat rix Note that in order to assure equal types the type of the database item can be inherited see 4 8 5 Example type Matrix type of APM EGSE DA
160. rresponding to the ordinal value of charac ter value i e its sequence number in the ASCII character set Examples INTEGER A yields 65 INTEGER E yields 69 INTEGER UNSIGNED INTEGER tO CHARACTER Conversion CHARACTER integer value CHARACTER unsigned integer value The result of this type conversion is the character whose ordinal number in the ASCII character set is integer valueorunsigned integer value resp Examples CHARACTER 65 returns character A CHARACTER 69 returns character E Enumeration to INTEGER UNSIGNED INTEGER Conversion INTEGER enumeration value UNSIGNED INTEGER enumeration value The result of this type conversion is the integer corresponding to the position of enumera tion value in the enumeration list The first element in the list has the position 0 Examples type Color Red Green Blue INTEGER Green returns 1 INTEGER Red returns 0 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 4 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS berarbtg Rev Datum Date 2010 01 29 Seite Page 4 56 von ot 4 96 INTEGER UNSIGNED INTEGER to Enumeration Conversion enumeration type integer value enumeration type unsigned in
161. rted library and the declaration in its parameter list import NAPMNUCLNONBOARD LIBRARY type Switch statecode SOFF SON procedure Check Measurement Discrete Value Item imported type State Switch type declared above variable Value statecode begin Get Discret Measurement Value if Value State then Submit Event halt Failure end if end Check Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 85 von ot 4 96 4 16 2 Libraries In UCL a library is an encapsulation mechanism or envelope for data structures and operations similar to a package in Ada or a module in Modula 2 There are two types of UCL libraries e user libraries which have both their specification and implementation body written in UCL e system libraries which are special predefined libraries with a UCL specification but no corresponding UCL implementation Such libraries will be provided by the target specific runtime environment presumably as part of the interpreter From the user point of view the library type is transparent Both types of libraries are imported and used in exactly the same way A library consists of two parts belonging to two separate compilation units library sp
162. rted to keep a unit expression as clear as possible Also only one division both for the unit and the offset is allowed in a unit expression thus avoiding ambiguous expressions Please note that factors and offsets may only be used within the defining unit expression in a unit declaration but not as a unit literal otherwise Thus while the forms 1000 m and 12 are legal as the defining part in the declarations unit km 1000 m unit doz 12 they are not in expressions like 1 0 1000 m and 2 0 12 Instead use 1 0 km and 2 0 doz Examples unit bit new base unit bit unit Byte 8 bit unit Byte derived from bit unit N kg rn Newton unit Pa N m2 Pascal unit km 1000 mis kilometer unit degC Kabs 273 15 degrees Celsius unit degF 10 degC 18 320 18 degrees Fahrenheit unit doz 12 dozen Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 45 von of 4 96 4 11 6 Unitized Types In type declarations a unit clause is used to indicate a unitized value type or unitized type for short The associated type is given first then a unit expression Variables and constants declared to be of a unitized type are bound to values of the respective phys
163. rted to scalars The resulting unit is always normalized to contain base units only e Anyunitized value can be multiplied with or divided by a unitless value The resulting unit is the unit of the unitized operand e In exponentiations the unitized values can be raised to constant integer powers only This opera tion is equivalent to a multiplication or division of values with the same unit It results in a new unit which will be normalized to contain base units only Operands with counting units are con verted to scalars Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Examples unit bit base type bit unit px base type pixel unit Byte 8 bit unit degC Kabs 273 15 unit km 1000 m unit h 3600 s unit mi 1 609 km unit doz 12 type Temperatur REAL degC type Voltage REAL V type Speed REAL m s type Acceleration REAL m s2 type Dozen REAL doz type Color Depth INTEGER bit px constant Max Voltage Voltage 100 0 V variable T Temperature variable V Voltage variable 5 Speed variable A Acceleration variable M REAL m variable D Dozen variable C Color Depth T 37 5 degC T 10 5 V invalid because T is of type TEMPERATURE 24 0 assigns 2 0 doz V A B C valid only if A B C refers to an MDB item of the appropriate type voltage measurement if V gt 5 0 V
164. ry BYTE and WORD values are represented as one 32 bit word Within strings four BYTE values are packed in one 32 bit word Within strings four BYTE values are packed in one 32 bit word see 4 8 2 5 LONG WORD values are represented as two consecutive 32 bit words Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 22 vonlof 4 96 4 8 1 8 Statecode Types The set of legal values for a statecode type comprises the literals indicating the predefined states of discrete items e g on off open closed low medium high etc Statecodes are defined in the Mission Database as attributes of the respective discrete items In UCL statecode constants are denoted by identifiers prefixed with a dollar sign such as SACTIVE SOFF see 4 1 2 5 The special literal means no statecode value It may be used e g as a default value for statecode parameters or as an initial or dummy value for statecode variables is compatible to all statecode types regardless of constraints Statecode types represent unordered sets of values i e there is no defined less greater relationship between the statecode literals and the relational operators cannot be used The only allowed operation on statecode values is compar
165. s APM DMS ITEM_ A set current runtime value of the global software variable named NAPMNDMSNITEM A to 3 5 valid only if the MDB item s access class is READ WRITE and its software type is REAL Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 15 von of 4 96 check whether current runtime value of MDB item named APM XYZ SWITCH is OPEN valid only if the MDB item s access class is READ or READ WRITE and its software type is statecode assign current runtime value of MDB item NAPMNDMSNITEM X to the local variable X valid only if the MDB object s access class is READ or READ WRITE and its software type is compatible with the type of X pass an MDB item named NAPMNxyzNPOWER ON as a parameter to a system library procedure Here a reference to the item is passed not its runtime value The procedure may retrieve its definition from the MDB including stimulus characteristics target equipment authorization etc SOPEN e EADS sascr um NAPMNDMSNITEM X ER ON APM xyz POWI if APM XYZ SWITCH x vs Issue 4 3 7 Node Names UCL is designed for use in a networked environment consisting of several network nodes processors These nodes are referenced by node names which correspond t
166. s i e no dynamic arrays except in parameter list of procedures and functions Strings may vary in length up to a fixed user declared upper limit e Operators 8 amp l lt lt gt gt lt gt in e Implementation restrictions Several restrictions are indirectly imposed on the language through the I code and symbol table definition These restrictions are summarized in Appendix H Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EA D 5 od berarbtg Rev Datum Date 2010 01 29 oS Seite Page 3 5 von of 3 5 3 3 Syntax Notation Throughout this manual the syntax of UCL is described in an Extended Backus Naur Form The symbol equal sign separates a syntactic class from its definition Terminal symbols 1 6 literals are enclosed in double quotes If the quote character appears as a literal itself it is written twice Braces curly brackets denote repetition i e the enclosed item may appear zero or more times e g A means 0 or more occurrences of A Square brackets enclose optional items 1 6 the enclosed item may appear once or be omitted e g A means 0 or 1 occurrence of A A vertical bar separates alternative items e g A B means either A or B but not both Parentheses are used for grouping e g a b c stands for ac b
167. s are done using the special predefined function UNTYPED The function call UNTYPED expression removes the type from the expression and makes it convertible to any other type A conversion is implicitly perfomed when assigning the untyped expression to a variable or passing it as a parameter to a subprogram or by converting it explicitly into a specific target type with the usual conversion notation For strings only the string contents excluding the length field is converted The size of a string value to be converted is the current string length and the length of a string target is set according to the size of the value Example type Rec record end record variable R Rec variable S string 10 of BYTE variable I INTEGER variable P pathname procedure Proc A array of WORD begin end Proc I UNTYPED P get SID of pathname P UNTYPED I get pathname of SID S UNTYPED R convert record to string of bytes R UNTYPED 5 convert string of bytes to record Proc UNTYPED R pass record as an array of words if I INTEGER UNTYPED P then end if explicit conversion For a low level conversion the size of the value to be converted must fit the size of the target type A check is done to enforce this restriction e If the target is a string the size in bytes of the value must not be greater than the maximum size of the string For open string parameters the
168. same is true for the supported multiples of this unit in the next columns The Definition column exactly defines the unit Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 Ausgabe ssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page G 2 von of G 6 cgs Supported multiples of this unit Definition mm um nm pm baseunit 1 AU 149597 870 106 m 1 pc 206265 AU cm2 mm2 1m 1mem mm3 1m 1memem ml 1121dn and the lower case letter I denote the unit liter ug base unit 1 u 1 66053 S 10 27 kg 1t 10 kg ns base unit min 60s 1 h 60 min 1d 24h uA nA pA base unit base unit 10 5 base unit umol base unit base unit supplementary unit m m supplementary unit m2 m2 MHz kHz 1Hz 1s mN uN 1 N 1kg m s kPa mPa uPa 1 Pa 1 N m 1 bar 105 Pa Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 km cm km2 dm2 dm3 cm3 hl cl Sym AU pc m2 m3 LL he upper case letter L g mg ms us kA mA kmol mmol mrad urad THz GHz min MN kN GPa MPa mbar ubar kg Kabs degC mol cd rad ST bar M d EADS SI unit meter astronomic unit parsec m m liter Note that both t kilogram atomic mass unit tonne second minute hour day ampere
169. see 4 1 2 2 Examples GROUND LIBRARY Issue a procedure declared in a library APM EGSE USER_LIBS MATH_LIB Matrix a type declared in a library Ground_Library an alias predefined in the database 4 3 5 Lifetime of Objects Apart from the static scope hierarchy described above objects in UCL have a dynamic behaviour An object is created when the block whose scope it is declared in is activated it is deleted when the block terminates Objects declared in an AP are created when the AP is started and deleted when the AP terminates Objects declared in a subprogram procedure or function are created when the subprogram is called and deleted when the subprogram ends So in each call of the subprogram its locally declared identifiers will denote different objects When a subprogram is called recursively each incarnation of the subprogram will have its own set of local objects These sets of objects form a stack according to the subprogram call hierarchy The identifiers denote the objects in the uppermost incarnation of the subprogram i e the currently active incarnation e All objects declared in the specification or body of any modules linked to an AP by direct or indirect import are created when the AP is started and deleted when it terminates e The predefined objects are created when the AP is started and deleted when it terminates A for loop variable is created when the loop is entered and deleted when the loop ends
170. self Examples 100 0 Kabs 90 0 Kabs 10 0 K 100 0 Kabs 10 0 K 90 0 Kabs 100 0 Kabs 10 0 Kabs is invalid 100 0 K 10 0 K 90 0 K 100 0 K 10 0 K 110 0 K e Likewise for comparison operations the operands are adapted to the smaller of the involved units When different counting units are involved those operands are converted to scalars e The same holds for the MIN and MAX functions see 4 15 All operands are adapted to the small est of the involved units values with counting units are converted to scalars e In multiplications the operands can be of different units The result is another unit or a unitless value Values with counting units are converted to scalars Examples a force length work or in units Newton Meter m kg s Joule b duration frequency unitless value But note that the resulting unit is always normalized to contain base units only Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 berarbtg Rev Datum Date 2010 01 29 Seite Page 4 47 von of 4 96 n divisions the operands can be of different units The result is another unit or a unitless value Operands with commensurable units are adapted to the smaller of the involved units before per forming the operation Values with counting units are conve
171. shows correspondences between MDB item types and UCL types e Appendix G shows the ISO 1000 engineering units e Appendix H summarizes issues of implementation At the end of the document there is an alphabetical index Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 E AD 5 6 5 Ausgabe ssue 5 Datum Date 2009 02 01 ih berarbtg Rev Datum Date 2010 01 29 astrium Seite Page 2 von of 2 1 2 Applicable and Reference Documents 2 1 Applicable Documents none 2 2 Reference Documents 2 2 1 High Level Command Language HLCL Reference Manual CGS RIBRE STD 0002 2 2 0 UCL Virtual Stack Machine and I Code Reference Manual CGS RIBRE STD 0003 2 2 3 Mission Database MDB User Manual There are specific MDB user manuals for different target systems 2 2 4 ISO 1000 SI units and recommendations for the use of their multiples and of certain other units International Standards Organisation Geneva Switzerland 2 2 5 ISO 646 Information Processing ISO 7 Bit Coded Character Set for Information Interchange International Standards Organisation Geneva Switzerland Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe ssue 5 Datum Date 2009 02 01 EADS a g berarbtg Rev E Datum Date 2010 01 29 Seite Page 3 1 von of 3 5 3 Overvi
172. ssue Execute_AP Enable_EVL etc are imported from a system library named APM UCL GROUND_LIBRARY procedure Mode_Off import APM UCL GROUND_LIBRARY constant Limit REAL 15 0 variable AP_Id AP_Identifier variable AP_Code INTEGER variable Status INTEGER alias Equipment APM PAYLOAD EQUIPMENT_UNIT_A begin if Equipment NOSHARE FLAG SON then Write Message To User Equipment error Status halt FAILURE elsif Equipment NMMODE SOff then if EquipmentNSENSOR 1 gt Limit then check sensor output Write Message To User Limit exceeded Status halt FAILURE else Issue EquipmentNPOWER OFF Status Status end if end if Delay 10 0 s if EquipmentNSENSOR 1 lt Limit then Execute AP Equipment COMMAND MODE_ON AP Id Status Synchronize With AP AP Id NN AP Code Status T end if Equipment Mode SOFF update the status flag Enable_EVL Equipment MODE Status write flag to memory end Mode_Off Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EADS cid berarbtg Rev Datum Date 2010 01 29 Seite Page 4 84 von of 4 96 Example This AP has an import and declaration section before its header It uses identifiers from both the impo
173. stem A halt statement takes the form halt completion_status The expression is optional It is of the type COMPLETION_CODE By default SUCCESS is assumed At runtime depending on the AP activation method the completion code may be sent either e to the calling AP on request e tothe supervisory higher level software responsible for AP activation e toan interactive user who started the AP via an interactive High Level Command Language HLCL command as e g in an EGSE environment on request Note that unlike a return statement the halt statement causes termination of the AP i e of the main program A call to the halt statement itself is optional an AP may terminate without such a statement in which case halt SUCCESS is assumed by default Formal Syntax Halt Statement halt Expression Expression see4 12 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS berarbtg Rev Datum Date 2010 01 29 Seite Page 4 73 von of 4 96 4 13 8 exit Statement The exit statement consists of the keyword exit It causes termination of the innermost enclosing loop execution is resumed with the statement following the loop Any iterative statement i e Loop while repeat or for may be left via an exit statement Formal Syntax Exit Statement
174. straints of the subtype If the value is constant and thus known to the compiler the compiler will do the check otherwise it will be carried out at runtime For pathname and subitem pathname types the check will always be done at compile time it makes sure that the target subt ype 18 not more constrained than the type of value Note A special case is the conversion of a type to itself which is allowed but has no effect Example type Short INTEGER 0 2 16 1 type Switch statecode SLOW SMEDIUM SHIGH type Label string 10 variable I INTEGER variable C statecode variable S string 80 I Short I make sure I is a short integer C Switch C make sure C is a Switch value Send_Message Label S make sure S is not longer than a Label Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS e berarbtg Rev Datum Date 2010 01 29 Seite Page 459 von ot 4 96 4 12 4 2 Low Level Conversions Low level conversions circumvent the UCL strong typing concept They allow to convert a value of one type into any other type as long as the sizes fit A low level conversion does not change the representation in memory but just regards the same byte word representation to be of a different type Low level conversion
175. subitem the corresponding MDB object must therefore be accessible in the READ WRITE mode After an assignment is executed the variable has the value obtained by evaluating the expression the old value is lost i e overwritten The value to be assigned must not violate any constraints imposed on the target variable e g if the variable is of a subrange type the value must be within the bounds of the subrange Constraints are usually performed at runtime and constraint violations yield a runtime error If the value is constant und thus known to the compiler the check is performed at compilation time Checks on pathname constraints are always performed at compilation time since a runtime check would require a database access Note In string assignments left and right side may be of different lengths If the length of the right side exceeds the maximum length on the left a runtime error occurs Formal Syntax Assignment Designator Expression Designator see 4 12 Expression see 4 12 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 6 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS ed berarbtg Rev Datum Date 2010 01 29 eubriurnm Seite Page 4 64 von of 4 96 Examples type Matrix array 1 10 1 20 of Real variable S string 8 variable C CHARACTER variable A Matrix variable B Real
176. sue 5 Datum Date 2009 02 01 EADS mea berarbtg Rev Datum Date 2010 01 29 Seite Page 4 69 voniof 4 96 Formal Syntax While_Statement while Expression do Statement Sequence end while id Expression see4 12 Statement Sequence see 4 13 Examples while PM TTC MODE 0 do wait 1 0 s end while 4 13 5 3 repeat Statement A repeat statement specifies the repeated execution of a statement sequence depending on the value of a Boolean expression In contrast to the while loop the expression is evaluated after each subsequent execution of the statement sequence hence the statement sequence is executed at least once The repetition stops as soon as the evaluation of the expression yields the value TRUE A repeat statement has the following form and is equivalent to the shown loop statement repeat loop statement_sequence statement_sequence until expression if expression then exit end if end loop Formal Syntax Repeat Statement repeat Statement Sequence until Expression Statement Sequence see 4 13 Expression see4 12 Examples repeat INC Index if Table Index Used then exit end if until Index Max_Index Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe ssue 5 Datum Date 2009 02 01 EADS eed g berarbtg Rev Datum Date 201
177. t Statement Sequence Case Label List Case Labels Case Labels Statecode List Case Labels Constant Expression Constant Expression Statecode List Statecode Statecode Statecode see 4 8 1 8 Constant_Expression see 4 12 Expression see4 12 Statement_Sequence see 4 13 Examples case Traffic_Light when Red Stop_Car when Green Go_Ahead Turn_Right else No_Traffic_Light end case case Code when SLOW Sucre when SMEDIUM when SHIGH ska end case 4 13 5 Loop Statements A loop statement specifies that a sequence of statements is to be repeatedly executed until a termination condition if any becomes true or until an exit statement is executed UCL has four different forms of loop statements Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 68 voniof 4 96 The sequence of statements within a loop statement may itself contain loop statements that is loops may be nested When a termination condition has become true or when a loop is left via an exit statement control is passed to the first statement following the innermost enclosing loop after the end loop keywords and the loop statement is considered to have finished its execution Note that loops need not necessar
178. t Letter Or Digit Letter Digit Examples Valve nr 5 Sensor 12 An example of a very long identifier Reserved words Some identifiers are reserved words having a special meaning in the language They cannot be used to denote user defined entities e g variables constants The following identifiers are reserved words in UCL alias array begin body by case constant do else elsif end entity exit for function guarded halt if import in library loop of out pathname procedure record repeat return sequence set statecode string then to type union unit until variable void when while 4 1 2 3 Path Identifiers and Pathnames A Database object is denoted in UCL by its pathname see also 4 8 3 Pathname Types Syntactically a pathname consists of a sequence of path identifiers corresponding each to a level or node in the hierarchical nametree A path identifier consists of either one backslash the root pathname or two consecutive backslash characters no pathname or an identifier prefixed by a backslash character The syntax of a path identifier is less strict than the normal identifier syntax The nametree design restricts the length of a path identifier to 16 characters not including the backslash Formal syntax Path Identifier Letter Digit Letter Digit Examples of path identifiers N root pathname XX no pathname NAP NEQUIPMENT Y Pathnames are formed by a sequence of path id
179. t torque power electric charge electric potential electric capacitance electric resistance electric conductance magnetic flux magnetic induction inductance luminous flux illuminance activity ofa radionuclide absorbed dose dose equivalent velocity angular velocity acceleration density linear mass density Dok Nr Doc No CGS RIBRE STD 0001 6 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS 2 berarbtg Rev Datum Date 2010 01 29 Seite Page G4 von of 6 Quantity SI unit Sym Supported multiples of this unit Definition momentum kg m s kg m s angular momentum kg m s kg m2 s moment of inertia kg m kg m2 viscosity Pas Pas mPa s specific acoustic impedance Pa s m Pa s m acoustic impedance Pa s m Pa s m3 kinematic viscosity m s m2 s mm2 s volume flow rate m s m3 s Vs surface tension N m N m mN m linear expansion coefficient kK 1 K thermal conductivity W m K W m K coefficient of heat transfer W m K W m2K heat capacity J K J K kJ K specific heat capacity J kg K J kg K specific internal energy J kg MJ kg kJ kg charge density C m C m3 surface density of charge C m C m2 electric field strength V m V m MV mkV m mV m uV m permittivity F m F m uF m nF m pF m electric polarization C m C m2 kC m2 mC m2 uC m2 electric dipole moment Cm Cm Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 3
180. teger value The result of this type conversion is the enumerated value literal whose position in the enumeration list is equal to integer valueorunsigned integer value The first element in a list has the position 0 A runtime error occurs if integer value orinteger value INTEGER MAX enumeration type Examples type Color Red Green Blue Color 1 returns Green Color 0 returns Red BITSET to INTEGER UNSIGNED INTEGER Conversion INTEGER bitset value UNSIGNED INTEGER bitset value The result of this type conversion is the 32 bit integer whose internal representation corresponds to the 32 member bitset value Examples INTEGER 0 1 2 returns 7 or 20 21 22 INTEGER UNSIGNED INTEGER to BITSET Conversion BITSET integer value BITSET unsigned integer value The result of this type conversion is the BITSET variable whose internal representation corresponds to the 32 bit integer value integer valueorunsigned integer value Examples BITSET 7 returns the BITSET constant 0 1 2 Unitized Type to Non Unitized Type Conversion REAL unitized value LONG REAL unitized value INTEGER unitized value UNSIGNED INTEGER unitized value The result of type conversion is the raw unitless real or integer value of unitized value A conversion between real and integer values is done if necessary For counting units the co
181. tended digits i e 0 9 or the letters A F which in hexadecimal notation correspond to the decimal values 10 15 respectively Further for a given base B each extended digit must be in the range 0 to B 1 The compiler generates an error if the value of the specified number is not in the range 0 MAX UNSIGNED INTEGER Formal syntax Based Integer Digits Hex Digit Hex Digit Digits see4 1 2 4 1 Hex Digit Digit A B C D E F Examples of based integers all having the value 255 241111 1111 8 377 16 10 255 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 45 von ot 4 96 4 1 2 4 3 Real Numbers A real number may be built as Formal syntax Real Digits Digits E Digits Digits see 4 1 2 4 1 The exponent indicates the power of ten by which the value of the decimal literal is to be multiplied Thus the value of a real number can be obtained as Decimal Literal 10 Exponent The compiler generates an error if the value of the specified number is not a valid floating point number see predefined type LONG REAL 4 8 1 4 Examples
182. the assignment operator These default values are used as actual parameters if the corresponding parameters are omitted from the procedure call in outandout parameters correspond to actual parameters that are variables and they stand for these variables Each formal parameter must be specified by its name and its type In the parameter list the reserved words in and out are used to preceed the parameter in order to specify a parameter mode If no mode is specified then in is implicitly assumed Formal parameters are local to the procedure i e their scope is the program text which constitutes the procedure declaration They can also be used within the actual parameter list to associate a value with a specific parameter see 4 13 2 In this context they do not conflict with identifiers declared outside the subprogram The type of a formal parameter may be an open type e Ifthe parameter is a string the type may be specified as just string string of type identifier where the specification of the maximum length is omitted The parameter is then said to be an open or unbound string parameter and actual parameters of any string types are accepted Their first index and maximum length can be obtained through the standard functions LOW and HIGH e Ifthe parameter is an array the type may be specified as just array of type identifier where the specification of the actual index bounds is omitted e g array 05 INTEGER The
183. type and alias declarations This allows to have parameter types other than the predefined types and named default values in the AP parameter list Units constants types and aliases may also be obtained by importing them from libraries or other parameterized items Note that items declared outside the AP belong to the same name scope as the global declarations within the AP When importing an AP in another module only identifiers declared before the AP header the implicit AP alias and the parameters become visible see 4 2 Formal Syntax Main Procedure Import Unit Declaration Constant Declaration Type Declaration Alias Declaration procedure Identifier Formal Parameters Import Declaration begin Statement Sequence end Identifier Formal Parameters see 4 14 1 Import 466 2 Declaration see 4 3 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C S Ausgabe lssue 5 Datum Date 2009 02 01 EA D 5 e berarbtg Rev Datum Date 2010 01 29 sascr um Seite Page 4 83 von of 4 96 Unit Declaration see4 ll 4 Constant Declaration see 4 7 Type Declaration see4 8 Alias Declaration see4 l0 Statement Sequence see 4 13 Identifier see 4 1 2 2 Example This is the definition of an Automated Procedure named PM PAYLOAD EQUIPMENT_UNIT_A COMMAND MODE_OFF Procedures like I
184. ual parameter list and the address of the parameter block is passed to the subprogram The parameter block conforms to the internal parameter encoding scheme as described in reference document 2 2 2 Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 36 voniof 4 96 4 8 4 Subitem Pathname Types The values comprised by subitem pathname types are references to subitems of database objects themselves not to their value Subitem pathnames are regarded as literals that denote the values of these types Subitem pathname values can be assigned and compared on equality lt gt Subitem pathname types can be unconstrained or constrained e An unconstrained subitem pathname type is denoted by the pattern pathname it comprises all valid subitem pathnames e A constrained subitem pathname type is restricted to a specific set of MDB item types This is denoted by the pattern pathname followed by the list of allowed subitem types in parentheses The subitem types are represented by a special set of identifiers defined in the database the subitem type names These identifiers may appear only in this specific context they do not interfer with normal UCL identifiers The compiler will check that subitem pathnames assigned to
185. wer INTEGER 0 constant Upper INTEGER 255 type Range INTEGER Lower Upper Message Name string the parameter list definition Value Range Lower Daimler Benz Aerospace AG D 28199 Bremen All Rights reserved Copyright per DIN 34 Dok Nr Doc No CGS RIBRE STD 0001 C 5 Ausgabe lssue 5 Datum Date 2009 02 01 EADS nma berarbtg Rev Datum Date 2010 01 29 rium Seite Page 4 92 von ot 4 96 4 16 4 Derived Values A derived value is a database item that returns a value computed from the values of other database items Its UCL source text describes the algorithm for the value computation A derived value definition consists of the following e an optional list of imported libraries system libraries only or other modules e an optional declaration section with constant unit type variable and alias declarations e a statement sequence containing at least a return statement and optionally if and case statements Other statements are not allowed The main part of the derived value definition is a return statement that returns the value computed via an expression It can be used in two forms return expression This statement computes a value returns it as the new value of the item and stops execution The type of the returned value must be compatible to the software type of the item return When the expression is omitted execution is stopped without computing

Download Pdf Manuals

image

Related Search

Related Contents

  MOLINO DE CARNE  Exacompta 51984E ring binder  MARCHE PUBLIC DE TRAVAUX - Site officiel de la mairie de Wissous  全32ページ    

Copyright © All rights reserved.
Failed to retrieve file