UART Function of Extremely Simple! Standard App
Data format used in UART function
This explains the data format used in the UART function of the Extremely Simple! Standard App (App_Twelite).
Digital and Analog Input/Output
0x81: Status Notification from Remote Device
Outputs the state of the received input signals.
Data Format
| # | Data | Content | Note |
|---|---|---|---|
char | Header | : only | |
| 0 | uint8 | Source Logical Device ID | |
| 1 | uint8 | Command Number | 0x81 only |
| 2 | uint8 | Packet Identifier | Generated from Application ID |
| 3 | uint8 | Protocol Version | 0x01 only |
| 4 | uint8 | LQI | 0-255 |
| 5 | uint32 | Source Serial ID | 0x8??????? |
| 9 | uint8 | Destination Logical Device ID | |
| 10 | uint16 | Timestamp | 64 counts per second |
| 12 | uint8 | Relay Count | |
| 13 | uint16 | Power Supply Voltage | Unit is mV |
| 15 | int8 | - | (Unused) |
| 16 | uint8 | Digital Signals | Corresponds to DIx from LSB, 0 is HighMSB 1 means periodic transmission |
| 17 | uint8 | Digital Signal Mask | Corresponds to DIx from LSB, 1 is valid |
| 18 | uint8 | Conversion Value of AI1 | See Calculation of Analog Signals, 0xFF means unused |
| 19 | uint8 | Conversion Value of AI2 | See Calculation of Analog Signals, 0xFF means unused |
| 20 | uint8 | Conversion Value of AI3 | See Calculation of Analog Signals, 0xFF means unused |
| 21 | uint8 | Conversion Value of AI4 | See Calculation of Analog Signals, 0xFF means unused |
| 22 | uint8 | Correction Value of AIx | Corresponds to AIx in 2-bit units from LSB |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D/'\r') | |
char | Footer | LF (0x0A/'\n') |
This is the same as the Output of Parent/Relay Device App.
Calculation of Analog Signals
The input voltage \(V\) of AIx can be expressed using the received conversion value \(e_{r}\) and correction value \(e_{fr}\) as follows:
$$\begin{align*}
V &= e+e_f \\
\text{where} \\
e &= 16e_r \\
e_f &= 4e_{fr} \\
\end{align*}$$
Unit: mV
Example Output Data
:78811501C98201015A000391000C2E00810301FFFFFFFFFB
Interpretation of the above data
| # | Data | Content | Value | |
|---|---|---|---|---|
: | char | Header | : | |
78 | 0 | uint8 | Source Logical Device ID | 0x78 |
81 | 1 | uint8 | Command Number | 0x81 |
15 | 2 | uint8 | Packet Identifier | 0x15 |
01 | 3 | uint8 | Protocol Version | 0x01 |
C9 | 4 | uint8 | LQI | 201/255 |
8201015A | 5 | uint32 | Source Serial ID | 0x201015A |
00 | 9 | uint8 | Destination Logical Device ID | 0x00 |
0391 | 10 | uint16 | Timestamp | About 14.27 seconds |
00 | 12 | uint8 | Relay Count | 0 |
0C2E | 13 | uint16 | Power Supply Voltage | 3118 mV |
00 | 15 | int8 | - | |
81 | 16 | uint8 | Digital Signals | DI1 Low DI2 HighDI3 High DI4 High(Periodic transmission) |
03 | 17 | uint8 | Digital Signal Mask | DI1 DI2 |
01 | 18 | uint8 | Conversion Value of AI1 | 16 mV |
FF | 19 | uint8 | Conversion Value of AI2 | Unused |
FF | 20 | uint8 | Conversion Value of AI3 | Unused |
FF | 21 | uint8 | Conversion Value of AI4 | Unused |
FF | 22 | uint8 | Correction Value of AIx | AI1 0x03 |
FB | uint8 | Checksum | 0xFB | |
char | Footer | \r | ||
char | Footer | \n |
0x80: Remote Device Output Change
Controls the output signals of the remote device.
Data Format
| # | Data | Content | Note |
|---|---|---|---|
char | Header | : only | |
| 0 | uint8 | Destination Logical Device ID | Parent 0x00, Child 0x01-0x64, All Children 0x78 |
| 1 | uint8 | Command Number | 0x80 only |
| 2 | uint8 | Format Version | 0x01 only |
| 3 | uint8 | Digital Signals | Corresponds to DOx from LSB, 0 is High |
| 4 | uint8 | Digital Signal Mask | Corresponds to DOx from LSB, 1 is valid |
| 5 | uint16 | PWM1 Signal | 0-1024, 0xFFFF means disabled |
| 7 | uint16 | PWM2 Signal | 0-1024, 0xFFFF means disabled |
| 9 | uint16 | PWM3 Signal | 0-1024, 0xFFFF means disabled |
| 11 | uint16 | PWM4 Signal | 0-1024, 0xFFFF means disabled |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D/'\r') | |
char | Footer | LF (0x0A/'\n') |
UART Input/Output
0x01: Transmission of Arbitrary Data
Data Format
| # | Data | Content | Note |
|---|---|---|---|
char | Header | : only | |
| 0 | uint8 | Destination Logical Device ID | Parent 0x00, Child 0x01-0x64, All Children 0x78 |
| 1 | uint8 | Command Number | 0x01 only |
| 2 | [uint8] | Arbitrary Data | Byte sequence of length \(N\) (recommended \(N\leqq80\)) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D/'\r') | |
char | Footer | LF (0x0A/'\n') |
This is the same as specifying command number
0x01 in the Format Mode (ASCII) simple format of the Serial Communication App.0x01: Reception of Arbitrary Data
Data Format
| # | Data | Content | Note |
|---|---|---|---|
char | Header | : only | |
| 0 | uint8 | Source Logical Device ID | Parent 0x00, Child 0x01-0x64, Unset Child 0x78 |
| 1 | uint8 | Command Number | 0x01 only |
| 2 | [uint8] | Arbitrary Data | Byte sequence of length \(N\) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D/'\r') | |
char | Footer | LF (0x0A/'\n') |
This is the same as when the command number is
0x01 in the Format Mode (ASCII) simple format of the Serial Communication App.I2C Input/Output
0x88: I2C Input
Data Format
| # | Data | Content | Note |
|---|---|---|---|
char | Header | : only | |
| 0 | uint8 | Destination Logical Device ID | Parent 0x00, Child 0-0x7F, All Children 0x78, Self 0xDB |
| 1 | uint8 | Packet Identifier | 0x88 only |
| 2 | uint8 | Response Number | Number output to response message |
| 3 | uint8 | Command Number | Write 0x1, Read 0x2, Read/Write 0x4 |
| 4 | uint8 | I2C Address | 7-bit |
| 5 | uint8 | I2C Command | First command byte |
| 6 | uint8 | Data Size | 0 means none |
| 7 | [uint8] | Data | Byte sequence of length \(N\) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D/'\r') | |
char | Footer | LF (0x0A/'\n') |
For command number
0x4, specify the data size to read and omit the data. The specified I2C command is written, and the specified amount of data is read.0x89: I2C Output
Data Format
| # | Data | Content | Note |
|---|---|---|---|
char | Header | : only | |
| 0 | uint8 | Source Logical Device ID | Parent 0x00, Child 0-0x7F, All Children 0x78, Self 0xDB |
| 1 | uint8 | Packet Identifier | 0x89 only |
| 2 | uint8 | Response Number | Number output to response message |
| 3 | uint8 | Command Number | Write 0x1, Read 0x2, Read/Write 0x4 |
| 4 | uint8 | Result | Failure 0, Success 1 |
| 5 | uint8 | Data Size | 0 means none |
| 6 | [uint8] | Data | Byte sequence of length \(N\) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D/'\r') | |
char | Footer | LF (0x0A/'\n') |