[?]: Can you explain what this logic means?

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
macroms
Posts: 58
Joined: Sat Mar 28, 2009 8:48 pm
Location: Saudi Arabia

[?]: Can you explain what this logic means?

Post by macroms »

Help please..Can you explain what this logic means?

Code: Select all

      L     DB10.DBW  210
      T     #conv_akku1
      TAK   
      T     #conv_akku2
      L     STW
      T     #conv_stw
      L     DB10.DBB    1
      SLW   4
      LAR1  
      L     #conv_stw
      T     STW
      L     #conv_akku2
      L     #conv_akku1
      T     DB10.DBW [AR1,P#0.0]
Schtiel
Site Admin
Posts: 1122
Joined: Wed Sep 06, 2006 12:03 pm
Location: CIS

Re: Help on STL code..

Post by Schtiel »

What command you don't understand? See "Help on STL" in Step7

L - load to ACCU 1
T - transfer from ACCU 1
TAK - exchange the contents of ACCU 1 with the contents of ACCU 2
L STW - loads ACCU 1 with the contents of the status word
SLW - shift left word
LAR1 - load address register AR1

etc.
macroms
Posts: 58
Joined: Sat Mar 28, 2009 8:48 pm
Location: Saudi Arabia

Re: [?]: Can you explain what this logic means?

Post by macroms »

Actually this is a converted program from S5..What do you mean by this?
1. #conv_akku1
2. #conv_akku2
3. #conv_stw
4. DB10.DBW [AR1,P#0.0]
5. Where is this status word came from?
centipede
Posts: 59
Joined: Mon Feb 05, 2007 1:24 pm
Location: Europe

Re: [?]: Can you explain what this logic means?

Post by centipede »

1 to 3:
This parts are temp Variables, here the converter saves the accu1 and 2 and stw (status)
the converter always saves the accus on the beginning of an FC or FB
5: every command make changes in the stw, take a look at the manual
4: this is indirect addressing

Code: Select all

L     DB10.DBB    1
      SLW   4
      LAR1  
Here the Byte 1 from DB10 is loaded to AR1 (adress register) with slw4 you get the content to the pointerformat

Code: Select all

  L     #conv_akku1
      T     DB10.DBW [AR1,P#0.0]
Here you transfer accu 1 to the word with the adress from the byte 1, you loaded before.

for example:

content from DBB1: 100
after the slw you have the pointerformat 100.0
than you transfer the content from accu1 to db10.DBW100

I hope this helps :oops: