DOCA0275EN-00

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.

NOTE: If this history bit is modified, the detection of the rising edge can be disturbed.

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

LOAD_K_BIT

Constant value (0 or 1)

Loads a constant value into the 1-bit accumulator.

LOAD_BIT

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.

LOAD_TMP_BIT

Temporary register address

Register bit no. (0–15)

Loads a temporary register bit into the 1-bit accumulator.

LOAD_NV_BIT

Non-volatile register address

Register bit no. (0–15)

Loads a non-volatile register bit into the 1-bit accumulator.

LOAD_NOT_BIT

Register address

Register bit no. (0–15)

Loads an inverted Boolean value of a register bit into the 1-bit accumulator.

LOAD_NOT_TMP_BIT

Temporary register address

Register bit no. (0–15)

Loads an inverted Boolean value of a temporary register bit into the 1-bit accumulator.

LOAD_NOT_NV_BIT

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.

AND_BIT

Register address

Register bit no. (0–15)

Loads the result of a logical AND link between the register bit value and the 1-bit accumulator content. The result is stored in the 1-bit accumulator.

AND_TMP_BIT

Temporary register address

Register bit no. (0–15)

Loads the result of a logical AND link between the temporary register bit value and the 1-bit accumulator content. The result is stored in the 1-bit accumulator.

AND_NV_BIT

Non-volatile register address

Register bit no. (0–15)

Loads the result of a logical AND link between the non-volatile register bit value and the 1-bit accumulator content. The result is stored in the 1-bit accumulator.

AND_NOT_BIT

Register address

Register bit no. (0–15)

Loads the result of a logical AND of the inverted register bit and the 1-bit accumulator. The result is stored in the 1-bit accumulator.

AND_NOT_TMP_BIT

Temporary register address

Register bit no. (0–15)

Loads the result of a logical AND of the inverted temporary register bit and the 1-bit accumulator. The result is stored in the 1-bit accumulator.

AND_NOT_NV_BIT

Non-volatile register address

Register bit no. (0–15)

Loads the result of a logical AND of the inverted non-volatile register bit and the 1-bit accumulator. The result is stored in the 1-bit accumulator.

OR_BIT

Register address

Register bit no. (0–15)

Makes a logical OR link between the register bit value and the 1-bit accumulator content. The result is stored in the 1-bit accumulator.

OR_TMP_BIT

Temporary register address

Register bit no. (0–15)

Makes a logical OR link between the temporary register bit value and the 1-bit accumulator content. The result is stored in the 1-bit accumulator.

OR_NV_BIT

Non-volatile register address

Register bit no. (0–15)

Makes a logical OR link between the non-volatile register bit value and the 1-bit accumulator content. The result is stored in the 1-bit accumulator.

OR_NOT_BIT

Register address

Register bit no. (0–15)

Makes an logical OR of the inverted register bit and the 1-bit accumulator. The result is stored in the 1-bit accumulator.

OR_NOT_TMP_BIT

Temporary register address

Register bit no. (0–15)

Makes an logical OR of the inverted temporary register bit and the 1-bit accumulator. The result is stored in the 1-bit accumulator.

OR_NOT_NV_BIT

Non-volatile register address

Register bit no. (0–15)

Makes an logical OR of the inverted non-volatile register bit and the 1-bit accumulator. The result is stored in the 1-bit accumulator.

SET_BIT

Register address

Register bit no. (0–15)

Sets value of the 1-bit accumulator into a register bit.

SET_TMP_BIT

Temporary register address

Register bit no. (0–15)

Sets value of the 1-bit accumulator into a temporary register bit.

SET_NV_BIT

Non-volatile register address

Register bit no. (0–15)

Sets value of the 1-bit accumulator into a non-volatile register bit.

SET_NOT_BIT

Register address

Register bit no. (0–15)

Sets inverted value of the 1-bit accumulator into a register bit.

SET_NOT_TMP_BIT

Temporary register address

Register bit no. (0–15)

Sets inverted value of the 1-bit accumulator into a temporary register bit.

SET_NOT_NV_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

LOAD_K_REG

Constant value (0–65,535)

Loads a constant value into the 16-bit accumulator.

LOAD_REG

Register address

Loads a copy of a register into the 16-bit accumulator.

LOAD_TMP_REG

Temporary register address

Loads a copy of a temporary register into the 16-bit accumulator.

LOAD_NV_REG

Non-volatile register address

Loads a copy of a non-volatile register into the 16-bit accumulator.

COMP_K_REG

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:

BIT 1 ON if 16-bit accumulator < content of the Argument 1

BIT 2 ON if 16-bit accumulator = content of the Argument 1

BIT 3 ON if 16-bit accumulator > content of the Argument 1

COMP_REG

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:

BIT 1 ON if 16-bit accumulator < content of the register defined by Argument 1

BIT 2 ON if 16-bit accumulator = content of the register defined by Argument 1

BIT 3 ON if 16-bit accumulator > content of the register defined by Argument 1

COMP_TMP_REG

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:

BIT 1 ON if 16-bit accumulator < content of the register defined by Argument 1

BIT 2 ON if 16-bit accumulator = content of the register defined by Argument 1

BIT 3 ON if 16-bit accumulator > content of the register defined by Argument 1

COMP_NV_REG

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:

BIT 1 ON if 16-bit accumulator < content of the register defined by Argument 1

BIT 2 ON if 16-bit accumulator = content of the register defined by Argument 1

BIT 3 ON if 16-bit accumulator > content of the register defined by Argument 1

AND_K

Constant value (0 or 1)

Makes a logical AND link between the constant value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

AND_REG

Register address

Makes a logical AND link between the register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

AND_TMP_REG

Temporary register address

Makes a logical AND link between the temporary register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

AND_NV_REG

Non-volatile register address

Makes a logical AND link between the non-volatile register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

OR_K

Constant value (0 or 1)

Makes a logical OR link between the constant value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

OR_REG

Register address

Makes a logical OR link between the register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

OR_TMP_REG

Temporary register address

Makes a logical OR link between the temporary register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

OR_NV_REG

Non-volatile register address

Makes a logical exclusive OR link between the non-volatile register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

XOR_K

Constant value (0–65,535)

Makes a logical exclusive OR link between the constant value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

XOR_REG

Register address

Makes a logical exclusive OR link between the register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

XOR_TMP_REG

Temporary register address

Makes a logical exclusive OR link between the temporary register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

XOR_NV_REG

Non-volatile register address

Makes a logical exclusive OR link between the non-volatile register value and the 16-bit accumulator content. The result is stored in the 16-bit accumulator.

ON_SET_REG

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.

ON_SET_TMP_REG

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.

ON_SET_NV_REG

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

TIMER_SEC

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.

TIMER_TENTHS

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.

TIMER_K_SEC

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.

TIMER_K_TENTHS

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

LATCH

Temporary register (status)

Records and retains in a temporary register a history of a signal.

LATCH_NV

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

COUNTER

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.

COUNTER_NV

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

ON_ADD

Temporary register (value)

Temporary register (status)

Argument 1 = Argument 1 + 16-bit accumulator.

ON_SUB

Temporary register (value)

Temporary register (status)

Argument 1 = Argument 1 - 16-bit accumulator.

ON_MUL

Temporary register (most significant word)

Temporary register (least significant word)

Temporary register (status)

Argument 1:Argument 2 = 16-bit accumulator x Argument 2.

ON_DIV

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.

QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?