Converting S5 to S7

edomiredo

Member
Join Date
Dec 2014
Location
Jakarta
Posts
15
i have some problem on converting s5 (CPU 115u 943B) to s7-300.
anybody can help me to explain the S5 code?
here is the program,

:L KH 0000
:T FY 215
:L DR 0
:SRW 1
:JP =M001
:SRW 1
:JP =M002
:S F 215.0
:JU =M003
M001 :SRW 1
:JP =M004
:S F 215.1
:JU =M003
M002 :S F 215.2
:JU =M003
M004 :S F 215.3
M003 :L KH 0000
:T FY 214
:L DL 0
:SRW 1
:JP =M005
:SRW 1
:JP =M006
:JU =M007
M005 :SRW 1
:JP =M008
:JU =M009
M008 :S F 214.2
:L KH ED00 ===> Absolute address for Counter?
:L DW 3
:SLW 1
:+F
:T FW 224
:JU =M010
M006 :S F 214.1
:L KH EC00 ===> Timer?
:L DW 3
:SLW 1
:+F
:T FW 224
:JU =M010
M007 :SRW 1
:JP =M011
:S F 214.3
:L KH EE00 ===> Flag?
:L DW 3
:+F
:T FW 224
:JU =M010
M011 :S F 214.4
:L KH EF00 ===> Peripheral Input?
:L DW 3
:+F
:T FW 224
:JU =M010
M009 :SRW 1
:JP =M012
:S F 214.0
:L KH E400 ==> Datablock
:L DL 1
:SLW 1
:+F
:LIR 0
:T FW 224
:L KF 0
:!=F
:L KH 0230
:BEC
:L FW 224
:L KF -2
:+F
:LIR 0
:L KF -5
:+F
:T FW 200
:L FW 224
:L DW 3
:SLW 1
:+F
:T FW 224
:L DW 2
:T FW 226
:AN F 215.1
:JC =M013
:SRW 1
:JZ =M014
:L KF 1
:+F
M014 :JU =M015
M013 :AN F 215.3
:JC =M015
:SLW 1
M015 :L DW 3
:+F
:T DW 3
:L FW 200
:>F
:L KH 0231
:BEC
:JU =M016
M012 :S F 214.5
:L KH EF80 ===> Peripheral Output?
:L DW 3
:+F
:T FW 224
M010 :L FY 214
:SRW 3
:L KF 0
:>F
:L FY 215
:JC =M017
:SRW 3
:JU =M018
M017 :SRW 2
M018 :T FW 200
:L KF 0
:L DW 2
:<F
:JC =M019
:L KH 0221
:BEC
M019 :T FW 226
:DO FW 200
:SLW 0
:L DW 3
:+F
:T DW 3
:A F 214.3
:JC =M020
:L KF 128
:JU =M021
M020 :L KF 256
M021 :>F
:L KH 0222
:BEC
M016 :***


My speculation is that the program is used to store a pointer of Counter/Timer/Flag/PI/DB/PQ to FW224 . is that right?
but i dont understand some codes then i cannot write S7 program.
Anybody can help me? Thanks.

ps: sorry for my bad English. :)
 
You have dug up some really strange coding.

I see two plausible uses:

A: It's a 'protocol overlay' to a communication driver.
Is there a call to FB SEND or RECEIVE in connection to this?
Could it be some Applicom communication coding?

B: It's a 'home made' command interpreter.

Kalle
 
No FB SEND and RECEIVE call. I've removed that from converted S7 program.
Just this block that I do not understand and unresolved.
 
No comments in S5 code. this is uploaded program.
I just want to know how to create pointer in s7 based this code.

:L KH ED00 ===> Absolute address for Counter?
:L DW 3
:SLW 1
:+F
:T FW 224
:JU =M010
M006 :S F 214.1
:L KH EC00 ===> Timer?
:L DW 3
:SLW 1
:+F
:T FW 224
:JU =M010
M007 :SRW 1
:JP =M011
:S F 214.3
:L KH EE00 ===> Flag?
:L DW 3
:+F
:T FW 224
:JU =M010
M011 :S F 214.4
:L KH EF00 ===> Peripheral Input?
:L DW 3
:+F
:T FW 224

am I right that above code is used to create pointer to FW224???
 
This is the code that call FB159 (my 1st post)

Segment 2 of 3
:LW =PERA
:T FW 200
: DO FW 200
:L PY 0
:T FY 202
:A F 202.6
:= F 203.6
:JC =M001
:L KH 0101
:JU =M002
M001 :A F 202.4
:L KH 0102
:JC =M002
:A F 202.7
:AN F 203.7
:O
:AN F 202.7
:A F 203.7
:JC =M003
:JU =M004
M003 : DO FW 216
:L PY 0
:L FY 202
:!=F
:JC =M005
:L KF 0
:BEU
M005 :LW =PERA
:L KF 1
:+F
:T FW 210
:T FW 212
:T FW 208
M014 :L FW 216
:L FW 210
:<=F
:JC =M004
:L KF 0
: DO FW 210
:L PY 0
:!=F
:JC =M004
:T FY 206
:AN F 206.4
:AN F 206.5
:L KH 02F1
:JC =M002
:L FW 210
:I 1
:T FW 210
:AN F 206.7
:JC =M006
:L FY 206
:SLW 12
:SRW 12
:I 1
:+F
M006 :AN F 206.5
:JC =M007
:I 4
M007 :AN F 206.4
:JC =M008
:I 5
M008 :T FW 220
:AN F 206.4
:JC =M009
:L FW 210
:I 5
:T FW 210
:AN F 206.5
:JC =M010
M009 : DO FW 210
:L PW 0
:T DR 1
:SRW 8
:T FY 200
:L KH 000F
:AW
:T DR 0
:L FY 200
:SRW 4
:T DL 0
:L KF 5
:>F
:L KH 0203
:JC =M011
:L DR 0
:L KF 3
:>F
:L KH 0204
:JC =M011
:L DR 0
:L KF 0
:><F
:JC =M012
:L DR 1
:L KF 15
:>F
:L KH 0205
:JC =M011
M012 :L FW 210
:I 2
:T FW 210
: DO FW 210
:L PW 0
:T FW 200
:SLW 8
:SRW 8
:T DW 3
:L FW 200
:SRW 8
:T DL 1
:L FW 210
:I 2
:T FW 210
:JU =M010
M002 :JU =M011
M004 :JU =M013
M018 :JU =M014
M010 :L KF 0
:L DR 0
:!=F
:JC =M015
: D 1
M015 :T FW 200
:L FY 206
:L KH 000F
:AW
:I 1
: DO FW 200
:SRW 0
:T DW 2
:L KH 0000
: DO FW 212
:T PY 0
:L FW 212
:T FW 208
:I 1
:T FW 212
:LW =PERA
:T FW 200
: DO FW 200
:L PY 0
: DO FW 216
:L PY 0
:AW
:SRW 7
:JP =M016
:L KH 0101
:JU =M011
M016 :JU FB 159
Name :COPY

:JC =M011
:L FW 210
:L FW 220
:><F
:L KH 0206
:JC =M011
:L FW 208
:A F 206.7
:JC =M017
:L FY 206
:SLW 12
:SRW 12
:I 1
:+F
M017 :I 1
:L FW 212
:><F
:L KH 0206
:JC =M011
:L FW 212
:T FW 208
:JU =M018
M011 :T FY 205
:L KH 0200
:<F
:JC =M013
:L FY 205
:L KH 0030
:!=F
:L KH 0080
:JC =M019
:L FY 205
:L KH 0031
:!=F
:L KH 0081
:JC =M019
:L KH 0082
M019 : DO FW 208
:T PY 0
:L FW 220
:T FW 210
:L FW 208
:I 1
:T FW 212
:L FY 205
:L KH 00F0
:<F
:JC =M018
M013 :***

As I know, FB159 is only called at certain times only. Am I right?
 
I think you are putting much effort into translating a piece of code that isn't usable in Step7.

Which cards are used in your rack(s) and what are their IO adresses? Which pheripery address is assigned in PERA?


Kalle
 
The name "COPY" does indicate it has to do with copying something, and the code seems to indicate that the copying dynamically adjust to what data type that is to be copied.
My guess is that it has to do with saving actual values for backup and restore purposes.

This thread shows the problem of attempting to migrate old S5 code without having the commented source. You can only migrate so much. You will reach stumpling blocks where it becomes guesswork to figure out what the old uncommented code does.

If it was my project, I would ditch the old code and start all over. I would determine what the machine or process does, and how I would want it to function. Then I would write a completely new program based on that. Have done it several times for small and big upgrade projects.
 
well a little googling brought up this link about S5 and panels over profibus.
it lists this blocks:
Windows-based operator panel:
FB158 -- Protocol processing
FB159 -- Copies data to/from the memory
DB58 -- Free DB, main memory for FB158 (free DB with 11 data words in length. This DB can be used by the user from the eleventh data word.)

Well like Jesper said, forget about these blocks. You can't use it anyway since your new HMI will be working differently.
 

Similar Topics

Hello everyone, can anyone help me with covert the STL code to ladder. Iam using plc s71200. A %DB1.DBX33.7 // angel of vaccum...
Replies
2
Views
231
Hello PLCs Forum, I am in a bit of a pickle and was hoping someone could offer me some help. I have a .rss file and just need to see the ladder...
Replies
2
Views
145
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
393
Hello, did anybody know, if there exist an converting cable like the1492-CM1746-M01 (for an 1746-IB16 to an 5069-IB16), for an 1746-HSCE to an...
Replies
3
Views
403
Hello, This will be my first time converting powerflex 40's and 400's from devicenet to ethernet. I did some research, and it seems I will need...
Replies
4
Views
790
Back
Top Bottom