
|
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 (1) |
Here, it will think as an example of the case where it weighs with calculation meter.
There is a raw material that contains moisture easily, and the moisture content rate is assumed to be 10(%). When this raw material needed by 1000g in the net weight, this raw material is requested "1111g" from the weight actually measured by the following arithmetic expression.
Water correction weight = net weight / 1 - (moisture content rate/100)
Then, let's think how it becomes it if this is described with the ladder. The correction weight: D10 and net weight: D20 and moisture content rate: Because the operational expression becomes "D10=D20/(1-(D30/100))" when assuming storage in D30, it is in following circuits that occur first on the head.

However, this circuit actually becomes correction weight = net weight in operation and. When D30 is 100 or less, the operation result of one always becomes "0" because the data memory of PLC cannot processes the value with the decimal point, and is processed to begin with as an integer value. D30 is always the moisture Content rate, and always the following below 100(%). And this circuit is unsuitable.
Moreover, as it is, the arithmetic expression can be programmed, if it makes it to the circuit that uses the floating point arithmetic command.

This circuit converts the device of the integer type into the device of the real type, calculates everything by the device of real type. Though in D10 obtains a correct value of "1111", the processing speed slows by ten times or more. PLC slows down extremely the performance when the floating point arithmetic is done. And the number of lines of the program increase to twice or more, too and it becomes difficult to debug in = not seen easily. Moreover, because this program happen to miss input of the device number. We don't recommend for this program.
Next thinking is to make it increase the denominator and the molecule 100 times and calculate by the integer value. That is to say, the circuit can normally obtain measurement weight "1111g".It is in the following below circuits. The circuit becomes "D10=D20*100/ (1-(D30/100))*100", i.e. "D10=D20*100/ (100-D30)".

This method becomes smart writing in a usual "ladder program" because it obtains correct value, and obtains the calculation express result that the processing speed is fast. However, the person of maintenance is made sometimes embarrassed, and it said, "only the person can made it understands". It is difficult to lead former calculation expression from this circuit, because "100" is multiplied and it calculates. ,this circuit is limit.
|
|