Technical Forum

SIMATIC S5 / STEP 5

Converting LIR_from S5 to S7

Thread Starter: ENG. MAZEN   Started: 4/7/2012 4:02 PM   Replies: 11

« Previous thread Next thread »
12» Page 1 of 2 (12 items)
  4/7/2012, 4:02 PM
Joined 12/16/2009
Last visit: 5/6/2013
Posts: 15
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Dear Sir
i try to convert my plc program from S5 to S7.But i face the problem that my network Have LIR!!!
i try to understand the program but really it is very defecult to converted it. i attached for you the text file have the network and really i appreciate if you help me to change this LIR on the netowork..

Waiting you kindly Reply..
MG

Attachment: LIR_PROBLEM_TO_KONVERT_S5_S7.pdf  (12 Downloads)

Top
  4/7/2012, 4:56 PM
Joined 12/22/2006
Last visit: 5/18/2013
Posts: 1295
Rating:
Rated: Excellent [4.01 out of 5 / rated 151 time(s)]. (151) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello,
Please post the code like it was at the origin (before the converter had altered it).
Mention also on what CPU type the program was running in Simatic S5.

Best regards
jklm

Suggestion was helpful? Thanks to rate it.
Top
  4/7/2012, 5:14 PM
Joined 12/16/2009
Last visit: 5/6/2013
Posts: 15
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I paste the code below......

NAME:    DB-CHNG
DECL:    Q-DB    DKF
DECL:    Z-DB    DKF
DECL:    Q-DW    DKF
DECL:    Z-DW    DKF
DECL:    LAE    DKF
DECL:    ANZW    AW
DECL:    CHNG    ABI

    LW    =Q-DB
    ADD    DH 000EEC00
    LIR    1
    SLD    4
    T    MW 200
    KZW    
    SPZ    =M001
    LW    =Q-DW
    LW    =LAE
    +F    
    ADD    BF -1
    T    MW 204
    L    MW 200
    ADD    BF -1
    LIR    1
    ADD    BF -6
    >F    
    SPB    =M001
    LW    =Z-DB
    ADD    DH 000EEC00
    LIR    1
    SLD    4
    T    MW 202
    KZW    
    SPZ    =M002
    LW    =Z-DW
    LW    =LAE
    +F    
    ADD    BF -1
    T    MW 206
    L    MW 202
    ADD    BF -1
    LIR    1
    ADD    BF -6
    >F    
    SPB    =M002
    L    MW 204
    L    MW 200
    +F    
    T    MW 204
    T    MW 210
    L    MW 206
    L    MW 202
    +F    
    T    MW 206
    T    MW 212
    LW    =LAE
    T    MW 208
    -F    
    T    MW 214
M004:    L    MW 210
    LIR    1
    L    MW 212
    LIR    1
    ><F    
    SPB    =M003
    L    MW 210
    ADD    BF -1
    T    MW 210
    L    MW 212
    ADD    BF -1
    T    MW 212
    L    MW 214
    >F    
    SPB    =M004
    BEA    
M003:    L    MW 204
    L    MW 206
    B    MW 208
    TNW    0
    L    KB 0
    T    =ANZW
    S    =CHNG
    BEA    
M001:    LW    =Q-DB
    T    =ANZW
    BEA    
M002:    LW    =Z-DB
    T    =ANZW
    BE 

and the CPU type is  948

i appreciate you support.. 
Top
  4/8/2012, 7:05 AM
Joined 12/1/2009
Last visit: 5/18/2013
Posts: 322
Rating:
Rated: Outstanding [3.57 out of 5 / rated 28 time(s)]. (28) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
ENG. MAZEN wrote:
I paste the code below......

NAME:    DB-CHNG
DECL:    Q-DB    DKF
DECL:    Z-DB    DKF
DECL:    Q-DW    DKF
DECL:    Z-DW    DKF
DECL:    LAE    DKF
DECL:    ANZW    AW
DECL:    CHNG    ABI

    LW    =Q-DB
    ADD    DH 000EEC00
    LIR    1
    SLD    4
    T    MW 200
    KZW    
    SPZ    =M001
    LW    =Q-DW
    LW    =LAE
    +F    
    ADD    BF -1
    T    MW 204
    L    MW 200
    ADD    BF -1
    LIR    1
    ADD    BF -6
    >F    
    SPB    =M001
    LW    =Z-DB
    ADD    DH 000EEC00
    LIR    1
    SLD    4
    T    MW 202
    KZW    
    SPZ    =M002
    LW    =Z-DW
    LW    =LAE
    +F    
    ADD    BF -1
    T    MW 206
    L    MW 202
    ADD    BF -1
    LIR    1
    ADD    BF -6
    >F    
    SPB    =M002
    L    MW 204
    L    MW 200
    +F    
    T    MW 204
    T    MW 210
    L    MW 206
    L    MW 202
    +F    
    T    MW 206
    T    MW 212
    LW    =LAE
    T    MW 208
    -F    
    T    MW 214
M004:    L    MW 210
    LIR    1
    L    MW 212
    LIR    1
    ><F    
    SPB    =M003
    L    MW 210
    ADD    BF -1
    T    MW 210
    L    MW 212
    ADD    BF -1
    T    MW 212
    L    MW 214
    >F    
    SPB    =M004
    BEA    
M003:    L    MW 204
    L    MW 206
    B    MW 208
    TNW    0
    L    KB 0
    T    =ANZW
    S    =CHNG
    BEA    
M001:    LW    =Q-DB
    T    =ANZW
    BEA    
M002:    LW    =Z-DB
    T    =ANZW
    BE 

and the CPU type is  948

i appreciate you support.. 


Hello,

the block looks like a part of a standard package for something together with other blocks. On the first view the block seems to copy data words from one data block into another data block. That can be simply achieved in S7 with the MOVE function. But there is the paramerter CHNG which is set in this block but is not get reset.

Try to find out from which package this block is from. Or maybe somebody knows here. It is possible that you dont need to transfer the block into S7 while there is another package already existing for the S7.

Converting S5 to S7 is not allways transferring block by block into S7. And the converter function may be usefull in converting simple logic operations only. I never used the converter and use the S5 programm just as a reference.

Regards.

-------------------------------------------------------------------------------------------------------
Give us your feedback and show us your respect!
We take our free time to support you with our knowledge and experience.
If this post is helpfull to you kindly click on "Rate" or "Thank".
Top
  4/8/2012, 11:02 AM
Joined 12/22/2006
Last visit: 5/18/2013
Posts: 1295
Rating:
Rated: Excellent [4.01 out of 5 / rated 151 time(s)]. (151) 
Rated: Above avarage [3 out of 5 / rated 1 time(s)]. (1) 
Hello,
Like TIB68 already told, the block copies some datawords from one block to another.
Q-DB is the source data block
Z-DB is the destination data block
Q-DW is the start word in the source DB
Z-DW is the start word in the destination DB
LAE is the length (number of words to be transfered)
Before transfering, the block checks if the DBs exists and if number of words can be transfered. 
ANZW is a kind of error word where the problematic parameter value is displayed in case of error.
CHNG is a bit is the transfer was successful.

As TIB68 told you, you will not be able to convert this without rewriting the finctionnality in STEP7.
Using the SFC Blockmove with variable ANY pointer is the way to go.
How to proceed with computed ANY pointers is explained in this FAQ:
How do you parameterize blocks, which have "ANY"-type or "Pointer" type parameters
http://support.automation.siemens.com/WW/view/en/20443243



=== Edited by jklm @ 4/9/2012 5:12 PM [GMT ] ===



Best regards
jklm

Suggestion was helpful? Thanks to rate it.
Top
  4/9/2012, 7:48 AM
Joined 7/18/2011
Last visit: 4/9/2013
Posts: 277
Rating:
Rated: Outstanding [4 out of 5 / rated 31 time(s)]. (31) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
ENG. MAZEN wrote:

M004:    L    MW 210
    LIR    1
    L    MW 212
    LIR    1
    ><F    
    SPB    =M003
    L    MW 210
    ADD    BF -1
    T    MW 210
    L    MW 212
    ADD    BF -1
    T    MW 212
    L    MW 214
    >F    
    SPB    =M004
    BEA    
M003:    L    MW 204
    L    MW 206
    B    MW 208
    TNW    0
    L    KB 0
    T    =ANZW
    S    =CHNG
    BEA    


Hi ENG. MAZEN,

This block does a 'conditional' block transfer.
If there is a difference between source and destination block, then the source block is copied to the destination block and the CHNG flag is SET. If no change is detected the CHNG flag remains unaltered.
By doing this, it creates an edge when the source block is CHaNGed. I guess this CHNG flag is resetted outside the FB.
But as already stated, S7 offers other options to perform this functionality.

Kind regards,
BV
.
Top
  4/9/2012, 10:13 AM
Joined 12/16/2009
Last visit: 5/6/2013
Posts: 15
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi TIBI68

thx for the information but really is not easy to converted one by onesad
Top
  4/9/2012, 10:14 AM
Joined 12/16/2009
Last visit: 5/6/2013
Posts: 15
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi BV

Thx for the information and i appreciate if you can convert the network which i add it.
Top
  4/9/2012, 10:21 AM
Joined 12/16/2009
Last visit: 5/6/2013
Posts: 15
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi jklm

 thx for the information but the example which is in the web address is only for LAR !!!
i appreciate if you can tell me how can i convert the network which i add it..

Regards
Top
  4/9/2012, 3:36 PM
Joined 12/1/2009
Last visit: 5/18/2013
Posts: 322
Rating:
Rated: Outstanding [3.57 out of 5 / rated 28 time(s)]. (28) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,

I think that you did not understand me properly. So let me make it more clear for you.

BY 99% YOU DO NOT NEED TO CONVERT THIS BLOCK !

The block is part of a standard package. Only the siemens developers in germany are using this type of code writing.

Is it possible that you can upload us the whole S5 program?

Let me and others confirm with you.

Would be nice if you can give us even some more information about the existing S5 hardware. If you are not sure, just make a picture and upload it as well.

A picture tells more than thousend words. grin

I am looking for some special cards i.e. for communication with other systems.

A "flagship" 948 CPU is not just there without any reason in your project. grin

Regards.



=== Edited by TIBI68 @ 4/9/2012 3:55 PM [GMT ] ===



-------------------------------------------------------------------------------------------------------
Give us your feedback and show us your respect!
We take our free time to support you with our knowledge and experience.
If this post is helpfull to you kindly click on "Rate" or "Thank".
Top
12» Page 1 of 2 (12 items)
Actions