结构化文本组成部分:注释

为了使结构化文本更容易解读,请添加注释。
  • 通过注释,可以使用普通语言来描述结构化文本的工作方式。
  • 注释对结构化文本的执行没有影响。
给结构化文本添加注释:
要添加注释
使用以下格式之一
在单独一行上
//注释
(*注释*)
/*注释*/
在结构化文本某一行的末尾
在结构化文本某一行当中
(*注释*)
/*注释*/
跨越多行
(*注释开始...注释结束*)
/*注释开始...注释结束*/
例如:
格式
示例
//注释
在行的开头
//Check conveyor belt direction
IF conveyor_direction THEN...
在行的末尾
ELSE //If conveyor isn’t moving, set alarm light
light := 1;
END_IF;
(*注释*)
Sugar.Inlet[:=]1;(*open the inlet*)
IF Sugar.Low (*low level LS*)& Sugar.High (*high level LS*)THEN...
(*Controls the speed of the recirculation pump.The speed depends on the temperature in the tank.*)
IF tank.temp > 200 THEN...
/*注释*/
Sugar.Inlet:=0;/*close the inlet*/
IF bar_code=65 /*A*/ THEN...
/*Gets the number of elements in the Inventory array and stores the value in the Inventory_Items tag*/
SIZE(Inventory,0,Inventory_Items);
提供反馈
对本文档有问题或反馈吗? 请在这里提交您的反馈
Normal