如何在SCL中实现“泛化”

时间:2013-02-28 08:47:28

标签: uml plc

是否可以在Simatic SCL代码(或结构化文本代码)中实现UML中的泛化

UML中 Generalization 的定义:

A generalisation is a relationship between a morew general classifier and a 
more specific classifier. Each Instance of the specific classifier is also an
indirect instance of the general clasifier. Thus, the specific classifier
inherits the features of the more general classifier.

Features specified for instances of the general classifier are implicitly
specified for instances of the specific classifier. Any constraint applying
to instances of the general classifier also applies to instances of the 
specific classifier.

1 个答案:

答案 0 :(得分:2)

一般来说,答案是否定的,不是真的。所有编程PLC(梯形图,ST,FBD等)的方法通常只是从实际机器代码中非常轻微地抽象出来。它们更接近于装配包装,而不是我们认为是现代开发语言的任何东西。结构化文本更接近非常原始的Pascal - 它缺少任何类型的面向对象的特征。

这个概念是PLC和PLC程序员在为它们开发程序时很久就习惯了极端微观管理的方法。原因很多 - 有些比其他更有效。斯科特·惠特洛克(Scott Whitlock)写了一篇文章here,概述了其中的一些原因。一个重要的问题是,工厂车间的维护人员往往是那些试图对机器进行故障排除的人,并且拥有清晰,非抽象的状态机信息比获得优雅,极简的冲程配方更有价值。系统开发人员的自我。

PLC编程是一个无情的实用行业。如果你可以选择10%更实用的东西和90%更优雅的东西,那么实用的解决方案将始终获胜。

话虽如此 - 有一些人在这个区域玩。我建议快速阅读this article一些试图使ST工作有点像你建议的例子。不过,在将这样的东西放在真正的工厂里工作之前,我会保持谨慎,因为真正的机器需要安全且可靠地赚钱。