Sign in to follow this  
Followers 0
Noely

Siemens Vs Allen Bradley

28 posts in this topic

My background is in embedded microcontrollers and real-time programming on X86 PCs (I've only recently been dragged -- kicking in screaming most of the way -- into PLCs). I can tell you that 32-bit boundaries for variables are not something out of the ordinary and that many compilers will default to that... why... because it produces more efficient code. The boundaries are often times linked to the processor, so a 32-bit processor will want to place variables at 32-bit boundaries. I'm not sure exactly what is happening in AB processors (never really had cause to look) but in Siemens you see variables are pushed into byte (or bit) boundaries governed by their size. This too, is fairly normal. So if you have a DB defined with bX : BOOL i32X : DINT You will "waste" 31 bits of memory. The 32 bit DINT will be addressed at offset 32, rather than 0.1 (or even 8 or 16). This produces more efficient code. Although a lot of people may think that packing bits into a word or double word is more efficient, think of what the CPU has to do in order to use that memory. It has to mask that bit out of the word, and then do logic. If all bits were at 32-bit boundaries, this intermediate step wouldn't be necessary. So it could theoretically result in more efficient (and therefore faster running) code. Of course I am not entirely sure which CPUs Siemens and PLCs are using, but I would probably think they are configuring memory in order to be more effieicent with their processors. So just comparing how memory is utitlized is probably not a good indication of the strength of the processor. That's all a bit off-topic, of course. I have used both AB and Siemens PLCs. Both are good overall. As a software engineer I think S7 is a great tool, although the interface is fairly cumbersome... which is pretty pathetic really since this is not something that just came out yesterday. We have a joke in the office... S7 takes you at least seven steps to do anything. BTW... if anyone can make my S7 work a bit easier. I really miss a feature that I've had all my life... in embedded c/c++ as well as AB... which is the full symbol cross reference. If I am in a SLC program and want to look up where else a variable may be used, my only way to search for it is to copy the symbol, open a VAT and print it and get the full address (e.g. DB4:DBD104) then open a ladder program, choose the Go-To function and print the address (see what I mean about the seven steps?). The thing where a VAT can interpret the full symbol, and the Go-To cannot... and the Go-To command can be found in the ladder editor, but not in the SCL led to another joke in the office. S7 is only 70% complete.

Share this post


Link to post
Share on other sites
Hi Steve. Yes, your comments about the data being grouped so that some memory is actually not utilised are correct. However, for S7 the boundaries are at every 16 bit, not 32 bit. Besides, I think avoiding the "waste" is becoming less and less important, since memory is becoming bountiful, at least when compared to the past. Your comments about the many steps in order to navigate symbolic and absolute adresses in SCL, and that you can only adress DB addresses absolutely when using the "go to", are also correct. I do exactly as you describe to find the addresses. I am afraid that STEP7 v5 will not be improved because all development is going into the new and revolutionary v10. Too bad, since I have a feeling that by just a little effort, Siemens could fix almost all of STEP7 v5's deficiencies.

Share this post


Link to post
Share on other sites
Thanks for the feedback. After having to do this 50 times a day I always think somebody has got to have a better way... but I never find that somebody. There are a lot of things I'd be a lot more forgiving with the IDE if it was v1.0.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0