My 1st Siemens question

hannaby

Member
Join Date
Apr 2009
Location
Durham
Posts
6
Hi guys, new to the forum.

I've been tasked with a project at my new job to get a machine up and running that hasn't ran for 2 years!

At the minute i'm trying to figure out the code but we had no up to date backup's so I simply uploaded code to laptop.
BTW it is a S7-300 PLC.
Now i've found all the code is in STL. I have since found some old drawings and an old copy of previously saved code (which is different to what is in PLC now!), this was useful though as it was commented and I transferred comments across. This then led to a problem that most comments were Italian!!!

At present I'm trying to convert the STL to LAD (reason for this being I was brought up on Omron and have only used S7 in LAD or FBD)

I would just like someone to confirm this change from STL to LAD i have done is correct:

ORIGINAL LAD CODE -

A I11.0
O M74.1
A M66.0
A I11.1
AN M70.0
= M74.0


When i have completed what i think is equivalent code in LAD it looks like this (sorry i'm unsure how to paste LAD on here so i have done a back to STL view of my LAD)

A(
O I11.0
O M74.0
)
A M66.0
A I11.1
AN M70.0
= M74.0

Could anyone confirm/deny if i am correct as I don't want to continue if i have got the basic grasp of STL yet!

Thanks
 
Hey hannaby

Welcome to the forums, what type of machine is it ? converting back to ladder in S7 sometines works by changing the view but more often than not does,nt. Does it look like a large programme with lots of FB,s etc ?

John
 
Thanks for replies guys.

I am ok in the principal of Siemens but this is just a massiv ebunch of STL which needs splitting into networks to format into LAD (i think).
i was just double checking I started on the correct route with the basic bit logic before I got stuck into some of the otehr stuff.
There is a bit of maths in the program in STL, is there no way to convert some sort of ladder at all to do the same job?

The machine is a flatting machine with a main drive, height drive and table position drive. There isn't a great deal of I/O, mainly switches and buttons but there is some analogue for the position of drives etc. and calc's that must be worked out for heights to be driven in.

The program structure is pretty much loads of FC's (about 20) and them some locked FC's which are called for various functions (which i can't figure out due to Italian comments!).
I can prob's attach a copy of prof on here if you wish to have a look.

Cheers
 
Also one big problem I'm having is on the protyected FC's that are called to do a function. One of them has a RESET flag which has a value of FALSE in STL format.
When I call the FC in LAd and try and use FALSE as an I/P it won't let me (stays red saying BOOL vlaue req.).
For this should I just use an ALWAYS OFF?
 
Yes, use always off.

Not wishing to overcomplicate your task, but, you may unravel a whole host of subtle coding errors by converting calls done in stl to calls done in ladder.
 
Hi mate

I,d second what LD has to say, coverting from stl to ladder can open up a big can of worms, I have the same problem as you with comments, I work for a spanish company that buy in spanish produced manufacturing cells, all the programmes and attached comments come in spanish and they are huge programmes to ! The only way I have found to convert the comments is google the comment and change it manually, quiet time consuming but well worth the effort when comming to fault finding etc. Even better if you have a apprentice get him to do it :ROFLMAO:

Did the M/c run 2 years ago ? and what has changed in the meantime ? Have you tried to run it at all ? more often than not i,ve found in your situation somebody has borrowed a part or sensor from the m/c, not replaced it and ended up with something that won,t run... only to blame the programme.

my personal opinion would be to try get it running with the current prog and then in your own time write a new programme in ladder, this all depends upon the time constraints etc placed upon you though.

Feel free to mail your prog and i,ll have a quick look over it for you.

Regards

John
 
John

I spent first 2 days of the week trying to translate comments. Absolute nightmare!!!!

I'm new to the company so I've been getting mixed reports on whether the machine worked! It did fail in a mechanical capacity and at present we've had to rebuild the gearbox. I am now waiting 8 weeks for a torque limiter to come so I can fit that to the main drive to offer better protection.
In the mean time I am trying to decipher the code so I have a working knowledge of the machine before it is rebuilt mechanically.

I would like to get it into LAD so I can understand it better myself and feel I am in a no lose situation if this doesn't work as I have the backup of what is in there currently.

What I have found with the machine is that it may be over complicated for what it needs to be and hopefully I can get rid of a lot of the code and creat some of my own blcok calls which will make it easier for our maintennace lads to follow as none of them can read STL at all!
 
Here's an example of what can happen when using ladder calls and stl calls. As you can see, with the ladder call to FC1, M0.0=0 after the call, but when FC1 is called using stl, M0.0=1 after the call ! (Please allow for my artistic licence in the image)

ladstl009.jpg
 
Some of the protected blocks may be standart Siemens blocks, for instance,FC105/106 in English "Scale" and "Unscale" used to convert analogue inputs and outputs into engineering units.
 

Similar Topics

Hi, Can any of Siemens PLC expert please tell me; 1) Can we ever detect the first scan of the Siemen PLC whenever it RUN (either due to power...
Replies
3
Views
5,589
As far as I know the UKCA mark is mandatory from 2023, and that is 9 months from now. That is not a lot of time to investigate, design, validate...
Replies
22
Views
4,734
Hi All, I cannot seem to find a way to move a Boolean from an Arrays UDT into a DINT. I have an Array of 32 elements with a UDT data type of 4...
Replies
3
Views
1,739
Stupid question i know but i know i have seen this done before and yet i cant get it to work For the preset value of a TON I want to use a tag...
Replies
3
Views
1,816
Hey guys, I need help calculating first Monday of the month. Has anyone ever had to perform such calculation? Rockwell has UFDB that calculates...
Replies
10
Views
2,688
Back
Top Bottom