Siemens Protocol Data Types

Corsair

Lifetime Supporting Member
Join Date
Dec 2020
Location
Missouri
Posts
243
I've got some minimal C code that I wrote some time ago to talk to Siemens PLCs. I used it with a 1200. At the time I only hit I, M, and Q memory. I now need to go back and modify it to hit DB data block memory. I don't have the original documentation that I used to write it.

In one place I have codes for different data types.
I 0x81
M 0x83
Q 0x82

Two questions - the first is what is the code value for DB memory.
The second question - the two bytes in the packet for the DB number - do I send the low byte first or last?

Thanks to all.
 
Code for DB = 0x84


Can't answer the byte order for the DB number.



+1 for snap7 - I use it all the time.
 
The byteorder of the S7 protocol is independent of the processors byteorder. The classic S7 protocol uses the network byte order for most parts, which is big endian. As you can get only access to "not optimized" datablocks with this simple old access method, even in the S7-1200/1500 the data of the payload is in big endian endian order, the same as in the 300/400 (compatibility mode).


See screenshot of a Wireshark capture of a read request reading DB101.DBX0.0 BYTE 462 (does only work on S7-400).

s7comm-db.jpg
 

Similar Topics

Dear guys, I have a software that sends data to PLC using modbus. I want to connect my software with siemens plc, how can i do that?
Replies
19
Views
4,584
I need some clarification. Do they have something called Fetch/Write that is different from Get/Put? How do they differ? Are they serial or...
Replies
5
Views
2,129
Hello, this is a brand new task for me. I recently bought a particulate sensor and it communicates with UART protocol or I2C protocol. It came...
Replies
12
Views
2,808
Spent the best part of the day trying to figure a problem with the Beijer Exter series no protocol mode. I got it sussed and so thought I would...
Replies
0
Views
3,306
hi, I am going to sniff the serial communication between an S5-115U plc and PC, and try to see which memory area are being accessed. However the...
Replies
6
Views
3,493
Back
Top Bottom