SOFT: Inheritance (object-oriented) in PLC programming?
The AList
automation at control.com
Sun Feb 1 11:25:09 EST 2009
==> Automation List post by Jim Hanley...
To view or reply to this thread: http://www.control.com/thread/1026248755#1233456108
------------------------------------------------------------------------------------
Re: SOFT: Inheritance (object-oriented) in PLC programming?
------------------------------------------------------------------------------------
This article has some interesting points. I was the only one to post an example that can be dissected and can also run in the background scan of a PLC (Simatic S7). Let me me remind you that the original question was based on conformance with:
* encapsulation
* modularity
* polymorphism
* inheritance
Encapsulation: my example demonstrates encapsulation by using PLCopen blocks within the block I authored. It uses data (unique Params structure) and functions (PLCopen motion) in a single unit.
Modularity: my example demonstrates that this block can be instantiated by axis of many different types of Params structures to account for different mechanics.
Polymorphism: my example uses a State Output variable to represent what the axis is doing. This block indicates movement, idle, or faulted.
Inheritance: Okay, this is where the OOP gets a bit grey. I'll attest that my example demonstrates inheritance in that in Simatic S7 you can use the Blk_Move command to directly address the instance of this block to be used elsewhere in the program. Also, my example can be used as a starting point for a much more complex State Model motion block. I'd be glad to show you my Gearing and Camming block based on the same example.
I believe my response and my example clearly show how ST programming or SCL programming with a State Model approach is as close to OOP we can get in a PLC!
------------------------------------------------------------------------------------
==> A Note from the Sender of this Message...
You are receiving this message because a subscription was entered for your address
for the Control.com Automation List. To unsubscribe, send an email to us at
forum at control.com requesting your removal from the subscription list.
This email was sent by:
Control.com, Control Technology Corporation,
25 South Street, Hopkinton, MA, 01748, USA.
Copyright 2009 Control Technology Corporation. All rights reserved.
Privacy and Legal Notices may be viewed at:
http://www.control.com/about.php
More information about the Automation
mailing list