S5 to S7 conversion question

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all,
I'm trying to convert an old S5 program to S7 and (as much as I can) convert it to Ladder too.

I've come across the following code:
Code:
L FW 210
L KT 070.0
<=F
= F 8.4

I've translated this ok into STL in S7...
Code:
L MW 210
L S5T#700MS
<=I
= M 8.4

... but it won't go into ladder because the Less Than Equal To comparator only wants an INT type and doesn't like S5Time ?

Any ideas what the equivalent is in ladder of this code?

** EDIT **

I've just come across another part of the code that won't translate...
L C 4
L 0
==I
= F 243.5

In S7 the C address is just 'on' or 'off' (on if the counter is equal to anything other than 0). In S5, does the C address actually hold the counter value??


Many thanks for any light you can shed on this.

Cheers

;-)
 
Last edited:
Either use a move then the compare, or temporarily replace the s5time variable with a valid int, view in ladder, switch back to STL and replace the int with the s5time required. then switch back to ladder view.

s5t.JPG
 
Hi,
I tried to temporarily replace the S5T with a valid int (MW220) which converted to ladder fine. I then converted it to STL and replaced it with S5T#700MS and it still won't convert to Ladder ?

I can see that you have it working in your example but it doesn't work on my software (Step 7 v5.5 revision level v5.5.0.0) ?

I don't really want to use the variable declaration table to do it (although that really is a very eloquent solution) as it will confuse some of the people who will have to work on this.

Any ideas why the STL to LAD trick isn't working on my machine but works fine on yours?

Cheers

;-)
 
Brilliant stuff! That was the problem.

I've edited the original question because there's now another small issue with a Counter. I'm not sure if you have any ideas about that but any help would be greatly appreciated.

Thanks again for all your help

;-)
 
Do you mean it will not display in ladder? you will have to use the move method. Loading a counter loads the current count.

cou.JPG
 
Last edited:
Thanks for the info.

I was actually questioning the code as I thought that a "C" address was only boolean. I didn't realise that if you Loaded it then you were putting the counter value into the Accumulator.

Many thanks again for all your help and advice.

Cheers

;-)
 

Similar Topics

Hello all. After performing an PLC5 to CLX conversion (second time), all went well. On the surface, it appears that my PID's converted kinda sorta...
Replies
2
Views
1,893
Hello, I recently converted a control system from PLC-5 to ControLogix and have a question please. My discrete IO converted kind of weird and I...
Replies
2
Views
1,525
Hello I am looking into converting several SLC racks to CompactLogix using the 1747-AENTR module. These racks are currently RIO for a PLC5 in a...
Replies
7
Views
2,524
So I have a problem. When trying to open one the projects that was in one of our HMIs to edit it, I get an error thrown up at me saying I need to...
Replies
6
Views
2,204
Hey folks, I have a (kind of, but not a true) random number generator that generates a number from 1 to 500. When I press a button it stores that...
Replies
18
Views
3,985
Back
Top Bottom