Siemens S5 conversion to Logix5000

Melani

Member
Join Date
Nov 2017
Location
Jakarta
Posts
2
Hello.
I am Melani. I working on to convert Siemes S5 code to Logix5000.
Following is FB that need to convert it.

Segment 1
Name :John

0005 :C DB 210
0006 :L FW 40
0007 :T DW 2
0008 :L DW 6
0009 :T DW 1
000A M001 :L KB 0
000B :DO DW 1
000C :T FW 0
000D :L DW 1
000E :L KB 2
000F :+F
0010 :T DW 1
0011 :L DW 8
0012 :<F
0013 :JC =M001
0014 :L DW 2
0015 :T FW 40
0016 :C DB 150
0017 :L KB 0
0018 :T DW 1
0019 :T DW 2
001A :T DW 3
001B :***

How to convert this code to Logix5000 either structure text or ladder logic?
Thank you if anyone can help me to convert it.
Thank you.
Melani
 
0005 :C DB 210 - open DB 210
0006 :L FW 40 - Load FW 40 into ACCU1
0007 :T DW 2 - Transfer from ACCU1 to DW 2 (in DB 210)
0008 :L DW 6 - Load DW 6 (from DB 210) into ACCU1
0009 :T DW 1 - Transfer from ACCU1 to DW 1 (in DB 210)
000A M001 :L KB 0 - Load Byte constant 0 into ACCU1
000B :DO DW 1 -
000C :T FW 0 - Transfer the contents of ACCU1 (KB 0) to the address pointed to the FW address in DW 1
000D :L DW 1 - Load DW 1 into ACCU1
000E :L KB 2 - Load byte value of 2 in to ACCU1 (DW moves over to ACCU2)
000F :+F - add ACCU1 and ACCU2, store the value in ACCU1 (DW1 + 2)
0010 :T DW 1 - transfer the result from ACCU1 to DW 1
0011 :L DW 8 - Load DW 8 into ACCU1 result of addition goes to ACCU2
0012 :<F - check for ACCU1 < ACCU2
0013 :JC =M001 - jump to label M001 if above statement is true
0014 :L DW 2 - Load DW 2 (from DB 210) into ACCU1
0015 :T FW 40 - Transfer from ACCU1 to FW 40
0016 :C DB 150 - Open DB 150
0017 :L KB 0 - Load 0
0018 :T DW 1 - transfer to DW 1
0019 :T DW 2 - transfer to DW 2
001A :T DW 3 - transfer to DW 3
001B :***

Basically, this is zeroing FW words from the number stored in DB210.DW6 to the number stored in DB210.DW8 - also zeroes DB150.DW1, 2 and 3.
 
Hello SigmaDelta,
Thank you for your great help that make me understand it.
Could you please explain the following block? This is last one in my question and will make me understand it.

Segment 1
Name :DJ11.

0005 :C DB 13
0006 :***


Segment 2
0007 :L DD 51
0008 :T DD 68
0009 :L KG +0000000+00
000C :>=G
000D :JC =M001
000E :L KG -1000000+01
0011 :L DD 51
0012 :XG
0013 :T DD 51
0014 M001 :L DD 51
0015 :L DD 53
0016 ::G
0017 :T DD 55
0018 :L DD 57
0019 :XG
001A :T DD 59
001B :L KG +5000000+00
001E :+G
001F :GFD
0020 :T DW 61
0021 :L DD 55
0022 :L KG +5000000-01
0025 :+G
0026 :GFD
0027 :T DW 66
0028 :L DW 62
0029 :XF
002A :T DW 63
002B :L DW 61
002C :L DW 63
002D :-F
002E :T DW 64
002F :***


Segment 3
0030 :A D 64.0
0032 := Q 18.3
0033 :A D 64.1
0035 := Q 18.2
0036 :A D 64.2
0038 := Q 18.1
0039 :A D 64.3
003B := Q 18.0
003C :***

Thank you
 
Segment 1
Name J11.

0005 :C DB 13 - open DB13
0006 :***


Segment 2
0007 :L DD 51 - load DD51 into ACCU1 (data double-word 51)
0008 :T DD 68 - Transfer ACCU1 to DD68
0009 :L KG +0000000+00 - load KG 0.0 (floating-point value 0.0) into ACCU1 (DD51 moves to ACCU2)
000C :>=G - check ACCU2 >= ACCU1 (DD51 > 0.0)
000D :JC =M001 - jump to M001 if true
000E :L KG -1000000+01 - load float -10000000.0 into ACCU1
0011 :L DD 51 - load DD51 into ACCU1 (-10000000.0 moves to ACCU2)
0012 :XG - multiply floating point ACCU2 x ACCU2
0013 :T DD 51 - transfer to DD51
0014 M001 :L DD 51
0015 :L DD 53
0016 ::G - divide floating point ACCU2 / ACCU1
0017 :T DD 55
0018 :L DD 57
0019 :XG
001A :T DD 59
001B :L KG +5000000+00
001E :+G
001F :GFD - convert floating point to fixed point double integer (32-bits)
0020 :T DW 61
0021 :L DD 55
0022 :L KG +5000000-01
0025 :+G
0026 :GFD
0027 :T DW 66
0028 :L DW 62
0029 :XF - multiply integer (16-bits)
002A :T DW 63
002B :L DW 61
002C :L DW 63
002D :-F - subtract ACCU2 - ACCU1 (DW61 - DW63)
002E :T DW 64
002F :***


Segment 3
0030 :A D 64.0 - AND D 64.0 (like NO contact)
0032 := Q 18.3 - output coil Q18.3
0033 :A D 64.1
0035 := Q 18.2
0036 :A D 64.2
0038 := Q 18.1
0039 :A D 64.3
003B := Q 18.0
003C :***
 

Similar Topics

Anyone know how I can convert DTL to DATE type? This rung is trying to determine if the system is in calibration by subtracting the current date...
Replies
1
Views
585
I have converted a Siemens OP7 program to a new Delta DOP107BV. It is all working as expected except for the timer values. I am using MW36 as the...
Replies
6
Views
946
I have a nice project in Visilogic that I have been asked to re-create in Tiaportal/Siemens. (Bosses / maintenance want to standardise on one...
Replies
2
Views
1,312
Hi All, I'd like to inquire about the possibility of converting a program currently used on Delta PLC to be compatible with Siemens PLC using...
Replies
5
Views
1,425
When i try to migrate an old WinCC program in Siemens TIA V16, i get the following error: Migration failed because the project was created with a...
Replies
3
Views
6,144
Back
Top Bottom