
|
ST language of MELSEC that corresponds to IEC61131-3. In the name, isn't it most that it has not been used to have heard it even in case of being?When the ST language is used by such a scene, it explains it is effective while raising an easy example though it thinks there is a limit in doing "Data processing" with the ladder to be awareness as not considering.
|

Commentor / R.Takeuchi |
| |
ST language suitable for a complex operational expression (2) |
In the foregoing paragraph, I introduced limit writing in the ladder.
Then, let's think whether they are other methods and there is more comprehensible hand. It has been supported from the previous MELSEC-Q series, as for "ST language" years ago. As the ST language is used to do the programming of the code base that similar BASIC and C language that a soft maker often uses, it is likely to feel troublesome for an electric person who think logic from the electric circuit diagram.
Because they don't often use in daily work. The ST language strictly expresses it like PASCAL. Because there is no great difference in the point of thinking logic, is difference only the method of description and the grammar. Speaking PASCAL, though I thought Delphi that was popular few years ago, You need not seriously think BASIC, C language, and PASCAL.
Well, in the ST language, there are two main types of usages. One is in the multi file composition, is a method that a file is described in the ST language. Other is the method that describe in FB (function block) in the ST language.
In a left chart, it is possible to exist together the file of "The ST language" and the file of the Ladder, to control that makes the best use of each merit.
In the case to divide, the file Debug, such as "Data processing and control" and "Production line and inspection process", fundamentally, in case of execution of processing with different the controlled object or different content of the control or aiming at short term start up with a CPU by two or more people, simultaneously is general.
When only a part of the control logic is described in the ST language like the latter, the part that described in the ST language is made to "the Black Box" in the image like the subroutine and used. The input and the output can be instantaneously judged, and become comprehensible easy circuits because it can write by usually "the sequence programming", with a pointer such as "CALL P0", together in "Box" of function block.
If the operational expression in the foregoing paragraph is written in the ST language, it becomes the following descriptions.

In the above chart, the device number is specified to compare easily with the ladder, though the input value and the output value can be specified even if the label is used. The operation can be accurate by only one line, though it is not easy to see a little because the conversion "function of the real type" / "integer type" is called to do the floating point arithmetic.
Next, let's think about the case with two or more meters to do this operation. Though the operation circuit of the foregoing paragraph was simply the program of three lines, when a similar circuit is needed only the same number of meters, the normal person attaches it with copy & paste. When one operation block becomes as much as 10 lines and as much as 20 lines, the program tends to occur to the bug because the total arithmetic circuit becomes hundreds of lines, and a program becomes not seen easily. Moreover, no matter how it thinks, it is not reasonable to try to correct all the circuits when the operational expression was altered.
It is best to write function block (FB) in the ST language in case of such a case. One sentence of the above chart is written in the ST language, and only a necessary number displays FB in FB with the ladder. And, if a set value of each calculation mater is connected in the line, it makes complete. It becomes the following screens when monitoring it with GPPW.

As for FB1, "The net weight becomes and because the moisture content rate is ten by 1000, the correction weight becomes 1111" can understand at one view. Only in FB named "CALC1" is corrected, even if the arithmetic expression changes, in the entire circuit was reflected, the development efficiency goes up very much.
As mentioned above, the ST language is suitable for "data processing", while the ladder is suitable for the control. I think that it can construct best "Control" by writing the control program in the ST language, and the entire circuit's becoming complex because it tries to describe "data processing" with the ladder. And using only each advantage to its maximum. Now, PLC is an age that not only the control but also data processing. It has evolved with the performance only for the "PLC" to correspond to it.
|
|