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
- Procedure Structure Syntax
- Declaration Syntax
- Constants
- Arithmetic Operators
- Assignment Operators
- Bitwise Operators
- Logical Operators
- Mathematical Functions
- String Functions
- Time Functions
- Trigonometric Mathematics
- Telemetry and Configuration Parameter Retrieval
- FlightJAS Statement Syntax
- Special Characters
- Managing parallel instances of sequence files
- Sample FlightJAS Procedures
Sequence language basics
- 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.
- If an argument to a keyword is optional, it will also appear with brackets. An example of this is:
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:
- Procedure version specification that is part of an initial comment block
- Procedure header that identifies the procedure name and arguments
- Variable declaration area
- 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
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
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/ENDENUMThe 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
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 |
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
|
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
|
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
|
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
|
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))
|
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"
|
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"
|
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
|
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")
|
FlightJAS Statement Syntax
Statement | Syntax | Description |
---|---|---|
ABORT | ABORT(expr)
Example:
|
Terminates the procedure or call stack in which this statement occurs Parameters:
|
ABORT_ALL | ABORT_ALL(expr)
Example:
|
Terminates all procedures. Can optionally terminate all except self Parameters:
|
CALL | CALL identifier [(arg1, ..., argN)]
Example:
|
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:
|
CASE | See the SELECT and SWITCH statements in this table | |
CHECK |
Example:
|
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:
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:
|
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:
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:
|
Initiates command execution with specified arguments and optional context data. This statement waits for status from the component processing the command. Parameters
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
Example:
|
Denotes comment text. Single line comments (alone or after statement syntax) and multiple line comments are allowed |
Continuation |
Example:
|
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 |
Example:
|
Executes a FOR loop until the final condition is reached Parameters:
|
GROUP_CHECK |
Example:
|
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:
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 |
Example:
|
Allows an IF/ELSEIF/ELSE/ENDIF construct with optional ELSEIF and ELSE clauses Parameters:
|
MACRO | MACRO identifier [(arg1, ...)]
Example:
|
Executes a sub-procedure similar to the CALL statement except all the statements within the sub-procedure are executed immediately with no delay Parameters:
Care must be taken that none of the statements require timed checks or timeouts. |
REPEAT |
Example:
|
Executes statements once and continues to execute them as long as the expression evaluates to true Parameters:
|
REPORT_OPEN | REPORT_OPEN(expr)
Example:
|
Opens a report with the path defined by the expression that summarizes all actions completed in the sequence Parameters
The report open command automatically adds a .rpt extension to the end of the provided file name. |
REPORT_CLOSE | REPORT_CLOSE
Example:
|
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:
|
Acts similarly to ABORT(0) to return to the calling procedure |
SELECT |
Example:
|
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:
Parenthesis are a requirement in FlightJAS, even though they're not a requirement in JAS. |
SHOW | SHOW (expr)
Example:
|
Shows the value of the evaluated expression next to the statement Parameters:
|
START | START identifier (arg1, ..., argN)
Example:
|
Executes a subprocedure in parallel with the calling procedure (spawn) Parameters:
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)
Example:
|
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:
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 |
Example:
|
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:
Parenthesis are a requirement in FlightJAS, even though they're not a requirement in JAS. |
WAIT | WAIT (secs)
Example:
|
Waits a specified amount of time Parameters:
|
WAIT_UNTIL | WAIT_UNTIL(time)
Example:
|
Waits until a specified time independent of the execution rate so that the next command executes at the specified time Parameters:
The WAIT_UNTIL() command does not exist in L3's InControl JAS language. |
WHILE |
Example:
|
Executes a WHILE loop as long as the expression evaluates to true Parameters:
|
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
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