Siemens SIMATIC S7-1200 Manual - Page 22

Browse online or download pdf Manual for Switch Siemens SIMATIC S7-1200. Siemens SIMATIC S7-1200 49 pages. Controlling several fans (ebm-papst) via modbus rtu
Also for Siemens SIMATIC S7-1200: Manual (30 pages), Operating Instructions Manual (36 pages), Safety Programming Manualline (48 pages), Manual (40 pages), Manual (17 pages), Manual (31 pages), Manual (20 pages)

Siemens SIMATIC S7-1200 Manual
3 Mode of Operation
The task is transmitted to the FC "ReadWrite" via the following input parameters:
"fanNumber" = 2
"holding" = "TRUE" (register type: holding register)
"write" = "FALSE" (access type: read)
"addr" = 53512 (corresponds to 16#D108)
"len" = 6 (6 words are to be read)
The FC "ReadWrite" converts this information for the request "req" into the
parameter in the PLC data type "typeData" which the instruction "Modbus_Master"
understands:
"mbAddr" = 2 (is read from "Register".fan[2].mbAddr)
"mode" = 0 (corresponds to: "read holding register")
"addr" = 453513 (= holding register offset 400001 + x)
"len" = 6 (6 words are to be read)
This data type is transferred "manually" to the FB "EbmPapst" by means of the
input/output data and written into the last field ("cyclic.last") of the data transfer jobs
("cyclic") to be processed cyclically.
If the conditions "IndexCyclic" and "cyclic.last" are fulfilled, the information is
transmitted to the static placeholder "statDataAct" and handed to the
communication block "Modbus_Master".
The system block "Modbus_Master" receives the read data from the selected fan
and writes it into the data buffer "dataPtr" in the input/output data "manual" and
transmits it to the FC "ReadWrite" in case of successful transmission "done".
The output "done" is only active for one cycle and resets the request bit "req".
Only the data to be transmitted is valid respectively (defined by the data length
"len"). Before the FC "ReadWrite" is called again, the data has to be processed or it
will be overwritten.
The read registers ("holding" or "input") are also written to the correct field in the
DB "Register".
Besides the example "Reading holding registers" already described you can also
read input registers or write to holding registers.
If errors occur, the output bit "error" is set for one cycle.
The status "errorStatus" delivers the corresponding error code (remains pending).
For a detailed list of the error codes for the "Modbus_Master" instruction, refer to
Note
the online help of the TIA Portal using F1.
You can check the function of the FC "ReadWrite" using the watch table
"ReadWrite":
Controlling several fans (ebm-papst) via Modbus RTU
Entry ID: 109476801,
V2.0,
09/2018
22