Repository navigation
Structure of Serial Frame
MojtabaKiani edited this page Dec 19, 2020
·
2 revisions
This service is used to have a PC and other devices read and write the information and data in a PLC, and to have them control a PLC (RUN, STOP, PAUSE). In the system composing of a Master and a Slave, if station numbers are assigned, multi-drop communication is available.
The frame that an outside communication device requests to a computer link module
| ENQ | Stn | Cmd | Length | Data | BCC | EOT |
|---|---|---|---|---|---|---|
| 1 Byte | 2 Bytes | 1 Byte | 2 Bytes | N Bytes | 2 Bytes | 1Byte |
The frame that a computer link module responds to an outside communication device
| STX | Stn | Cmd | Length | Data | BCC | ETX |
|---|---|---|---|---|---|---|
| 1 Byte | 2 Bytes | 1 Byte | 2 Bytes | N Bytes | 2 Bytes | 1Byte |
- The structure of a sending frame and the one of a receiving frame are same.
- The same as the command codes received from a request frame (Master) are used for response frame. But, if there is an error in communication or process, Code E is responded.
- Description for Codes
| Code | Hex Value | Description |
|---|---|---|
| ENQ | 0x05 | Master Frame Header |
| EOT | 0x04 | Master Frame Tail |
| STX | 0x02 | Slave Header |
| ETX | 0x03 | Slave Tail |
| Stn | 0x00 ~ 0x1F, 0xFF | PLC Station Number |
| Cmd | Command | |
| Length | Length of Data Device (Length Bytes), Hexadecimal | |
| Data | Data Device according to Command (Length Bytes) | |
| BCC | Remainder value when dividing the binary-sum fromCmd to the end of data by 256 |
- Commands The commands used for exclusive communication service are as follows.
| Command | Code | ASCII | Function |
|---|---|---|---|
| Read Word Data | 0x52 | R | Reads Word Memory Device. |
| Write Word Data | 0x57 | W | Writes to Word Memory Device. |
| Read Bit Data | 0x72 | r | Reads Bit Memory Device. |
| Write Bit Data | 0x77 | w | Writes to Bit Memory Device. |
| Change PLC Mode | 0x4D | M | Changes PLC Mode. |
| Register Monitoring Device | 0x58 | X | Registers Monitoring Device. |
| Read Monitoring Device | 0x59 | Y | Reads |
| Respond Error | 0x45 | E | Responds Error in PLC. |