FlightJAS

FlightJAS is a sequencing language that is derived and extended from the JAS (Just Another Syntax) language from L3 Harris. It is used to allow scripting and autonomy of MAX. A robust and full-featured sequencing language is an essential element of capable and versatile flight software. When writing custom software logic, you should first consider if the objective is better suited for a FlightJAS script, keeping it more versatile and adaptable. Key capabilities include:

  • Procedural-based structured programming
  • Deep and dynamic call structure for procedures
  • Conditional and looping constructs
  • Send spacecraft commands
  • Query and act upon spacecraft telemetry
  • Setup conditional logic based on telemetry

Contents

Sequence language basics

FlightJAS is case sensitive.
  • Array and String indexing begins at zero.
  • The "-" character may not be used in procedure or variable names as it cannot be distinguished from a minus sign.
  • Some keywords and arguments to keywords are optional. These are designated in the structure and statement definitions sections below with [ ].
    • If an argument to a keyword is optional, it will also appear with brackets. An example of this is: CHECK(expr[, timeout][, timeout])
    • Square brackets also designate array elements and size. Optional versus array designation must be determined from context.

Procedure structure syntax

A procedure contains statements that access telemetry, send commands, perform calculations, and provide flow of control. The procedure structure consists of the following:

  1. Procedure version specification that is part of an initial comment block
  2. Procedure header that identifies the procedure name and arguments
  3. Variable declaration area
  4. Body of the procedure where the procedure statements appear

The following is the procedure structure syntax:

   PROC *identifier* [(*argList*)] [[*SINGLETON or MULTITON*]]
   [*declarations*]  
   BEGIN  
   *statements*  
   ...  
   ENDPROC

where:

  • identifier: Name of the procedure
  • argList: Valid optional variable declaration
  • [SINGLETON or MULTITON*]: : optional tag to indicate if this sequence can only have one running instance (SINGLETON) or multiple running instances (MULTITON. Note the required square brackets around the tag. See Managing parallel instances of sequence files
  • declarations: Optional declarations as defined in Declaration Syntax below
  • statements: Any statements included in the remainder of the document that have applicability to procedures
Array arguments cannot be passed in by the API or by task scheduling.

The following is an example of a procedure:

   PROC ABC (INT arg1, STRING str1_var) [SINGLETON]
	INT I
	INT J
	INT K[2]
	INT L
	REAL R
	REAL T[5]
	REAL U
	STRING STR1
	STRING STR2[2]
	DATE D1
	TIME T1 
   ...  
   BEGIN  
     
   ENDPROC

Return to Top

Declaration syntax

The declaration section is used to declare variables. Variable declarations are optional, but are usually present.

  • Only one variable per line is allowed.
  • FlightJAS does not support initial values during variable declaration.
  • Only letters, numbers, and underscores are allowed.
  • Variable names are limited to 255 characters.

The following is the declaration syntax:

varType var1

where:

  • varType is the type of the variable and can be one of the following:
    • INT
    • REAL
    • STRING
    • DATE
    • TIME
    • ENUM/ENDENUM
      The ENUM/ENDENUM specifies a struct that holds enums and enum values outside of the procedure. If an enum is declared here, it does not need to be declared in the declaration section.
  • varN is a variable declaration and can be one of the following:
    • a variable name
    • a variable name followed by array dimensions (i.e., [d1,...dN])

The following are examples of declarations:

ENUM TestEnum
   ENUM1
   ENUM2 = 5
   ENUM3 = "ENUM3"
   ENUM4
   ENUM5 = 10.123
ENDENUM

PROC TestProc ()
   INT I  
   INT J
   INT K[2]
   INT L  
   REAL T[5]
   REAL U  
   STRING STR1
   STRING STR2[2]  
   DATE D1  
   TIME T1
BEGIN
   SHOW ENUM1
   L = 15
   STR1 = "Hello World"
ENDPROC

Return to Top

Constants

Keyword Type Value
FALSE INT 0
TRUE INT 1
DEG2RAD REAL 3.1415926535897932/180.0
PI REAL 3.1415926535897932
RAD2DEG REAL 180.0/3.1415926525897932

Return to Top

Arithmetic Operators

Operator Example Syntax Purpose Examples
Unary Plus +expr Returns the expression itself (+expr = expr) Var = +5 = 5
Unary Minus -expr Negates the expression (0 - expr) Var = -5
Unary Bit Flip ~expr Flips the bits of expression (~4 = ~0b100 = 0b011 = 3)

This example is with a 3-bit value for simplicity. Operations happen in the platform's native address length (e.g., 32-bit values on a 32-bit processor)
Var = ~4 = 3
+ expr1 + expr2 Adds two expressions Var = 5 + 3 = 8
- expr1 - expr2 Subtracts one expression from another Var = 5 - 3 = 2
* expr1 * expr2 Multiplies two expressions Var = 5 * 3 = 15
/ expr1 / expr2 Divides one expression by another expression

The division of two integers returns an integer. The division of two floats or division using a float/integer combination returns a float.
Var = 5.0 / 2.0 = 2.5
% expr1 % expr2 Calculates the remainder of one expression divided by another Var = 5 % 3 = 2

Return to Top

Assignment Operators

Operator Example Syntax Purpose Examples
= var = expr Sets a variable equal to an evaluated expression Var = 5 + 3
*= var *= expr Shorthand for var = var * expr Var *= 5 = Var * 5
/= var /= expr Shorthand for var = var / expr Var /= 5 = Var / 5
%= var %= expr Shorthand for var = var % expr Var %= 5 = Var % 5
+= var += expr Shorthand for var = var + expr Var += 7 = Var + 7
-= var -= expr Shorthand for var = var - expr Var -= 7 = Var - 7
<<= var <<= expr Shorthand for var = var << expr Var <<= 5 = Var << 5
>>= var >>= expr Shorthand for var = var >> expr Var >>= 5 = Var >> 5
&= var &= expr Shorthand for var = var & expr Var &= 5 = Var & 5
^= var ^= expr Shorthand for var = var ^ expr Var ^= 5 = Var ^ 5
|= var |= expr Shorthand for var = var | expr Var |= 5 = Var | 5

Return to Top

Bitwise Operators

Operator Example Syntax Purpose Examples
& integer & integer Bitwise AND of two integers I=4
I & 0xFF = 4
| integer | integer Bitwise OR of two integers I=2
I | 0xFF = 0xFF
^ integer ^ integer Bitwise XOR of two integers I=4
I ^ 0xFF = 0xFB
>> integer1 >> integer2 Shifts integer1 to the right by the number of places indicated by integer2 I >> 0x01
<< integer1 << integer2 Shifts integer1 to the left by the number of places indicated by integer2 I << 0x01
BIT_REVERSE BIT_REVERSE(expr, numBits) Reverses the bit order of the value in expr by the specified amount in numBits BIT_REVERSE(0xA1BC,16) = 0x3D85
TWOS_COMPLEMENT TWOS_COMPLEMENT(expr, numBits) Takes the two’s complement of the value in expr by the specified amount in numBits TWOS_COMPLEMENT(0xA1BC,16) = 0x3D85

Return to Top

Logical Operators

Operator Example Syntax Purpose Examples
AND
&&
expr1 AND expr2
expr1 && expr2
Returns true if both expressions are true or returns false if either expression is false (5>3) AND (9<12) = true
(5>3) && (9<12) = true
OR
||
expr1 OR expr2
expr1 || expr2
Returns true if either expression is true or returns false if both expressions are false (5>3) OR (9>12) = true
(5>3) || (9>12) = true
NOT
!
NOT(expr)
!(expr)
Returns true or false based on the negation of an expression NOT(5>3) = false
!(5>3) = false
== expr1 == expr2 Returns true if the two expressions are equal and false otherwise (4.3) == (5.1) = false
!= expr1 != expr2 Returns true if the two expressions are not equal and false otherwise (4.3) != (5.1) = true
> expr1 > expr2 Returns true if expr1 is greater than expr2 and false otherwise (5>3) = true
>= expr1 >= expr2 Returns true if expr1 is greater than or equal to expr2 and false otherwise (5>=3) >= true
< expr1 < expr2 Returns true if expr1 is less than expr2 and false otherwise (5<3) = false
<= expr1 <= expr2 Returns true if expr1 is less than or equal to expr2 and false otherwise (5<=3) = false

Return to Top

Mathematical Functions

Function Example Syntax Purpose Examples
FABS FABS(expr) Takes the absolute value of a floating point expression Var = FABS(-3.4) = 3.4
ABS ABS(expr) Takes the absolute value of an integer expression Var = ABS(-3) = 3
CEIL CEIL(expr) Rounds the value of an expression up to the nearest integer Var = CEIL(6.43) = 7
TORAD TORAD(degrees) Performs a unit conversion of degrees to radians Var = TORAD(60.0) = 1.47
EXP EXP(expr) Raises e to the power of the floating point expression Var = EXP(5.3) = 200.337
POW POW(base, exp) Raises the base floating point expression to the power of the exp floating point expression Var = POW(5,3) = 125
FLOOR FLOOR(expr) Rounds the value of the expression down to the nearest integer Var = FLOOR(6.43) = 6
LOG LOG(expr) Calculates the log base 10 of the floating point expression Var = LOG(100) = 2
LN LN(expr) Calculates the natural logarithm of the floating point expression Var = LN(4.3) = 1.459
MAX MAX(expr1, expr2) Returns the maximum of two floating point expressions Var = MAX(5.3, 9) = 9
MIN MIN(expr1, expr2) Returns the minimum of two floating point expressions Var = MIN(5.3, 9) = 5.3
TODEG TODEG(rad) Performs a unit conversion of radians to degrees Var = TODEG(1.21) = 69.328
RANDOM RANDOM() Generates a random floating point number between 0 and 1

Create a random number between X and Y by using Var = RANDOM()\*(Y-X)+X
Var = RANDOM()
ROUND ROUND(expr) Rounds the floating point expression to the nearest integer

The value of X.5 rounds up to X+1
Var = ROUND(5.43) = 5
SQRT SQRT(expr) Calculates the square root of the expression Var = SQRT(4) = 2
TOL TOL(expr, expected, tol) Returns true if the expression is within +/- tolerance of the expected value and false otherwise. This is useful for checking telemetry items to determine if they reached the correct value within the LSB

Numerical precision of the computational machine may cause issues when the expression is exactly plus or minus the tolerance of the expected. For example, VAR = TOL(5.4, 5.2, 0.2) may return false because of precision error.
Var = TOL(5.4, 5.3, 0.2) = true
IF(TOL(TM(30059).cal,12,1))

Return to Top

String Functions

Operator Example Syntax Purpose Examples
CONCAT CONCAT(expr1, ..., exprN) Concatenates N string expressions CONCAT("merge ", "together") = "merge together"
+ expr1 + exprN Concatenates N string expressions using the + sign "merge " + "together" = "merge together"
CONTAINS CONTAINS(source, match) Returns true if the source string expression contains the match text and false otherwise CONTAINS("does this contain apple", "apple") = true
INDEXOF INDEXOF(expr, substring) Returns the location of the first instance of the substring within the string expression

A value of -1 indicates that the substring was not part of the string expression.
INDEXOF("Find Me", "Me") = 5
LOWERCASE LOWERCASE(expr) Converts the string expression to a lowercase string LOWERCASE("TeSt") = "test"
STRLEN STRLEN(expr) Returns the length of the string expression STRLEN("return length") = 13
SUBSTRING SUBSTRING(expr, startIndex[, stopIndex]) Returns the characters from the start index to the stop index from the string expression

If no stop index is specified, the function will return all characters from the start index to the end of the string.
SUBSTRING("return last word", 12, 16)) = "word"
SUBSTR SUBSTR(expr, startIndex, length) Returns the requested number of characters from the start index of the string expression

This is different from the SUBSTRING function which uses a stop index as opposed to a length.
SUBSTR("return last word", 12, 4)) = "word"
TOINT TOINT(expr) Converts the input from a string type to an INT type TOINT("5") = 5
TOREAL TOREAL(expr) Converts the input from a string type to a REAL type TOREAL ("5.123") = 5.123
TOSTRING TOSTRING(expr) Converts the input into a STRING type. This is useful for changing time type variables to strings for display on the AWE TOSTRING(TimeVar) = hh:mm:ss
UPPERCASE UPPERCASE(expr) Converts the string expression to an uppercase string UPPERCASE ("TeSt") = "TEST"

Return to Top

Time Functions

Operator Example Syntax Purpose Examples
NOW NOW() Returns the current mission time as either a date/time string or an epoch when assigned to REAL. Var = NOW() = "yyyy/mm/dd hh:mm:ss"
REAL Var = NOW() = 1624392421
MIDNIGHT MIDNIGHT() Returns the date/time for midnight of the current day Var = MIDNIGHT() = "yyyy/mm/dd 00:00:00"

Return to Top

Trigonometric Mathematics

Function Example Syntax Purpose Examples
ACOS ACOS(expr) Returns the arccosine of the expression with units of radians Var = ACOS(0.7071) = 0.7854
ASIN ASIN(expr) Returns the arcsine of the expression with units of radians Var = ASIN(0.7071) = 0.7854
ATAN ATAN(expr) Returns the arctangent of the expression with units of radians Var = ATAN(0.7071) = 0.6155
ATAN2 ATAN2(Y,X) Returns the arctangent of Y/X with units of radians Var = ATAN2(50,100) = 0.4636
COS COS(exprInRadians) Returns the cosine of the expression where the expression has units of radians Var = COS(2\*PI) = 1
SIN SIN(exprInRadians) Returns the sine of the expression where the expression has units of radians Var = SIN(2\*PI) = 0
TAN TAN(exprInRadians) Returns the tangent of the expression where the expression has units of radians Var = TAN(2\*PI) = 0

Return to Top

Engine Functions

Item Example Syntax Purpose Examples
CMD_ACT_CNT `CMD_ACT_CNT()` Returns the command accept counter for the engine. Applicable to distribution of commands from current procedure. Var = CMD_ACT_CNT()
CMD_RJT_CNT `CMD_ACT_CNT()` Returns the command reject counter for the engine. Applicable to distribution of commands from current procedure. Var = CMD_RJT_CNT()
CMD_UNK_CNT `CMD_UNK_CNT()` Returns the command unknown counter for the engine. This can occur when the engine is exits prior to receiving all the status details about commands and a new procedure executes when after they received. Var = CMD_UNK_CNT()
ENG_ID ENG_ID() Engine ID number. Var = ENG_ID()

Telemetry And Configuration Parameter Retrieval

Item Example Syntax Purpose Examples
Telemetry Value TM(id) Returns the current value of the specified telemetry parameter Var = TM("ACS123")
Raw Telemetry value TM(id).raw Returns the raw value of the specified telemetry parameter
Same as TM(id).uncal. Exists for compatibility with JAS.
Var = TM("ACS123").raw
Telemetry Timetag TM(id).timetag Returns the timetag of the parameter in integer microseconds since 1970 Var = TM("ACS12345").timetag
Telemetry Calibrated TM(id).cal Returns the calibrated value for the telemetry point
Same as TM(id). Exists for compatibility with JAS.
Var = TM("ACS123").cal
Telemetry Uncalibrated TM(id).uncal Returns the uncalibrated value for the telemetry point
For most types this is the same as TM(id).cal and exists for capability with JAS. The exception is for enumerations the number will be returned instead of the string value.
Var = TM("ACS123").uncal
Configuration Parameter Value CM(instance, attribute, type)
type is “INT” or “REAL”
Returns the value of a configuration parameter Var = CM("instance","attribute","REAL")
Configuration Parameter Array Value CM(instance, attribute, index, type)
index is the array
type is “INT” or “REAL” array
Returns the value of an array element for a configuration parameter Var = CM("instance","attribute",10, "REAL")

Return to Top

FlightJAS Statement Syntax

Some keywords and arguments to keywords are optional. These are designated with brackets [ ].
Statement Syntax Description
ABORT ABORT(expr)

Example:
  • ABORT(TRUE)
Terminates the procedure or call stack in which this statement occurs

Parameters:
  • expr : Boolean constant where TRUE terminates call stack and FALSE terminates this procedure and returns to calling procedure. The parameter list is optional and will default with the *expr* being TRUE.
ABORT_ALL ABORT_ALL(expr)

Example:
  • ABORT_ALL(FALSE)
Terminates all procedures. Can optionally terminate all except self

Parameters:
  • expr : Boolean constant where TRUE terminates all except self and FALSE terminates all including self. The parameter list is optional and will default with the *expr* being FALSE.
CALL CALL identifier [(arg1, ..., argN)]
**OR**
`CALL StrExpr [(arg1, ..., argN)]`


Example:
  • CALL ABC
  • CALL XXX (Var1,5,"String",ARRAY[6])
  • CALL XYZ (Var1 +5)
  • CALL subfolder/ABC.fj" (Var1 +5)
Executes a sub-procedure and returns to the calling procedure after completing execution. To execute a procedure in a subdirectory, specify the relative path from the configured sequence directory as a string.

Parameters:
  • identifier : Name of procedure
  • StrExpr* : Name of procedure, in quotes, which may include relative path information
  • *argX* : any expression constant, passed by reference variable, function call result, use of operators, etc.
CASE See the SELECT and SWITCH statements in this table
CHECK
CHECK(booleanExpr,
[badTimeout],
[goodTimeout])

Example:
  • CHECK(TM(12345) > 100, 10)
  • RetVal = CHECK(Var==56.7, TimeOutVar)
Evaluates Boolean expression with optional badTimeout and goodTimeout conditions. Evaluation of the expression will stop and return 1 (true) if the expression is satisfied or 0 (false) if the timeout is reached. The CHECK statement will hold sequence execution until the expression returns true if no timeout or a -1 timeout is provided.

Parameters:
  • booleanExpr : Any Boolean expression.
  • badTimeout : Integer or double Expression that represents the amount of time, in seconds, that the statement will wait for a true result.
  • goodTimeout : Integer or double Expression that represents the amount of time, in seconds, that the expression must be true for. A specification with goodTimeout only is not allowed.

CHECK can not be used in a conditional statement's expression, e.g., IF(CHECK(...)) would be an illegal statement. Instead store the return value into an INT variable and check the result of the variables as in the syntax example.
CMD CMD cmdId[(arg1, ...argN)]

Example:
  • CMD "EPHEM_PROP_ON"
  • CMD "Thruster"("Enable", 3. 4)
  • RetVal = CMD "Thruster"(UC[1], SecToFireVar)
Initiates command execution with specified arguments and optional context data. Note that the return value is strictly an indication that the command was successfully distributed and does not reflect the return status of the command. See the CMD_AND_STATUS command for that functionality.

Parameters:
  • cmdId : String constant or variable that uniquely identifies the command. An array of strings is prohibited
  • argX : Constant string, integer, floating point value, an integer reference to the raw/uncalibrated state value x, using the notation UC(x), or a variable to be dereferenced prior to building the command.

CMD can not be used in a conditional statement's expression, e.g., IF(CMD ...) would be an illegal statement. Instead, store the return value into an INT variable and check the result of the variable as in the syntax example.

CM_AND_STATUS CMD_AND_STATUS cmdId[timeout][arg1, argN]

Example:
  • EPHEM_PROP_ON
  • CMD_AND_STATUS "Thruster"("Enable", 3. 4)`
    RetVal = CMD_AND_STATUS "Thruster"(UC[1], SecToFireVar)
    CMD_AND_STATUS "EPHEM_PROP_ON" [1.5]
    CMD_AND_STATUS "Thruster" [2.3] ("Enable", 3. 4)
    RetVal = CMD_AND_STATUS [5] "Thruster"(UC[1], SecToFireVar)
Initiates command execution with specified arguments and optional context data. This statement waits for status from the component processing the command.

Parameters
  • *cmdId* : String constant or variable that uniquely identifies the command. An array of strings is prohibited
  • *timeout* : Optional timeout in seconds to wait for the status.
  • *argX* : Constant string, integer, floating point value, or a variable to be dereferenced prior to building the command.
  • CMD_AND_STATUS can not be used in a conditional statement's expression, e.g., IF(CMD_AND_STATUS ...) would be an illegal statement. Instead, store the return value into an INT variable and check the result of the variable as in the syntax example.

Comment // text
/* text
text
text */


Example:
  • X=Y //Single line comment
  • //Single line comment alone
    /*This is an example of a comment that
    continues on to another line */
Denotes comment text. Single line comments (alone or after statement syntax) and multiple line comments are allowed
Continuation
long_expression_part_1  \
long_expression_part_2 \
long_expression_part_3

Example:
  • FloatVar = FABS(-4.5) + \
    ROUND(9.87654) + MAX(8.9,3.4) + \
    MIN(3.3,-8.5) + SIN(.025)
Allows for continuation of a long expression across multiple lines in procedures. For derived parameters, no continuation character is needed when the line break occurs at a white space

Syntax errors will occur if the continuation character \ is followed by anything else such as a space.
FOR
FOR (iexpr, fexpr, incExpr) 
statements
ENDFOR

Example:
  • FOR (j=0, j<10, j=j+1) 
    CMD "MISC_EVR" ("Hello World")
    ENDFOR
Executes a FOR loop until the final condition is reached

Parameters:
  • iexpr : Integer initial expression (e.g., J=0)
  • fexpr : Integer final expression (e.g., J<10). The loop will be evaluated while this is true
  • incExpr : Integer increment expression (e.g., J=J+1)
  • statements : Statements repeatedly executed until the final condition is reached
GROUP_CHECK
GROUP_CHECK("logOperator",
[badTimeout],
[goodTimeout])
booleanExpr,
:
finalBooleanExpr
ENDCHECK

Example:
  • GROUP_CHECK ("OR", 100, 2) 
    // Monitor REAs Lower Temp > 7 degC
    TM(I223) >= 7 AND TM(I223) <= 99,
    TM(I222) >= 7 AND TM(I222) <= 99,
    TM(I221) >= 7 AND TM(I221) <= 99,
    TM(I220) >= 7 AND TM(I220) <= 99,
    TM(I212) >= 7 AND TM(I212) <= 99,
    TM(I211) >= 7 AND TM(I211) <= 99,
    TM(I210) >= 7 AND TM(I210) <= 99,
    TM(I209) >= 7 AND TM(I209) <= 99,
    TM(I208) >= 7 AND TM(I208) <= 99,
    TM(I207) >= 7 AND TM(I207) <= 99,
    TM(I206) >= 7 AND TM(I206) <= 99,
    TM(I205) >= 7 AND TM(I205) <= 99,
    TM(I204) >= 7 AND TM(I204) <= 99,
    TM(I203) >= 7 AND TM(I203) <= 99,
    TM(I202) >= 7 AND TM(I202) <= 99,
    TM(I201) >= 7 AND TM(I201) <= 99
    ENDCHECK
Evaluates all Boolean expressions with either an AND or OR logic with optional badTimeout and goodTimeout conditions. Evaluation of the expressions will stop and return 1 (true) if the expressions are satisfied or 0 (false) if the timeout is reached. The GROUP_CHECK statement will hold sequence execution until the expressions return true if no timeout or a -1 timeout is provided.

Parameters:
  • logOperator : Logical operators OR or AND as strings
  • booleanExpr : Any Boolean expression
  • finalBooleanExpr : Final boolean expression not followed by a comma
  • badTimeout : Integer or double expression that represents the amount of time, in seconds, that the statement will wait for a true result.
  • goodTimeout : Integer or double expression that represents the amount of time, in seconds, that the expression must be true for. A specification with goodTimeout only is not allowed.

This is a change from L3's JAS syntax. The commas at the end of each line have been added to enable white space agnostic parsing.
GROUP_CHECK can not be used in a conditional statement's expression, e.g., IF(GROUP_CHECK(...) ... ) would be an illegal statement. Instead, store the return value into an INT variable and check the result of the variable as in the syntax example.
IF
ELSEIF
ELSE
ENDIF
IF (expr)
statements
ELSEIF(expr)
statements
ELSE
statements
ENDIF

Example:
  • IF((TM(5098)>=2.4) or (TM(5098)<=-2.4))
    TooBig = 1
    ENDIF
Allows an IF/ELSEIF/ELSE/ENDIF construct with optional ELSEIF and ELSE clauses

Parameters:
  • expr : Any expression to be evaluated
  • statements : Any statements included in the remainder of the document that have applicability to procedures
MACRO MACRO identifier [(arg1, ...)]

Example:
  • MACRO ABC
  • MACRO XXX (Var1,5,"String",ARRAY[6])
  • MACRO XYZ (Var1 +5)
Executes a sub-procedure similar to the CALL statement except all the statements within the sub-procedure are executed immediately with no delay

Parameters:
  • identifier : Name of procedure which may include existing path information
  • argX : any expression constant, passed by reference variable, function call result, use of operators, etc.

Care must be taken that none of the statements require timed checks or timeouts.
REPEAT
REPEAT(expr)
statements
ENDREPEAT

Example:
  • REPEAT (TM(10000)=="OFF")
    CMD "MISC_EVR" ("Awaiting power on")
    WAIT(30)
    ENDREPEAT
Executes statements once and continues to execute them as long as the expression evaluates to true

Parameters:
  • expr : Any expression to be evaluated
  • statements : Statements repeatedly executed while the expression evaluates to true
REPORT_OPEN REPORT_OPEN(expr)

Example:
  • REPORT_OPEN("root/data/MySeqReport")
Opens a report with the path defined by the expression that summarizes all actions completed in the sequence

Parameters
  • expr : Full path including file name to the new report

The report open command automatically adds a .rpt extension to the end of the provided file name.
REPORT_CLOSE REPORT_CLOSE

Example:
  • REPORT_OPEN("root/data/MySeqReport")
    statements
    REPORT_CLOSE
Closes a report opened with the REPORT_OPEN statement. A report automatically closes at sequence completion, but REPORT_CLOSE may be used to close the report earlier if desired
RETURN RETURN

Example:
  • IF(error)
    RETURN
    ENDIF
Acts similarly to ABORT(0) to return to the calling procedure
SELECT
SELECT (timeout)
CASE (expr)
statements
ENDCASE
:
CASE (expr)
statements
ENDCASE
ENDSELECT

Example:
  • SELECT (60)
    CASE (0)
    CMD "MISC_EVR" ("False, proceed")
    ENDCASE
    CASE (1)
    CMD "MISC_EVR" ("True, SAFE_MODE")
    CALL SAFE_MODE(1)
    ENDCASE
    ENDSELECT
Executes the first CASE statement whose expression evaluates to true while the SELECT timeout value has not expired. If no expression is true, the process is repeated until a CASE expression evaluates to true or the timeout value expires

Parameters:
  • timeout : Integer expression that evaluates to the maximum number of seconds to wait
  • expr : Any Boolean expression result
  • statements: Any statements or expression evaluations with applicability to procedures or derived parameters

Parenthesis are a requirement in FlightJAS, even though they're not a requirement in JAS.
SHOW SHOW (expr)

Example:
  • SHOW ("Hello World")
Shows the value of the evaluated expression next to the statement

Parameters:
  • expr : Any expression
START START identifier (arg1, ..., argN)
**OR**
`START StrExpr [(arg1, ..., argN)]`


Example:
  • START ABC
  • START XXX (Var1,5,"String",ARRAY[6])
  • START XYZ ( Var1+5 )
  • `START "subfolder/ABC.fj" (Var1 +5)`
Executes a subprocedure in parallel with the calling procedure (spawn)

Parameters:
  • identifier : Name of the procedure
  • *StrExpr* : Name of procedure, in quotes, which may include existing path information
  • argN : Any expression constant, variable, function call result, use of operators, etc

Unless the path is explicitly specified, the executer will search for the subprocedure in the following order: calling procedure's directory, main directory, and each subdirectory in alphabetical order. No spaces are allowed in the path.
START_ABS START_ABS expr identifier (arg1, ..., argN)
**OR**
`START_ABS expr StrExpr [(arg1, ..., argN)]`


Example:
  • START_ABS 1639772581 ABC
  • START_ABS 1639772581 XXX (Var1,5,"String",ARRAY[6])
  • START_ABS 1639772581 XYZ (Var1+5)
  • `START_ABS 1639772581 "subfolder/ABC.fj" (Var1 +5)`
Executes a subprocedure in parallel with the calling procedure (spawn) at the SCLK time defined by the input expression. To execute a procedure in a subdirectory, specify the relative path from the configured sequence directory as a string.

Parameters:
  • expr : SCLK time
  • identifier : Name of the procedure
  • *StrExpr* : Name of procedure, in quotes, which may include relative path information
  • argN : Any expression constant, variable, function call result, use of operators, etc

Unless the path is explicitly specified, the executer will search for the subprocedure in the following order: calling procedure's directory, main directory, and each subdirectory in alphabetical order. No spaces are allowed in the path.
SWITCH
SWITCH (expr)
CASE (value)
statements
ENDCASE
CASE (value)
statements
ENDCASE
CASE_DEFAULT
statements
ENDCASE
ENDSWITCH

Example:
  • Ivar = TM(1000)
    SWITCH (Ivar)
    CASE(0)
    SHOW ("False, proceed")
    ENDCASE
    CASE(1)
    SHOW ("True, SAFE_MODE")
    CALL_SAFE_MODE(1)
    ENDCASE
    CASE_DEFAULT
    SHOW ("Unexpected result = %d", Ivar)
    START PROC_USER(1)
    ENDCASE
    ENDSWITCH
Executes a certain CASE statement dependent on the comparison of the expression against all CASE values. If no CASE values match the expression, the CASE_DEFAULT statement is executed

Parameters:
  • expr : Any expression with an integer result
  • value : Any integer expression result
  • statements : Any statements or expression evaluations with applicability to procedures or derived parameters

Parenthesis are a requirement in FlightJAS, even though they're not a requirement in JAS.
WAIT WAIT (secs)

Example:
  • WAIT (24.2)
Waits a specified amount of time

Parameters:
  • secs : An expression that represents a real number of seconds to wait
WAIT_UNTIL WAIT_UNTIL(time)

Example:
  • //Between PROC and BEGIN: 
    TIME SEQ_START_TIME

    //Somewhere in the sequence to start
    //30 seconds after the start time:
    WAIT_UNTIL(SEQ_START_TIME + 30)
Waits until a specified time independent of the execution rate so that the next command executes at the specified time

Parameters:
  • time : Absolute time you want the next command to execute at

The WAIT_UNTIL() command does not exist in L3's InControl JAS language.
WHILE
WHILE (expr)
statements
ENDWHILE

Example:
  • WHILE (TM(10000)=="OFF")
    CMD "MISC_EVR" ("Awaiting power on")
    WAIT (30)
    ENDWHILE
Executes a WHILE loop as long as the expression evaluates to true

Parameters:
  • expr : Any expression to be evaluated
  • statements : Statements repeatedly executed while the expression evaluates to true

Return to Top

Special Characters

To see special characters in a string, they must be preceded with a backslash. The following table demonstrates the usage of these special characters:

Syntax Purpose Example Code Resulting Output
\' Backslash single quote displays a single quotation STRING "MyString needs a single \'quote\'" MyString needs a single 'quote'
\" Backslash double quote displays a double quotation STRING "MyString needs a double \"quote\"" MyString needs a double "quote"
\? Backslash question mark displays a question mark STRING "MyString needs a question mark\?" MyString needs a question mark?
\\' Backslash backslash displays a backslash STRING "MyString needs a \\ backslash" MyString needs a \ backslash

The following characters are commands when preceded with a backslash:

  • \a Sound Bit
  • \b Backspace
  • \f Form Feed
  • \n New Line
  • \r Carriage Return
  • \t Horizontal Tabulator
  • \v Vertical Tabulator

Return to Top

Managing parallel instances of sequence files

SINGLETON vs MULTITON

Sequences support being tagged as a SINGLETON or a MULTITON

Regardless of configuration, the MAX sequence engine will automatically block multiple simultaneous execution of any sequence tagged as a SINGLETON. Sequences tagged with SINGLETON will be blocked from being CALL(ed) or START(ed) in parallel.

Regardless of configuration, the MAX sequence engine will always allow sequences tagged as MULTITON to execute in parallel. Sequences tagged with MULTITON will never be blocked from being CALL(ed) or START(ed) in parallel.

Configuring Default Sequence Engine Behavior

The MAX sequence engine can be configured to control the default behavior of sequences not tagged with SINGLETON or MULTITON.

The configuration option can be set in the MAX cfg file that sets up the MAX sequence engine.


			block_duplicate_procs - Enum that controls default behavior of sequences not tagged as SINGLETON or MULTITON
			0 = E_DONT_BLOCK_DUPLICATE      - Don't block duplicate execution of sequences (unless tagged with SINGLETON)
			1 = E_BLOCK_ALL_NON_MULTITON    - Block duplicate execution of ALL sequences (unless tagged as MULTITON)
			2 = E_BLOCK_NON_MULTITON_START  - Block duplicate starting of ALL sequences (unless tagged as MULTITON).  Duplicate CALL(ing) from parent sequence is allowed (unless tagged as SINGLETON).
	

Sample FlightJAS Procedures

Startup

   PROC Startup  
   BEGIN  
   CMD "EPHEM_PROP_ON"  
   CMD "GOTO_RATEDAMP"  
   WAIT (59.9)  
   CMD "GOTO_INERTIAL_HOLD"  
   ENDPROC

Eclipse Flag Telemetry Monitor

   PROC TelemetryMonitor  
   INT evr_count  
   INT evr_i  
   STRING evr[10]  
   STRING color  
   STRING odyssy_eclipse_flag_value  
   INT odyssy_eclipse_flagbeq_persist  
   INT odyssy_eclipse_flagbeq_persist_out  

   BEGIN  

   CMD "MISC_EVR" ("TLM_MON_C: 1")  

   WHILE(1) //infinite loop  

   evr_count = 0  
   color = "TLM_MON_G"  
   odyssy_eclipse_flag_value = TM("AOD_ECLIPSE")  

   IF (odyssy_eclipse_flag_value == "TRUE")  
      IF (odyssy_eclipse_flagbeq_persist == 0)  
         evr[evr_count] = ": ODySSy Eclipse Flag: has crossed the Blue limit of
   TRUE."  
         evr_count += 1  
         CMD "FJ_START_REL" (0,"EVR_Blast.fj","")  
      ENDIF  
      IF (odyssy_eclipse_flagbeq_persist \>= 0)  
         color = "TLM_MON_B"  
      ENDIF  
      odyssy_eclipse_flagbeq_persist += 1  
      odyssy_eclipse_flagbeq_persist_out = 0  
   ELSE  
      IF (odyssy_eclipse_flagbeq_persist_out == 0)  
         evr[evr_count] = ": ODySSy Eclipse Flag has returned from the Blue
   limit of TRUE."  
         evr_count += 1  
         CMD "FJ_START_REL" (0,"EVR_Blast.fj","")  
      ENDIF  
      odyssy_eclipse_flagbeq_persist = 0  
      odyssy_eclipse_flagbeq_persist_out += 1  
   ENDIF  

   FOR(evr_i = 0, evr_i \< evr_count, evr_i += 1)  
      CMD "MISC_EVR" (color + evr[evr_i])  
   ENDFOR  

   ENDWHILE  
   ENDPROC

Sample Target Planner Sequence

//WARNING: This code is automatically generated and any modifications will be overwritten by STK SOLIS.

PROC TargetPlan

DATE SEQ_START_TIME

BEGIN

SEQ_START_TIME = NOW()

//Here Begins the user created sequence

/* --- TARGET PLANNER TIMELINE SUMMARY ---
The following sequence was generated by STK SOLIS at 07/27/2016 19:27:39
Sequence file is valid for execution at : 02/06/2016 17:05:00
The spacecraft must be in NadirTrack mode with SC-\>Sun clocking at the start of this sequence.

All times in comments are from start of sequence.
User is responsible for ensuring sequence is executed at 02/06/2016 17:05:00

193.3 Tgt1 Priority: 100 TargetTrack SlewTime: 49.3 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
237.6 Embed Sequence : ImagerON
252.6 Embed Sequence : ImagerOFF
252.6 Target2 Priority: 100 TargetTrack SlewTime: 8.9 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
256.5 Embed Sequence : ImagerON
271.5 Embed Sequence : ImagerOFF
271.5 Target3 Priority: 100 TargetTrack SlewTime: 6.0 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
272.5 Embed Sequence : ImagerON
287.5 Embed Sequence : ImagerOFF
287.5 Target4 Priority: 100 TargetTrack SlewTime: 6.0 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
288.5 Embed Sequence : ImagerON
303.5 Embed Sequence : ImagerOFF
303.5 Target5 Priority: 100 TargetTrack SlewTime: 54.9 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
353.4 Embed Sequence : ImagerON
368.4 Embed Sequence : ImagerOFF
368.4 Target6 Priority: 100 TargetTrack SlewTime: 36.4 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
399.8 Embed Sequence : ImagerON
414.8 Embed Sequence : ImagerOFF
414.8 Target7 Priority: 100 TargetTrack SlewTime: 34.2 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
444.0 Embed Sequence : ImagerON
459.0 Embed Sequence : ImagerOFF
459.0 Target8 Priority: 100 TargetTrack SlewTime: 26.0 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
480.0 Embed Sequence : ImagerON
495.0 Embed Sequence : ImagerOFF
495.0 Target9 Priority: 100 TargetTrack SlewTime: 33.2 DwellTime: 10.0 Access Count: 1 on Opportunity: 1
*/

WAIT_UNTIL (SEQ_START_TIME + 193.2)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",56.224063 ,-89.550899 ,0 )

// 193.3 Tgt1 Priority: 100 SlewTime: 49.3 DwellTime: 10.0 Access 1 on
Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 193.3)
CMD "MDC_SLEW_TRACK" (49.3 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 237.6)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 252.6)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 252.7)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",54.926276 ,-89.107752 ,0 )

// 252.6 Target2 Priority: 100 SlewTime: 8.9 DwellTime: 10.0 Access 1 on Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 252.8)
CMD "MDC_SLEW_TRACK" (8.9 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 256.6)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 271.6)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 271.7)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",54.134942 ,-89.487592 ,0 )

// 271.5 Target3 Priority: 100 SlewTime: 6.0 DwellTime: 10.0 Access 1 on Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 271.8)
CMD "MDC_SLEW_TRACK" (6 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 272.7)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 287.7)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 287.8)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",53.375262 ,-89.835779 ,0 )

// 287.5 Target4 Priority: 100 SlewTime: 6.0 DwellTime: 10.0 Access 1 on Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 287.9)
CMD "MDC_SLEW_TRACK" (6 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 288.8)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 303.8)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 303.9)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",49.272244 ,-92.625143 ,0 )

// 303.5 Target5 Priority: 100 SlewTime: 54.9 DwellTime: 10.0 Access 1 on Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 304)
CMD "MDC_SLEW_TRACK" (54.9 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 353.8)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 368.8)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 368.9)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",46.730378 ,-94.622323 ,0 )

// 368.4 Target6 Priority: 100 SlewTime: 36.4 DwellTime: 10.0 Access 1 on Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 369)
CMD "MDC_SLEW_TRACK" (36.4 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 400.3)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 415.3)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 415.4)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",43.41893 ,-90.623766 ,0 )

// 414.8 Target7 Priority: 100 SlewTime: 34.2 DwellTime: 10.0 Access 1 on Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 415.5)
CMD "MDC_SLEW_TRACK" (34.2 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 444.6)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 459.6)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 459.7)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",41.794526 ,-95.329696 ,0 )

// 459.0 Target8 Priority: 100 SlewTime: 26.0 DwellTime: 10.0 Access 1 on Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 459.8)
CMD "MDC_SLEW_TRACK" (26 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 480.7)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 495.7)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 495.8)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",38.78638 ,-95.109251 ,0 )

// 495.0 Target9 Priority: 100 SlewTime: 33.2 DwellTime: 10.0 Access 1 on Opportunity: 1
WAIT_UNTIL (SEQ_START_TIME + 495.9)
CMD "MDC_SLEW_TRACK" (33.2 ,"RendezSlew","TargetTrack","SC2Sun")
WAIT_UNTIL (SEQ_START_TIME + 524)
CMD "FJ_START_REL" (0, "ImagerON","")
WAIT_UNTIL (SEQ_START_TIME + 539)
CMD "FJ_START_REL" (0, "ImagerOFF","")
WAIT_UNTIL (SEQ_START_TIME + 539.1)
CMD "EPH_SET_TGT" ("GeneralTarget","LLA_deg_m",36.580403 ,-95.697511 ,0 )

ENDPROC

Return to Top