Snap7 Client
Snap7 Client
In this first part of the code, after having duly declared the variables and having initialized them, the connection with the PLC is made, obtaining some information such as the model, the serial number, the status, and many others.
The PLC information is reported as a dictionary, to then start the cyclical reading of the DB offset as shown below.
In this part of the code a memory area is read (offset of a DB) for ten seconds, showing the raw value made up of an array of Bytes, and then converting the value into Real format.
On the left, the value of offset 48 of Data Block 546 reported on the TIA Portal; on the right, the same value read through the snippet.