×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

S7 Move Block question

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

RE: S7 Move Block question

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.

RE: S7 Move Block question

(OP)
Good advice!  thanks

RE: S7 Move Block question

Or you can also just do the following:

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

RE: S7 Move Block question

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

Regards,

Jacek

Do it right or don't do it at all.

RE: S7 Move Block question

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources