Engineers Vs. "Joe Maintenance"

?????

Ladder is not deterministic. There is no way you can say that even an interrupt will execute every 10 milliseconds because interrupts are off during the house keeping part of the scan. This avoids read modify write problems but the result is that the interrupt will execute every 10 milliseconds + or - a bit.


There is no way that ladder running in the main scan is deterministic.
You mean deterministic timing.



Why do you think that ST has deterministic timing. If you have ST Routines/Subs in them main task then they would have the same problem as Ladder. Also this seems very hardware driving and could vary a lot between PLC Manufactures.


Do you have sources you can link to?
 
I don't believe this to be off-topic....I will just throw it out here and see how it lands. I had an electrician ask me if there is a document available that one could use ladder logic to decipher ST. I built an air flow test rig and I had to use ST, couldn't find a way around it (at the time). I started to create something for him however, haven't been back to it since. Does anyone know if such a document exists, where there would be a LD and ST that are the same project, that I could pass on to this gentleman? Thanks.
I think that would be a fools errand. While you can translate anything in ST to LD and LD to ST by hand at least. Because of nature of the languages if you were to write a version of a program in LD and another that does the same thing in ST your code will be structured differently and written to best use each language and make it easy to understand.

So if you do a literal conversion to ST from LD or a LD to ST, you are going to have a mess in the converted language that is pretty hard to follow.

My two cents.

Most importantly, no matter what language you write in DOCUMENT EVERYTHING POSSIBLE as time permits. Documentation is the third most important thing in PLC programming in my opinion only surpassed by 1. Never compromise safety, and 2. Of course have a functional program.
Personally I write code in all languages (except statement list... I hate assembly. Not my cup of tea) I use ST/SCL for complex looping, sorting, math, and some logic if its a super short program. I use LAD when there will be a lot of techs reading my code and understanding it. With that being said, I also try to break my AOIs and FBs into equipment dependent routines, and then tie it together in a control block. But I still use indirect addressing and I still try to make my code as user-friendly as it can be if I wont be the one looking at it.
As of late, I've been pumping out programs that only I look at because the stations I program for are not for an industrial environment. So I've programmed in whatever I have felt like.
I know many "Controls Engineers" that are scared of FBs, because they are to "Complicated". I think that translates in to "I don't understand something and I don't want to learn."


If you understand how to use FBs effectively they can actually simplify your code a lot. The problem is they don't understand and don't want to. Those are the guys that I call "Joe Maintenance"


Can't is a big word.
It isn't that it can't be done, it is just that no one is going to be foolish enough to try.
Correct just because you can do something doesn't mean you should.


ST in a state machine is more efficient.
I agree in theory, but that is because of nature of ST which makes it easier to write logic that executes smaller specific chunks of codes. You could accomplish the same thing in ladder but it would be a mess, which is pretty much what I said in reply to ceilingwalker at the beginning of this post.
 
You mean deterministic timing.



Why do you think that ST has deterministic timing. If you have ST Routines/Subs in them main task then they would have the same problem as Ladder. Also this seems very hardware driving and could vary a lot between PLC Manufactures.
If you run ST on a PLC then you are correct. Yes, hardware design makes a huge difference.


Do you have sources you can link to?
I can provide examples but it is basically the hardware design and operating system that makes ST deterministic. If you write ST like you write LD then ST would not be deterministic. Given that I think I could make LD deterministic if implemented inside a state machine on the same hardware. However LD is not the best language for formulas. Every block requires load values then storing them away for the next block. There is no optimizing whole formulas where only the final value is saved.
 
The problem is they don't understand and don't want to. Those are the guys that I call "Joe Maintenance"


And that right there is the crux of the problem. I know my Grandpa retired when computer training/usage went from optional to mandatory. Some people just don't wanna.


If the employer A) doesn't care or B) won't pay enough for better employees and C) is willing to pay enough extra for the programmer to spend the time dumbing the system down as much as possible, then I guess it falls under "the customer is always right".
 
I think that the argument about LD, FBD, ST & STL is getting a bit lost in the fog. First of all although in ladder to make it easy to translate into a graphical system you do have to use memory areas to store temps from rung to rung, however, in FBD You can link one function to another. Even in ST bracketed functions also work on each Set of "Brackets" individually and store in temp memory or registers. for example, Mitsubishi like many PLC's have fixed memory i.e. bits/words etc. and as the code sent to the plc is a set of instructions that the interpreter deciphers into it's machine code instructions the processor understands just like basic (I know there were some obscure PLC's that compiled it directly). Mitsubishi uses an area of the fixed memory as temps when using IEC (example would be Bits (M) 6000 > & words (D) 8000, these are assigned at compile time so there is no need to give it a physical address.I have done quite a lot in ST and when I looked at the instructions sent to the PLC they were just the same as STL, however, on many occasions a for next loop actually produced more lines of compiled instructions. I assume this will also apply to S7, however, I have not checked that yet. I cannot speak for RSL and some other PLC's but it is unlikely at this moment on time that these processors have different ways of interpreting the code i.e. one for ladder & one for ST. so a common interpreter is probably still the case and ST is just compiled into the same instructions. this has not changed even in high level languages so a for next loop still uses the processor registers & stacks to track the loop etc.
As for deterministic (these ones for Peter), the definition is as follows:
deterministic model. A mathematical model in which outcomes are precisely determined through known relationships among states and events, without any room for random variation. In such models, a given input will always produce the same output Is this not a PLC in ladder?
A State machine:
A state machine is a concept used in designing computer programs or digital logic. There are two types of state machines: finite and infinite-state machines. The former is comprised of a finite number of states, transitions, and actions that can be modeled with flow graphs, where the path of logic can be detected when conditions are met. The latter is not practically used. Is this not how ladder works?.
I agree that there is a lot of code that can be quickly written in ST compared to ladder however, when compiled into the interpreted code is basically the same, it is sort of transportable between PLC platforms (well nearly) and in time I think it will be the main language supported in process control. Rockwell are ahead in this field I believe by producing tags that are not tied to physical addresses (well as far as the programmer is concerned).
I'm sure all manufacturers will tow the line eventually.
 
Rockwell are ahead in this field I believe by producing tags that are not tied to physical addresses (well as far as the programmer is concerned).

Care to expand on this and why it's being "ahead"? Personally, I really dislike Rockwell's approach of having a list of variables instead of providing any way (even if only for visualization) to group variables (other than task variables which have downsides of their own). Other manufacturers have the same tag based approach and yet there are hierarchies that one can create to group data making it a lot easier on the eye.
 
I guess what I mean is the likes of Mitsubishi have fixed variables i.e. M, D
The way they get round this is to allocate them at compile time rather than have to create a symbols list with actual addresses. The downside of variables allocated at compile time is communication, for example in the old days it made sense to group variables together for communication to/from HMi's/Scada to reduce the number of read/writes, the trouble is with variables on the fly is that the physical addresses could be fragmented. with modern fast coms, this is not too much of an issue however. The CLX platform I guess was a new approach compared to the SLC plc2 etc. however Mitsubishi have not completely re-designed the hardware/software so it is almost backward compatible, I don't know about the later FX5, L etc. as these are pretty new and have not used them yet but to make ST compatible with the Q & older FX. Interestingly Siemens have been way ahead in the early days even the S5 had decent editor for function blocks, Data blocks & very powerful instruction set. there approach to program function & data was in no doubt in it's time way ahead.
Again, I have not used TIA although I have it but assume the S7 system has not changed radically from Step7, There must be some differences even in S7 plc versions as TIA cannot be used to program the older 400's as I found out to my cost. you can monitor but not download presumably due to changes in the interpreter used in the later models (or maybe a ruse to make you upgrade your hardware lol).
Many years ago I worked with a major company that designed their own PLC system, in it's time was way ahead of any other I came across, it was programmed in a type of FBD basically you dropped a function into the editor and dragged lines to connect them this was way before IEC, initially I found it a bit confusing but soon came to like it, as far as I know, they did not market it just used it in their own systems and I had little time on learning it as my job was the Scada system (AFE in Dos so shows you how long ago it was).
 
Care to expand on this and why it's being "ahead"? Personally, I really dislike Rockwell's approach of having a list of variables instead of providing any way (even if only for visualization) to group variables (other than task variables which have downsides of their own). Other manufacturers have the same tag based approach and yet there are hierarchies that one can create to group data making it a lot easier on the eye.


I'm mostly an S7 guy, but I've seen user data types used a ton in the Rockwell world for grouping (or types within types, for hierarchies).



Again, I have not used TIA although I have it but assume the S7 system has not changed radically from Step7, There must be some differences even in S7 plc versions as TIA cannot be used to program the older 400's as I found out to my cost. you can monitor but not download presumably due to changes in the interpreter used in the later models (or maybe a ruse to make you upgrade your hardware lol).


The newer S7 PLCs are largely similar to the old ones, but the new style programming is all symbolic. You don't reference DB5.DBW4, you reference "MyDB.MyTag". You know that MyDB is DB5, but the system doesn't give you addresses at all for the tags in the DB. Obviously they exist at some level, but the compiler takes care of it in the background.



Also, the new TIA software can't program 400H systems, but it can absolutely program regular 400's. You need to migrate the project forward, though, before you get full online capabilities.
 
I don't understand the comment saying Rockwell can't group. If anything, that is one of the things I like most about RS Logix - I can group all of my bits together!

I believe TIA portal does the same thing.
 
I'm mostly an S7 guy, but I've seen user data types used a ton in the Rockwell world for grouping (or types within types, for hierarchies).

What is easiest, add another UDT inside a DB or modify a UDT which isn't quite easy if the data has been instanced in Rockwell last I checked?
You know that MyDB is DB5, but the system doesn't give you addresses at all for the tags in the DB.
Unless you disable optimized mode, which is how many comms drivers still require to speak with the new CPUs.

I don't understand the comment saying Rockwell can't group.
You can group, but the high level "group" is a data type. With Siemens, the upper level is a DB that you can add or remove variables from without impacting any other DB. It's simply a matter of flexibility.
I'd be happy if Rockwell implemented the folder capability to keep tags inside folders for example.

Or maybe I'm just too much OCD.
 
What is easiest, add another UDT inside a DB or modify a UDT which isn't quite easy if the data has been instanced in Rockwell last I checked?
Modifying a UDT that's been instanced is no big deal. What is a big deal is modifying it online. That's where Rockwell fails hard.


I'd be happy if Rockwell implemented the folder capability to keep tags inside folders for example.
Yes, I totally agree. I end up using UDTs as "folders" simply because there's no better alternative. Why they can't just let you visually group them is beyond me.
 
And that right there is the crux of the problem. I know my Grandpa retired when computer training/usage went from optional to mandatory. Some people just don't wanna.


If the employer A) doesn't care or B) won't pay enough for better employees and C) is willing to pay enough extra for the programmer to spend the time dumbing the system down as much as possible, then I guess it falls under "the customer is always right".


I got my start in Maintenance. I went in knowing next to nothing about PLCs (just that I really wanted to work with them and had been trying on and off for several years to do so), and came out knowing, well, a lot more than I did. Enough to get a job with a Systems Integrator at least.


Whenever I encountered something unfamiliar in a PLC program, I didn't throw up my hands, walk away, and call the OEM. I LEARNED. Whenever I saw an instruction I wasn't familiar with, I didn't cry about it to the engineering manager and demand that instruction be banned in our programming standard. I fired up the help file and learned what it does.

I'm in the "do what's best" camp. If it's better to do something in ST, I do it in ST. If it's better in Function Block, I do it in FB. If it's best in Ladder, I do it in Ladder. If someone pulls up my program and doesn't understand Structured Text, that's on them.



And yeah, maybe they'll call me, and if I'm available, I'll help them out. But I am becoming very strict about my time and I generally only go out on service calls when it HAS to be me looking at it or if I don't have anything super pressing to do. One of the things that annoys me the most is if you're in the office working on a project, sometimes people tend to see that work as optional or just time-filler until you get a service call. And like I said, if I'm ahead of schedule on the project, I'll duck out for a service call here and there, but if I'm down to the wire on a deadline and I need every minute I have, I'm going to say no. If I'm available I'm available, if I'm not I'm not. And those times when I'm not teach them in a hurry that they eventually have to take ownership of the equipment.
 
Yes, I totally agree. I end up using UDTs as "folders" simply because there's no better alternative. Why they can't just let you visually group them is beyond me.

Yes, this really bugs me too. In Siemens I can have all my tags nicely in folders per types, style, name etc

In rockwell, you have to scroll through a massive list of controller tags to find the one you want.
 

Similar Topics

In my car I have 2 cigarette lighter outlets. Dashboard outlet has a 25A fuse in the engine compartment. Cargo area outlet has a 30A fuse next to...
Replies
22
Views
4,785
A recent thread asked how people describe what they do and that is always a difficult thing to explain to people that have little or no...
Replies
0
Views
940
Hi all, i tried to created a button which is visible only when the user "Engineer" is logged. First, i created a macro with the following...
Replies
4
Views
2,487
Best wishes to all of my fellow engineers! :lolis:
Replies
1
Views
1,230
Hi I am second year mechanical engineering student interested in PLC programming as a career choice. Looking at job advertisements it looks like...
Replies
22
Views
6,098
Back
Top Bottom