S7 Move Block question
S7 Move Block question
(OP)
I have the need to clear multiple registers all at once. Typically I use a Fill command and fill them all with 0. I can not seem to find a similar function in the S7 318 logic.
Anyone have any ideas or am I overlooking a function? I was going to use the BlockMove but it does not accept 1 value of zero for multiple destinations. And the Fill function seemed to fill destinations with values from another block of registers instead of one constant.
For example: I want to clear or reset registers DB100.DBW100 through DB100.DBW110.
Lance Snyder
Anyone have any ideas or am I overlooking a function? I was going to use the BlockMove but it does not accept 1 value of zero for multiple destinations. And the Fill function seemed to fill destinations with values from another block of registers instead of one constant.
For example: I want to clear or reset registers DB100.DBW100 through DB100.DBW110.
Lance Snyder





RE: S7 Move Block question
Other solution is as always DIY:
OPN DB 100 //target DB
LAR1 P#DBX 100.0 //start of target area
L 0 //init val
L 12 //number of bytes to init
fill: TAK
T DBB [AR1,P#0.0]
+AR1 P#1.0
TAK
LOOP fill
jacek
Regards,
Jacek
Do it right or don't do it at all.
RE: S7 Move Block question
RE: S7 Move Block question
L 0
T DB100.DBW100
T DB100.DBW102
and so on...
RE: S7 Move Block question
Regards,
Jacek
Do it right or don't do it at all.
RE: S7 Move Block question
L 0
T "0_WERT" (MW0)
NOP 0
CALL "FILL"
BVAL :="0_WERT" (MW0)
RET_VAL:=MW4080
BLK :=P#DB100.DBX 200.0 WORD 10
You need to go over a variable MW and then it will work.
I had once the same problem
Regards Urs