kb:production:s7-communication:write
13 Write Variable
Request
Params
Byte | Value | Description |
---|---|---|
Fixed Part | ||
[0] | 0x05 | Write Variable = 0x05 |
[1] | 0x01 | Item Count (only 1 item) |
[2] | 0x12 | Spec type (Variable Specification = 0x12 ) |
[3] | 0x0A | Parameter length |
[4] | 0x10 | Syntax ID (addressing mode “any-type” = 0x10 ) |
[5] | 0x…… | Variable Type |
[6-7] | 0x…… …… | Count (number of elements of type Variable Type to read or write) |
[8-9] | 0x…… …… | Address of the data block in memory to read |
[10] | 0x…… | Memory Area |
[11-13] | offset of the addressed variable in the selected memory area (start address) |
Data
Byte | Value | Description |
---|---|---|
Fixed Part | ||
[0] | 0x00 | Error Code |
[1] | 0x…… | Transport Data Type (depends on variable type) |
[2-3] | 0x…… …… | Count (number of elements of type Transport Data Type to write) |
Variable Part | ||
[4-n] | Data to write |
Response
Params
Byte | Value | Description |
---|---|---|
Fixed Part | ||
[0-1] | 0x…… …… | Error Code |
[2] | 0x05 | Function Code (Write = 0x05 ) |
[3] | 0x…… | Item Count |
Data
Byte | Value | Description |
---|---|---|
Fixed Part | ||
[0] | 0x…… | Item Return Code (one byte per item, 0xFF = success) |
kb/production/s7-communication/write.txt · Last modified: 2019/11/14 09:16 by joerg.hampel