Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

S7 Move Block question

Status
Not open for further replies.

snydl0ga

Industrial
May 26, 2004
12
US
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
 
Replies continue below

Recommended for you

Use SFC21 FILL. First initialize some memory area with desired value then use FILL with this area as input BVAL.
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.
 
Or you can also just do the following:

L 0
T DB100.DBW100
T DB100.DBW102
and so on...

 
Briliant idea JLin, you should have tried it for 10 kB datablock.

Regards,

Jacek

Do it right or don't do it at all.
 
Hallo try this


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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top