> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-dlp-ide/instruction-reference.md).

# Instruction reference

Every DLP instruction at a glance, with links to the details for each instruction family.

This reference lists every DLP instruction. The pages below give the syntax, details and an example for each one, grouped by what they do.

* [Program structure and initialisation](https://help.qtech.co.nz/datran/datran-vi-scada/datran-dlp-ide/instruction-reference/program-structure.md): `PROGINIT`, `PROGSTART`, `PROGEND`, `TELINP`, `TELOUT`, `EQU`, `EQULAB`, `INITANL`, `INITDIG`, `CPANL`, `CPDIG`, `COSMASK`, `NCOSMASK`
* [Digital logic, outputs and jumps](https://help.qtech.co.nz/datran/datran-vi-scada/datran-dlp-ide/instruction-reference/digital-logic.md): `BEGIN`, `END`, `TCE`, `TCD`, `NOT`, `EC`, `ECC`, `SETDIG`, `RESDIG`, `TOGGLE`, `OR`, `NOR`, `XOR`, `JUMPA`, `JUMPT`, `JUMPF`
* [Analogue comparison and arithmetic](https://help.qtech.co.nz/datran/datran-vi-scada/datran-dlp-ide/instruction-reference/analogue.md): `EQR`, `EQS`, `NER`, `NES`, `GTR`, `GTS`, `GER`, `GES`, `LTR`, `LTS`, `LER`, `LES`, `ADDR`, `ADDS`, `SUBR`, `SUBS`, `MULR`, `MULS`, `DIVR`, `DIVS`, `INCANL`, `DECANL`
* [Timers, logging, COS and macros](https://help.qtech.co.nz/datran/datran-vi-scada/datran-dlp-ide/instruction-reference/timers-logging-macros.md): `TMR`, `TMV`, `SENDCOS`, `LOGGINGON`, `LOGGINGOFF`, `LOGINTR`, `LOGINTS`, `LOGPOINT`, and the macro instructions
* [I/O types and system registers](https://help.qtech.co.nz/datran/datran-vi-scada/datran-dlp-ide/instruction-reference/io-types.md): every register type, the clock and system registers, and labels

The floating-point conversion commands, such as `be_float_to_int`, are on the XL4 Plus [Floating-point numbers](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/floating-point-numbers.md) page. They need DLP IDE V4.04 and XL4 Plus firmware V7.16 or later.

## How to read the syntax

| In the syntax     | Means                                                                  |
| ----------------- | ---------------------------------------------------------------------- |
| `DigitalRegister` | A digital register, such as `RDIN1`, `NDOUT4` or a name set with `EQU` |
| `AnalogRegister`  | An analogue register, such as `RAIN1` or `NAOUT2`                      |
| `AnalogConstant`  | A number from 0 to 65535 (a setpoint)                                  |
| `LabelIdentifier` | A label: `Label1` to `Label255`, or a name                             |

Instructions ending in **R** work on two registers. Those ending in **S** work on a register and a constant (setpoint). For example, `GER` compares two registers, and `GES` compares a register with a number.

## All instructions

Each instruction uses one byte with a number of parameter bytes attached. **Bytes** indicates how many bytes are to be sent to the RTU. `EQU` and `EQULAB` are not sent in the DLP.

| Instruction | I/O types              | Parameters                      | Bytes | What it does                                                                                    | Code |
| ----------- | ---------------------- | ------------------------------- | ----- | ----------------------------------------------------------------------------------------------- | ---- |
| ADDR        | Analogue               | Analogue 1, Analogue 2          | 5     | Analog 1 + Analog 2                                                                             | $41  |
| ADDS        | Analogue               | Analogue, setpoint              | 3     | Analog + Setpoint                                                                               | $45  |
| BEGIN       | –                      | –                               | 1     | Indicates start of procedure                                                                    | $EB  |
| COSMASK     | Digital                | Packed bits                     | 9     | Allow I/O points to create COS                                                                  | $E8  |
| CPANL       | Analogue               | From, to, number of points      | 6     | Copy analog from reg 1 to reg 2 the indicated number to be transferred                          | $E5  |
| CPDIG       | DI, DO, NDI, NDO       | From, to, number of points      | 6     | Copy digital points from register 1 to register 2 giving the number to copy                     | $E4  |
| DECANL      | Analogue               | Analogue                        | 3     | Decrements the Analog Value                                                                     | $1E  |
| DIVR        | Analogue               | Analogue 1, Analogue 2          | 5     | Analog 1 / Analog 2                                                                             | $44  |
| DIVS        | Analogue               | Analogue, setpoint              | 3     | Analog / Setpoint                                                                               | $48  |
| EC          | DO, NDO                | Digital                         | 3     | Turn ON digital point, end logic rung                                                           | $0A  |
| ECC         | DO, NDO                | Digital                         | 3     | Turn ON digital point, do not end logic rung                                                    | $0B  |
| END         | –                      | –                               | 1     | Indicates end of procedure                                                                      | $EC  |
| EQR         | Analogue               | Analogue 1, Analogue 2          | 5     | Test Analog 1 = Analog 2                                                                        | $17  |
| EQS         | Analogue               | Analogue, setpoint              | 5     | Test Analog = Set Point                                                                         | $11  |
| EQU         | All                    | Any I/O, new name               | 0     | Changes I/O Definition                                                                          | –    |
| EQULAB      | –                      | Label, new name                 | 0     | Changes Label Definition                                                                        | –    |
| GER         | Analogue               | Analogue 1, Analogue 2          | 5     | Test Analog 1 >= Analog 2                                                                       | $1B  |
| GES         | Analogue               | Analogue, setpoint              | 5     | Test Analog >= Set Point                                                                        | $15  |
| GTR         | Analogue               | Analogue 1, Analogue 2          | 5     | Test Analog 1 > Analog 2                                                                        | $18  |
| GTS         | Analogue               | Analogue, setpoint              | 5     | Test Analog > Set Point                                                                         | $12  |
| INCANL      | Analogue               | Analogue                        | 3     | Increments the Analog Values                                                                    | $1D  |
| INITANL     | Analogue               | Analogue, value                 | 5     | Initialise an analog to a preset value                                                          | $E7  |
| INITDIG     | Digital                | Digital, value                  | 3     | Initialises a digital to a preset value                                                         | $E6  |
| JUMPA       | –                      | Label                           | 3     | Always Jump                                                                                     | $33  |
| JUMPF       | –                      | Label                           | 3     | IF Accumulator FALSE then Jump                                                                  | $32  |
| JUMPT       | –                      | Label                           | 3     | IF Accumulator TRUE then Jump                                                                   | $31  |
| LER         | Analogue               | Analogue 1, Analogue 2          | 5     | Test Analog 1 <= Analog 2                                                                       | $1C  |
| LES         | Analogue               | Analogue, setpoint              | 5     | Test Analog <= Set Point                                                                        | $16  |
| LOGGINGOFF  | –                      | –                               | 1     | Suspends all logging on the RTU                                                                 | $51  |
| LOGGINGON   | –                      | –                               | 1     | Resumes all logging on the RTU                                                                  | $52  |
| LOGINTR     | TDIN, TAIN, NDIN, NAIN | Point, analogue register        | 5     | Causes the nominated point to begin logging at the interval specified in the analogue register. | $53  |
| LOGINTS     | TDIN, TAIN, NDIN, NAIN | Point, constant                 | 5     | Causes the nominated point to begin logging at the interval specified in the analogue constant. | $54  |
| LOGPOINT    | TDIN, TAIN, NDIN, NAIN | Point                           | 3     | Causes the nominated point to be event logged at that instant in time.                          | $50  |
| LTR         | Analogue               | Analogue 1, Analogue 2          | 5     | Test Analog 1 < Analog 2                                                                        | $19  |
| LTS         | Analogue               | Analogue, setpoint              | 5     | Test Analog < Set Point                                                                         | $13  |
| MULR        | Analogue               | Analogue 1, Analogue 2          | 5     | Analog 1 \* Analog 2                                                                            | $43  |
| MULS        | Analogue               | Analogue, setpoint              | 3     | Analog \* Setpoint                                                                              | $47  |
| NER         | Analogue               | Analogue 1, Analogue 2          | 5     | Test Analog 1 <> Analog 2                                                                       | $1A  |
| NES         | Analogue               | Analogue, setpoint              | 5     | Test Analog <> Set Point                                                                        | $14  |
| NOR         | –                      | –                               | 1     | Logical NOR (NOT OR) function                                                                   | $07  |
| NOREND      | –                      | –                               | 1     | Ends a NOR logic rung                                                                           | $08  |
| NOT         | –                      | –                               | 1     | Inverts the sense of the digital point                                                          | $09  |
| OR          | –                      | –                               | 1     | Logical OR function                                                                             | $05  |
| OREND       | –                      | –                               | 1     | Ends an OR logic rung                                                                           | $06  |
| PROGEND     | –                      | –                               | 1     | Indicates end of program                                                                        | $EA  |
| PROGINIT    | –                      | –                               | 1     | Indicates start of initialisation                                                               | $E1  |
| PROGSTART   | –                      | –                               | 1     | Indicates start of program                                                                      | $E9  |
| RESDIG      | Digital                | Digital                         | 3     | Reset (make FALSE) digital point                                                                | $04  |
| SENDCOS     | –                      | –                               | 1     | Causes COS when set. Program reset auto                                                         | $0F  |
| SETDIG      | Digital                | Digital                         | 3     | Set (make TRUE) digital point                                                                   | $03  |
| SUBR        | Analogue               | Analogue 1, Analogue 2          | 5     | Analog 1 - Analog 2                                                                             | $42  |
| SUBS        | Analogue               | Analogue, setpoint              | 3     | Analog - Setpoint                                                                               | $46  |
| TCD (NAND)  | DI, NDI                | Digital                         | 3     | Test contact de-energised (OFF). If true then logic rung true                                   | $02  |
| TCE (AND)   | DI, NDI                | Digital                         | 3     | Test contact energised. If TRUE the logic rung is true                                          | $01  |
| TELINP      | –                      | –                               | 1     | Disconnect real inputs to base                                                                  | $E2  |
| TELOUT      | –                      | –                               | 1     | Disconnect real outputs to base                                                                 | $E3  |
| TMR         | –                      | Timer number, timer value       | 4     | Begin a timer & run it for timer constant in 1/10ths of seconds                                 | $21  |
| TMV         | Analogue               | Timer number, analogue register | 4     | Begin a timer and run it for analog timer value in 1/10ths of seconds                           | $22  |
| TOGGLE      | Digital                | Digital                         | 3     | Toggles Digital Value                                                                           | $0C  |
| XOR         | –                      | –                               | 1     | Logical Exclusive ‘OR’ Function                                                                 | $0D  |
| XOREND      | –                      | –                               | 1     | Ends an XOR Rung                                                                                | $0E  |

COS means Change of State: the RTU transmits a Change-Of-State message to the base station when an input changes.
