Logic Commands
Overview
The LTMT main unit project files consist of a series of logic commands. Each logic command consists of the command itself, plus up to 3 arguments.
Each logic command performs its operation linked to either a 1-bit Boolean accumulator (value 0 or 1) or a 16-bit unsigned accumulator (value range 0–65,535).
The custom logic editor provides the following kinds of logic commands:
-
Boolean
-
Register
-
Timers
-
Latch
-
Counters
-
Math
Rising Edge Detection Mechanism
Some logic commands work on a rising edge of the 1-bit accumulator.
The rising edge of a bit is detected when its current state is 1 and its previous state was 0. The previous state of the bit is stored in a dedicated history bit.
Boolean Logic Commands
Boolean commands evaluate and control simple Boolean (On or Off) values. Boolean commands include:
Command |
Argument 1 |
Argument 2 |
Argument 3 |
Description |
---|---|---|---|---|
|
Constant value (0 or 1) |
– |
– |
Loads a constant value into the 1-bit accumulator. |
|
Register address |
Register bit no. (0–15) |
– |
Loads a register bit from the address identified in Argument 1, and the bit identified in Argument 2 into the 1-bit accumulator. |
|
Temporary register address |
Register bit no. (0–15) |
– |
Loads a temporary register bit into the 1-bit accumulator. |
|
Non-volatile register address |
Register bit no. (0–15) |
– |
Loads a non-volatile register bit into the 1-bit accumulator. |
|
Register address |
Register bit no. (0–15) |
– |
Loads an inverted Boolean value of a register bit into the 1-bit accumulator. |
|
Temporary register address |
Register bit no. (0–15) |
– |
Loads an inverted Boolean value of a temporary register bit into the 1-bit accumulator. |
|
Non-volatile register address |
Register bit no. (0–15) |
– |
Loads an inverted Boolean value of a non-volatile register bit into the 1-bit accumulator. |
|
Register address |
Register bit no. (0–15) |
– |
Loads the result of a logical |
|
Temporary register address |
Register bit no. (0–15) |
– |
Loads the result of a logical |
|
Non-volatile register address |
Register bit no. (0–15) |
– |
Loads the result of a logical |
|
Register address |
Register bit no. (0–15) |
– |
Loads the result of a logical |
|
Temporary register address |
Register bit no. (0–15) |
– |
Loads the result of a logical |
|
Non-volatile register address |
Register bit no. (0–15) |
– |
Loads the result of a logical |
|
Register address |
Register bit no. (0–15) |
– |
Makes a logical |
|
Temporary register address |
Register bit no. (0–15) |
– |
Makes a logical |
|
Non-volatile register address |
Register bit no. (0–15) |
– |
Makes a logical |
|
Register address |
Register bit no. (0–15) |
– |
Makes an logical |
|
Temporary register address |
Register bit no. (0–15) |
– |
Makes an logical |
|
Non-volatile register address |
Register bit no. (0–15) |
– |
Makes an logical |
|
Register address |
Register bit no. (0–15) |
– |
Sets value of the 1-bit accumulator into a register bit. |
|
Temporary register address |
Register bit no. (0–15) |
– |
Sets value of the 1-bit accumulator into a temporary register bit. |
|
Non-volatile register address |
Register bit no. (0–15) |
– |
Sets value of the 1-bit accumulator into a non-volatile register bit. |
|
Register address |
Register bit no. (0–15) |
– |
Sets inverted value of the 1-bit accumulator into a register bit. |
|
Temporary register address |
Register bit no. (0–15) |
– |
Sets inverted value of the 1-bit accumulator into a temporary register bit. |
|
Non-volatile register address |
Register bit no. (0–15) |
– |
Sets inverted value of the 1-bit accumulator into a non-volatile register bit. |
– Argument not applicable to logic command. |
Register Logic Commands
Register commands evaluate and control 16-bit values. Register commands include:
Command |
Argument 1 |
Argument 2 |
Argument 3 |
Description |
---|---|---|---|---|
|
Constant value (0–65,535) |
– |
– |
Loads a constant value into the 16-bit accumulator. |
|
Register address |
– |
– |
Loads a copy of a register into the 16-bit accumulator. |
|
Temporary register address |
– |
– |
Loads a copy of a temporary register into the 16-bit accumulator. |
|
Non-volatile register address |
– |
– |
Loads a copy of a non-volatile register into the 16-bit accumulator. |
|
Constant value (0–65,535) |
Temporary register address |
– |
Compares the content of the Argument 1 to the 16-bit accumulator content and sets status Argument 2 bits as follows:
|
|
Register address |
Temporary register address |
– |
Compares the content of the register defined by Argument 1 to the 16-bit accumulator content and sets status Argument 2 bits as follows:
|
|
Temporary register address |
Temporary register address |
– |
Compares the content of the register defined by Argument 1 to the 16-bit accumulator content and sets status Argument 2 bits as follows:
|
|
Non-volatile register address |
Temporary register address |
– |
Compares the content of the register defined by Argument 1 to the 16-bit accumulator content and sets status Argument 2 bits as follows:
|
|
Constant value (0 or 1) |
– |
– |
Makes a logical |
|
Register address |
– |
– |
Makes a logical |
|
Temporary register address |
– |
– |
Makes a logical |
|
Non-volatile register address |
– |
– |
Makes a logical |
|
Constant value (0 or 1) |
– |
– |
Makes a logical |
|
Register address |
– |
– |
Makes a logical |
|
Temporary register address |
– |
– |
Makes a logical |
|
Non-volatile register address |
– |
– |
Makes a logical exclusive |
|
Constant value (0–65,535) |
– |
– |
Makes a logical exclusive |
|
Register address |
– |
– |
Makes a logical exclusive |
|
Temporary register address |
– |
– |
Makes a logical exclusive |
|
Non-volatile register address |
– |
– |
Makes a logical exclusive |
|
Register address |
Temporary register address |
– |
Stores the 16-bit accumulator content into the register defined by Argument 1 on a rising edge of the 1-bit accumulator. |
|
Temporary register address |
Temporary register address |
– |
Stores the 16-bit accumulator content into the temporary register defined by Argument 1 on a rising edge of the 1-bit accumulator. |
|
Non-volatile register address |
Temporary register address |
– |
Stores the 16-bit accumulator content into the non-volatile register defined by Argument 1 on a rising edge of the 1-bit accumulator. |
– Argument not applicable to logic command. |
Timer Logic Commands
Timers have a range from 0 to 65,535 and measure time in intervals of seconds or tenth of seconds:
-
Argument 1 specifies the time period
-
Argument 2 is a calculated end time
-
Argument 3 is the timer status register
Timer commands include:
Command |
Argument 1 |
Argument 2 |
Argument 3 |
Description |
---|---|---|---|---|
|
Temporary register (time period) |
Temporary register (calculated end time) |
Temporary register (status) |
Counts in seconds the time period input in Argument 1 as described by status register bits. |
|
Temporary register (time period) |
Temporary register (calculated end time) |
Temporary register (status) |
Counts in tenths of seconds the time period input in Argument 1 as described by status register bits. |
|
Constant value 0–65,535 (time period) |
Temporary register (calculated end time) |
Temporary register (status) |
Counts in seconds the time period input in Argument 1 as described by status register bits. |
|
Constant value 0–65,535 (time period) |
Temporary register (calculated end time) |
Temporary register (status) |
Counts in tenths of seconds the time period input in Argument 1 as described by status register bits. |
Latch Logic Commands
Latch commands include:
Command |
Argument 1 |
Argument 2 |
Argument 3 |
Description |
---|---|---|---|---|
|
Temporary register (status) |
– |
– |
Records and retains in a temporary register a history of a signal. |
|
Non-volatile register (status) |
– |
– |
Records and retains in a non-volatile register a history of a signal. |
– Argument not applicable to logic command. |
Counter Logic Commands
Counters have a range from 0 to 65,535 and transition to 0 upon counting to the maximum value of 65,535.
Counter commands include:
Command |
Argument 1 |
Argument 2 |
Argument 3 |
Description |
---|---|---|---|---|
|
Temporary register (counter value) |
Constant value 0–65,535 (preset value) |
Temporary register (status) |
Performs a comparative count, saving both the count and status to temporary registers. |
|
Non-volatile register (counter value) |
Constant value 0–65,535 (preset value) |
Non-volatile register (status) |
Performs a comparative count, saving both the count and status to non-volatile registers. |
Math Logic Commands
Math commands perform unsigned math functions using the 16-bit accumulator and temporary registers. Math commands are executed on a rising edge of the 1-bit accumulator. Math commands include:
Command |
Argument 1 |
Argument 2 |
Argument 3 |
Description |
---|---|---|---|---|
|
Temporary register (value) |
Temporary register (status) |
– |
Argument 1 = Argument 1 + 16-bit accumulator. |
|
Temporary register (value) |
Temporary register (status) |
– |
Argument 1 = Argument 1 - 16-bit accumulator. |
|
Temporary register (most significant word) |
Temporary register (least significant word) |
Temporary register (status) |
Argument 1:Argument 2 = 16-bit accumulator x Argument 2. |
|
Temporary register (most significant word) |
Temporary register (least significant word) |
Temporary register (status) |
Argument 1:Argument 2 = Argument 1:Argument 2 / 16-bit accumulator. |
– Argument not applicable to logic command. |