检测面向对象功能的使用,如带有EXTENDS
和IMPLEMENTS
的功能块声明,或属性和接口声明。当您编写的代码要移植到其他符合 IEC 61131-3 标准的系统时,这条规则非常有用。
理由并非所有系统都支持面向对象编程。没有面向对象的代码更容易移植。
重要性:低
示例
//Function block extended by another and implementing an interface: FUNCTION_BLOCK POU EXTENDS CTD IMPLEMENTS ITF //SA0119 ... // Declaration parts of property methods assigned to a function block: POU.Prop.Get //SA0119 POU.Prop.Set //SA0119 --> SA0119: Object-oriented features not allowed