1) Does “structured” refer to “structured programming”, the 70’s development which emphasizes subroutine structures and avoiding the GOTO statement, used by Pascal and Modula-2 and most others since?
I don’t know where the name comes from, but the language does support subroutines and is typically programmed using this sort of design philosophy. Like all IEC 61131-3 programming languages, structured text was designed as a way of making the programming a bit more uniform between various PLC vendors. Prior to the IEC 61131-3 standard, different PLCs had different programming languages, some of them variations of something standard like BASIC or C, but some of them were proprietary. It made it more difficult to switch from one PLC to another. Structured text uses a more modern style of programming, and is designed to be much more portable across different PLC platforms.
2) Many sources say structured text is most nearly like Pascal but some say it is most nearly like Modula-2. Both languages were developed by Niklaus Wirth, and Modula-2 is approximately like Pascal with the addition of modules. A module is a subroutine with internalized data fields that accomplishes data encapsulation with only predetermined ways of accessing the data outside the module. This is also a feature of object oriented programming. Does structured text programming of PLCs support modules?
Absolutely. Generally speaking, when you are dealing with a segment of structured text you are working on some small subset of data. Some PLCs are more object oriented than others. Allen Bradley PLCs tend to be the most object oriented, out of the PLCs that I have experience with. Everything in a modern AB PLC is tags and structures, with global data and local encapsulated data. Other PLCs aren’t necessarily as restrictive with respect to limiting your data scope. PLCs vary quite a bit.
3) Structured text source is, I hear, written and stored as ASCII text. Often, PLCs have an RS232 port used to program the thing. Could it possibly be that they designed PLCs elegantly enough that one could, if one wished, write a structured text program in a text editor, and transfer it to the target PLC with a coms program? I realize a development environment is nice for lots of reasons this question sets aside; I’m just wondering how clean the setup can be if you want.
Usually the structured text module has to be compiled within the PLCs development environment.
4) Suppose a young fella wanted to start learning this field, and his company used Allen Bradley / Rockwell Automation PLCs, which he can get some access to. If he wanted to supplement this learning with other, cheaper brands, perhaps even used or surplus ones, and they supported IEC 61131-3, would he find they all worked similarly enough to make the early learnings reasonably extensible? Or would their compliance and similarity be so perfunctory and even incomplete that this would be more frustrating than educating. Note, the young fella in question figures that hardware details like how they package and sell add on inputs, and the use of the development environment (if he’s using it), would probably differ between brands and year to year, and maybe there are libraries that differ too.
The whole point of IEC 61131-3 is to do exactly this. It makes the programming between various brands of PLCs much more uniform so that you don’t have such a steep learning curve when you change from one brand of PLC to another. It also means that generic IEC 61131-3 programming can be taught in schools, and much less on the job training. There are a lot of differences in the details (as evident in the last couple of posts above this one), but once you get the point behind ladder logic, structured text, etc. switching from one vendor to another isn’t that difficult. It’s not like the old days where you had to learn something with a completely different design philosophy from the ground up.
I haven’t looked lately, but it used to be that all of the big guys (Rockwell, Siemens, Modicon, etc) had demo or limited versions of their software which you could download. You wouldn’t be able to run a plant with the free stuff, but you could usually program a built in PLC simulator with it so that you could learn how to use that vendor’s software. A young fella who wants to build up his skills could download software from a bunch of different places and get familiar with all of them.
Structured text has its uses, but most of the real work is done by ladder logic. If you want to get into PLC programming, make sure you learn ladder logic first.