Siemens Step7 bit search

Guest

Guest
G
Hi Folks: I'm new to these online Q&A things, So please excuse my misspellings and use or lack of use of punctuation{or mispuncuation as the case may be} Anyway here goes.. I'm an instumentation tech in a textile mill. Most of the PLCs we have in our plant are Allen Bradley SLC500s and PLC5s.I am fairly comfortable with RS logix 5 and 500. Recently we got some new equipment with Siemens PLCs. I've been working at home with a copy of the Step 7 software without the authorization {nag screen but good enough to learn on} Now to my question. How pray tell do you search for a bit? If I look at my machine prints and identify an output I want to find in the logic how do I search for it? Sorry I am so long winded here I just want to make sure everybody understands what I want to know. Thanks in advance ...ToddM
 
Todd, depending on the approach the original programmer took, you may or may not find the individual output bits addressed directly (I haven't used direct addressing for ten years). But if it is a fairly simple application, you might be in luck.

From the Simatic Manager, highlight "Blocks", right-click, and select Cross Reference/Display. Once you have the Cross Reference up, you can select a filter and look at any data type you want (Inputs. Timers, Functions, etc). There are other ways to do this, but this should get you started.
 
Step7 doesn't have a global search like you are used to with the AB products. However, the cross-reference works pretty slick. One nice thing with the cross-reference is if you double-left-click a cross-reference entry Step7 will take you directly to that reference. So you can still find stuff pretty quick.

Keith
 
Another way is to open a block that has some absolute addresses in it, right click on an address, and open the "Go To Location" window. From there, you can enter any address you want, and is a short cut from opening the cross reference window. The disadvantage is that the "Go To Location" option doesn't show up on indirect addresses.
 
Different thread direction - sorry

Apologies for hijacking a thread.
S7Guy. Why do you indirectly address everything? Not meant as a criticism at all, just interested in your reasoning and if I could 'adopt'. Thanks
pp
 
Last edited:
Paraffin

I think (I hope) that S7Guy means 'absolute' addressing rather than direct addressing. In other words he programs with symbolic names rathen than memory identifiers like M10.0 and DB23.DBX22.4 His second post uses the word absolute and I'm assuming the use of direct in the first post was just a fip of the slingers.

Absolute and Symbolic are opposites
Direct and Indirect are opposites

But you can have absolute direct addressing or absolute indirect addressing etc.


Ken
 
I'll try to explain myself a little better.

Most of the systems I have programmed have been configurable, i.e. there are no two alike. But, I like to keep my code completely generic so that I don't have specific code for each site. And, I always program with symbolic priority so that I don't have to care what the absolute addresses of any data bits are (if I have to insert a new variable in a UDT, it just moves the other variables down and uses the new addresses after I recompile).

Also, I prefer to call my FBs unconditionally without an instance DB or input parameters. I just define a UDT as the stat variable, and manipulate AR2 dynamically so that I point to the correct bits. Then, if I had a machine with 20 similar components on it (perhaps 20 conveyors with motors and drives), I could just create a single shared DB with an array of the 20 components and loop through them. This makes it nice for troubleshooting and development, because I don't have to open VAT tables or maintain a bunch of instance DBs.

So, technically, very little of what I do can be referenced through the cross reference list. Even the timers are assigned dynamically in the startup block, because I don't want to worry later if they have already been used or not. The physical IO bits are mapped to data bits, and I manipulate the data bits in my code, and transfer the results to the output card at the end of OB1 (again, based on the configuration). Ultimately, I end up with nice clean code that is very easy to maintain and can be reused over and over without making any changes whatsoever.

Of course, sometimes a person just has to be able to cross-reference a variable. Since the cross reference list is useless in my case, this is what I do: I open a block, click FILE, and choose Generate Source. I select all of the FCs and FBs, and it generates a text file of all of the code. I can then open this file with the block editor and do a search on any variable. Once you are used to it, troubleshooting is a cinch.
 
Thanks again, But...

Thanks again for the help but... Ya kind of lost me a little bit S7guy. I poked around with the cross reference a little bit tonight and I think with a little practice I can work with it. The thing you lost me on is the direct addressing and indirect addressing. I don't mean to be stupid or anything but could you give me some sort of example of what you mean. Please remember I am looking at this from a troubleshooters point of view and not someone who writes a lot of PLC code {I have written some simple projects with RS logix and altered some programs but not to the extent you obviously have} Wait a minuite. I just went back and reresd the posts from Paraffin and Ken M so now I'm really confused. Where did all this "absolute" stuff come in? I thought that was vodka or something. Please set me straight if you can. {a RS logix comparison would be cool if thats possible} Thanks for your help and paitence...ToddM
 
Last edited:
Todd

We love to make life difficult for ourselves, don't we!

We've got four terms here : absolute, symbolic, direct, indirect. My use of these means :

Absolute : a reference to a memory location within the PLC made using the manufacture's own designation for that memory. In S7 this could be IW200, M23.2, DB49.DBD16 etc. These addresses identify the location and size (bit, byte, word etc) of the the memory being referenced, but nothing more.

Symbolic : a reference to a memory location within the PLC using an alias or synonym assigned by the user. Examples here could be "WaterLevel", "DirnIndicator", "AV1037" etc. Somewhere in the PLC programming software there will have to be a table of some sort relating each of these symbolic names to an absolute address.

Direct : a reference to a memory location within the PLC where it is explictly identified during editing and will not change dynamically at runtime. For example -

Code:
A I0.0
A I0.1
= Q12.0

Every time this section of code is executed it will read the same two inputs and control the same output. The example I've shown is direct absolute addressing. I could equally have shown a direct symbolic example.

Indirect : a reference to a memory location in the PLC which is not itself used in the code, but acts as a pointer or holder for the 'true' address to be used at runtime. This can be changed under control of the program at runtime. For example -

Code:
A I[AR1,P#0.0]
A I[AR1,P#2.4]
= Q[AR1, P#20.6]

Here the actual inputs and output used could vary each cycle according to the contents of Address Register 1 (AR1). The user can control this through the program. Although the example shows a fixed offset between the addresses used (the P#...) these could also be variable at runtime.

Finally, one type of addressing that hasn't been mentioned previously is -

Indexed : a reference to a memory location in the PLC where the memory area is fixed at editing, but the address within that area can be modified at runtime. It is usually applied to arrays of data but is not (IMO) well supported in standard STEP7 languages STL, LAD or FBD. It really comes in to its own in Structured Text (SCL). For example, let's say we have an array of product codes in a warehouse stacking system where there are three things that identify the location of the product: the aisle, the column and the shelf. You can define an array symbolically named "Location" with these 3 as indices and then address it as -

Code:
PCode := Location[Aisle, Column, Shelf];

You can manipulate the contents of the symbolic indices to read/write the product code required. Unfortunately STL etc only permits the use of literal values as indices. In other words -

Code:
L Location[3,12,6]
T "PCode"

.. which is no earthly use!

The vast majority of PLC programs I've seen use direct addressing for most tasks, with indirect used where necessary for specific tasks. S7Guy's approach, while perfectly valid and obviously giving him plenty of benefits he values, is not the norm. You can only weigh up the pros and cons of all these methods and decide for yourself. What effect do they have at the design stage, the coding stage, the testing, commissioning, maintenance stages, the eventual upgrade or modifications which will be made etc?

Well, just a handful more beans thrown in to the cooking pot!

Ken.
 
Ahhh!!!

Yep Ken, it all makes perfect sense now. I tend to directly address everything symbolically. The only time I have used indirect addressing was in FBs where I was comparing values, text, etc. stored in a data block using a loop.EG An operator types in a recipe code, number, etc. and the program ran through the loop until it finds a match with a value in a data block. It then knows which value (bulk density, colour, whatever)to output as both sets of values are indirectly addressed with the same AR1 value in each cycle of the loop.It sounds as though your SCL example of indexed addrerssing might have been even better but I ain't got that package. Might have to try some subterfuge to persuade the brass to let me buy it.
 
Ken, the only think I might add is that symbolic addressing can be direct as well. So, even if the priority is set to symbolic, the absolute addresses will still show up in the cross-reference list.

Btw, now I'm curious about how others approach problems. Let's say you are programming a material handling system which consists of a grid of conveyors and elevators. Not only can the conveyor system layout change from day to day, but can be completely different from site to site (with new hardware requirements). Do you write new code with each site? What I have done in my code is write it such that I don't care how many IO points are out there (or what their addresses are), so that I could use the same code no matter what. All it requires is a techie to set up the configuration from a GUI (a one time thing). I just did a project that consisted of six different systems within a single factory, each of them very different, but I ultimately ended up with one code set for everything; it sure makes code updates simple, since everything is running the same code.

And Todd, good luck. I see where you are coming from, and everyone here is great about helping. Sometimes you'll get more info than you would ever need, but that's the nature of the beast here.
 
Kinda sorta??

Well I kinda sorta understand . This will take some getting used to, But I guess thats what it's all about anyway. What you are used to in the beginning. I've worked with the old Icom software for PLC5's and the Allen Bradley 6200 software and the GE Fanuc 90 30 software in addition to the RS logix stuff, All of them are so simular it just makes the Siemens Step7 software seem so difficult. If I had started on the Siemens Step7 to begin with, all of that other stuff would probably boggle my mind. Anyway THANKS a lot guys.ToddM
 

Similar Topics

This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
182
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
163
I have a word in some DB which I want to load to AR1 and use as a pointer. In order to do this I need to write L DBxy.DBW xy SLD 3 LAR1 I...
Replies
3
Views
556
Hi, I received a Step7 Backup from my client and tried opening this backup but it won't open as there seems to be files missing from the backup...
Replies
11
Views
3,055
Hi! i'm just wondering did there is any chance to change Set Time(TV) on Siemens plc timer without step 7 using c# or python if timer not set in...
Replies
1
Views
1,265
Back
Top Bottom