Vai al contenuto

Enable Object Oriented Programming

GF_ProjectVX code allow the users to work with the object oriented programming, enhancing the function blocks and treating them as classes; since this feature needs to be supported by the target device implementation, it is disabled by default; in order to enable it you have to select Project>Options>Tab general and check the Use object oriented features checkbox. Enable Object Oriented Programming-image_0Now the dialog that shows up when creating a new Function Block (as well as the Object Properties dialog), will show addittional content: Enable Object Oriented Programming-image_0 Enable Object Oriented Programming-image_0In the Extends field, you can specify another Function Block that will be treated as a father class for the current function block; only one Function Block can be specified as a father.The current Function Block will inherit every object of the father. In the Implements field, you can specify one or more interfaces.Please note that even if the Object Oriented feature is enabled, you can keep using the function blocks as normal function blocks.