Siemens PLC programming

acrosteve

Member
Join Date
May 2015
Location
Ohio
Posts
5
Hello,

So, I am working on improving my PLC knowledge at my new employer.
We have well over 25 Siemens brains, Each with at least one HMI and all interconnected via ethernet.
Most are Simatic 545 with many different combinations of I/O cards
Each PC in the plant has the ability to monitor and whole process, ack alarms and change variables and parameters.
So it is quite the installation, and I my previous experience has been limited to stand alone Micrologix PLC's many years ago.

I am trying to take small portions of the source codes to get a handle on the basics of the programming structure.

For example this is just a portion of the code that controls one of the Wheelbrators...

*** DISCHARGE CONVEYOR ***

Y 149 RELAY DISCHARGE BELT FWD
Y 150 RELAY DISCHARGE BELT REV

1407 STR NOT Y 150 DISCHARGE CONV REV
1408 STR NOT Y 150 DISCHARGE CONV REV
1409 TMR 115 DELAY AFTER RUNNING IN REVERSE
1410 P=4
1411 OUT C 511

1412 STR X 7 PB START DISCHARGE CONV FWD
1413 OR Y 149 HOLDING CONTACT
1414 AND X 2 EMERG STOP
1415 AND X 9 PB NC STOP DISCHARGE BELT
1416 AND NOT C 297 (1) EMERGENCY STOP
1417 AND NOT C 298 (2) INCLINE CONVEYOR NOT RUNNING
1418 AND NOT C 321 (25) I-SW SAYS DISCHARGE BELT NOT RUNNING
1419 AND C 511
1420 OUT Y 149 DISCHARGE CONV FWD

1421 STR NOT Y 149 DISCHARGE CONV FWD
1422 STR NOT Y 149 DISCHARGE CONV FWD
1423 TMR 116 DELAY AFTER RUNNING FORWARD
1424 P=4
1425 OUT C 511

1426 STR X 8 PB STAART DISCHARGE CONV REV
1427 OR Y 150 HOLDING CONTACT
1428 AND X 9 PB NC STOP DISCHARGE CONV
1429 AND NOT C 297 (1) EMERGENCY STOP
1430 AND NOT C 321 (25) I-SW SAYS DISCHARGE BELT NOT RUNNING
1431 AND C 511a
1432 OUT Y 150 DISCHARGE CONV REV


I do have some support locally, but sometimes I retain it better if I put the effort into my own research.

That code had been "compiled" thus the sequential line numbers. What language is that code written in, and are there any good training facilities?

In the example above, there are 4 groups of code, do each of those have a name? "Block" perhaps?

What does STR stand for?

The C 511 output seems to be a dumping location that is used throughtout all of the programs here.
Is that line just required to complete the systax of the commands? But, it is referenced in two of the other blocks, so, what is it?

In the 1st block, is there a reason the Y 150 output is checked twice?
What is the P=4?

Correct me if I am worng, In the 2nd block. It checks for the FW PB or holding contacts, and then checks the
condition of the EStop and Stop PB. Then it checks to see if the other two conveyors are running, then it will
enable the FWD output.
What is the reason for the AND NOT C 297 ESTOP?


Thanks
 
It's programming in ladder logic - you're looking at the symbolic version of the ladder.

The 4 groups are actually 'rungs' of ladder logic - each one being a collection of inputs (usually) and ending in an output (or similar).

STR stands for SToRe - It begins a chunk of code. In these relatively simple rungs, it starts a rung. So, the code:
1407 STR NOT Y 150 DISCHARGE CONV REV
1408 STR NOT Y 150 DISCHARGE CONV REV
1409 TMR 115 DELAY AFTER RUNNING IN REVERSE
1410 P=4
1411 OUT C 511
looks like this in ladder:

Y150 Y150 TMR115 C511
-[/]--[/]--+------+-------( )--
| P=4 |
+------+


The thing that I am unsure about is the double STR Y150. Usually, this wouldn't be done this way and why it's a repeat, I don't know.
 
So, the C115 is a temporary internal coil that is examined in the next rung. Sometimes done this way to prevent overly complicated rungs. Any Cxx coil could have been used.

P=4 is the timer / counter preset value.

AND NOT C 297 ESTOP looks like this in ladder:

C 297
-------[/]----


and in this case basically says this rung could be solved true UNLESS C297 is actuated in which case the contact would open, preventing power flow to the remainder of the rung.
 
it's programming in ladder logic - you're looking at the symbolic version of the ladder.

The 4 groups are actually 'rungs' of ladder logic - each one being a collection of inputs (usually) and ending in an output (or similar).

Str stands for store - it begins a chunk of code. In these relatively simple rungs, it starts a rung. So, the code:
1407 str not y 150 discharge conv rev
1408 str not y 150 discharge conv rev
1409 tmr 115 delay after running in reverse
1410 p=4
1411 out c 511
looks like this in ladder:

y150 y150 tmr115 c511
-[/]--[/]--+------+-------( )--
| p=4 |
+------+


the thing that i am unsure about is the double str y150. Usually, this wouldn't be done this way and why it's a repeat, i don't know.

I was thinking the ladder would look more like this. No?

y150 y150 tmr115 c511
-[/]--[/]--+-------------( )--
| p=4 |
+------+

 
It's supposed to look like this:

Y150 Y150 TMR115 C511
-[/]--[/]--+------+-------( )--
| P=4 |
+------+


I went to the Advanced editor and wrapped the ladder with the tags and even previewed it and it was fine - hope this looks better ...

edit - it didn't - I think someone said not to preview it?
 
Just to throw my 2 cents worth in. Tisoft timers have an enable input and a start input. The not Y150 is used as both the enable and the start in this case. The preset value of the timer is 0.4 of a second.

Regards,
Barry.

tisoft.JPG
 
Do they have a copy of TISOFT? It will be much easier to support their equipment with either WorkShop or TISOFT.
I got a little more up to speed on this today.

The driving force behind the PLC proliferation in these plants is the 72 year old owner. Believe it or not, he does most off the code and screen design for all of the plants. He is based at plant in another city and can see any plant from his office or home. I meet with him weekly. last week, he was checking my knowledge of grounded leg delta systems like what is used at our plant. So our discussions where limited to various 480v distribution topics and also the induction furnace we have. This week we discussed the PLC systems, so many of my basic questions where answered today. But I have much more to learn.

Beyond that, my boss is the local PLC guy and quite smart himself, and I was hired to grow into his backup.

Due to the complexity of the complete installation, 95% of the code is written in the language I provided the example from. Ladder logic is mostly limited to some slight live changes done to the system.

The system instruction set is based on the TI 505 that Siemens took over from Texas Instruments, but all the hardware is either Siemens or CTI(Control Technology Inc)

The STR command starts every "rung", and the code structure is such that columns 6-17 are the actual instruction, if the very 1st column is a number. 1st 5 columns are numbers for reference only. The "compiler" will correct the line numbers later - after any changes have been made. If the 1st character is not a number, the line is treated as a comment. Any characters after 17 are also treated as comments.
 
No problem acrosteve. I just thought you would be much better off getting a copy of TISOFT up and running or talking them into purchasing WorkShop than bothering to learn the "instruction list style"? of programming. As said before, It would be much easier for most people to add, modify, or troubleshoot the code using the easier to follow ladder programming. As barryoc posted, it's obvious that the timer has two inputs with the graphical representation, not so much with the instruction list.

Assuming you have a laptop for work...

I think TISOFT is free now. There is an easy to find link on Siemens' site. I'm guessing you could run it in a Windows XP VM. If I remember correctly, it ran fine under XP in a DOS window.
 

Similar Topics

Hi, There's a problem I face with upgrading the OS from XP which has the Step 7 Lite installed to windows 10. As I can't use a cracked version of...
Replies
2
Views
610
Hi there, I have three pumps, I have to start first pump for 8 minute and after that it should be turned off and other one start simultaneously...
Replies
11
Views
1,833
Hi Sir, I am using S7-300/400. I am usually using FC 03 and FC04 to transfer (R/W) bool values by moving them DBs. However i want to R/W bool...
Replies
1
Views
2,053
Hello, Maybe topic does not describe the best what do I want but I will try to explain it now. I'll post this to HARDWARE and SOFTWARE section...
Replies
4
Views
2,484
I have an opportunity to quote an HMI project for one of my customers. It's a small project, and the customer is not the type with deep pockets...
Replies
3
Views
24,818
Back
Top Bottom