User Tools

Site Tools


kb:production:s7-communication:read

12 Read Variable

Request

Message Type = JOB (0x01)

Params

Byte Value Description
Fixed Part
[0] 0x04 Function Code (Read = 0x04)
[1] 0x01 Item Count (only 1 item)
[2] 0x12 Spec type (Variable Specification = 0x12)
[3] 0x0A Parameter length
[4] 0x…… Variable Addressing Mode (Syntax ID)
[5] 0x…… Variable Type
[6-7] 0x…… …… Count (number of elements of type Variable Type to read or write)

S7-Any Addressing (Syntax ID = 0x10)

Byte Value Description
[8-9] 0x…… …… Address of the data block in memory
[10] 0x…… Memory Area
[11-13] 0x…… …… …… offset of the addressed variable in the selected memory area (start address)

Drive-ES-Any Addressing (Syntax ID = 0xA2)

Byte Value Description
[8-9] 0x…… …… Drive Object
[10-11] 0x…… …… Parameter
[11-13] 0x…… …… Index

Data

none.


Response

Message Type = ACK_DATA (0x03)

Params

Byte Value Description
Fixed Part
[0-1] 0x…… …… Error Code
[2] 0x04 Function Code (Read = 0x04)
[3] 0x01 Item Count (only 1 item)

Data

Byte Value Description
Fixed Part
[0] 0xFF Response Item Return Code (0xFF = ok)
[1] 0x…… Transport Data Type
[2-3] 0x…… …… Count (number of elements of type Transport Data Type to read)
Variable Part
[4-n] Read Data (size depending on Transport Data Type)
kb/production/s7-communication/read.txt · Last modified: 2023/11/27 11:16 by joerg.hampel