How To Read or Write A Single Parameter Using FB287
How To Read or Write A Single Parameter Using FB287
https://support.industry.siemens.com/cs/ww/en/view/109475970
1 Read or write a single parameter using
FB287
FB287 is a function block for single parameter access, which calls the acyclic
communication blocks RDREC/SFB52 and WRREC/SFB53 internally. FB287 is
integrated in the libraries of the TIA Portal software.
Before the utilization of FB287, make sure the configuration is completed in TIA
Portal and the communication between the controller and the drive is established.
This example includes a CPU1513-1 PN (V1.5) and a G120 with CU250S-2 PN
(V4.6).
2
1.1.2 Insert FB287 in the main program (OB1) or cyclic interrupt OB (e.g.
OB32).
FB287 can be found as SINA_PARA_S in the libraries. There are different libraries
for different PLCs (S7-300/S7-400, S7-1200, S7-1500).
3
The following picture shows the FB287 with terminals assigned.
Figure 03 FB287
4
The following table shows the definition for each terminal of the block.
1.1.3 Read the value of p1130 (Ramp function generator initial rounding-off
time).
Use a watch table to read a single parameter after compiling and downloading the
project to the PLC. According to the parameter view of Startdrive, the original value
of p1130 is 0.0s.
5
ReadWrite=0, reading request
Parameter=1130, specify the parameter number
Index=0, specify the index for the parameter
A rising edge on terminal Start starts the reading task. After the reading task is
finished, the Done bit is set. And the parameter value is shown in ValueRead.
A rising edge on terminal Start starts the writing task. After the writing task is
finished, the Done bit is set. And the modified parameter value can be seen from
the parameter view of Startdrive.
6
NOTE 1. FB287 is available for S7-300/400, S7-1200 and S7-1500 PLCs.
2. FB287 is available for both PROFINET and PROFIBUS.
3. FB287 is available for both SINAMICS S and SINAMICS G inverters.
4. The parameter value is handled in the format of floating-point number. For
example, if p1000=6 (setpoint selection, integer 16), 6.0 will be the result of a
reading request. For a writing request, 1.0 for the ValueWrite can change
p1000 to 1.