ABB ST语言编程(5)

时间:2025-07-06

System 800xA Training

13.3Basic Language Elements

This section gives a very brief review of the structured text language.

13.3.1AssignmentStatements

An assignment statement assigns a value to a variable.

The statementhas two parts:

Result := In1 AND In2 OR In3;

The left hand side, before the assignment operator (:=) is called theassigned variable.The right hand side is anexpression whichis evaluated to give a value to the assignedvariable.

In the above example the expression results in a Boolean– true/false value. (It is aBoolean expression). The AND and the OR are referred to asoperators(In this caseBoolean operators).

NOTE!The := symbol is used for the assignment of operatorsand a statement must be ended with a semi-colon.

Another example of an assignment statement:

AverageFlow := (Flow1 + Flow2)/2;

The variableAverageFlow is assigned the value given by the result of the calculationon the right. Flow1 is firstly added to Flow2 and then the total is divided by 2.

The expression on the right is a Real expression because it results in a Real value(floating point value). The symbols + and / are called arithmetic operators becausethey perform arithmetic operations on the variable values which follow them.

13.3.2CommentStatementsOperator

(*…*)

(#…#)-3.

It is normally not possible to have comments withincomments (nested comments):

(* This is not (* Inner Comment *) allowed *)

However there is an alternative comment symbol that allows this:

(# This is (* Inner Comment *) allowed #)

This is useful for commentingout large blocks of code containing comments.

Chapter13-5

ABB ST语言编程(5).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219