functions
Type: Array of JSON objects
Required: No
"functions": [
{
"name": "customFunction",
"displayName": "customFunction",
"visible": true,
"description": "This is a sample for a function that can be called.",
"category": "Actions",
"params": [],
"type": null,
"heritable": true,
"searchTerms": []
}
]
This property defines functions of the control that are independent of attributes. The functions can optionally have parameter values or a return value. Each function must have the same name in Source.js, otherwise an error message appears in the browser console and the function is not executed.
A JSON object for a function contains the following properties:
name
{String}: Internal name of the function.displayName
{String}: Name of the function that is displayed in the Engineering.description
{String}: Description of the function that is displayed as a tooltip during mouseover in the engineering.category
{String}: Category of the function under which the function is displayed in the Actions and Conditions Editor in the Engineering.- params {JSON object}, not required: Parameter values of the function.
type
{string, TwinCAT HMI data type}: Return value of the function. The return value must have a TwinCAT HMI data type.heritable
{Boolean}: This property defines whether the function is to be passed on to derived classes.searchTerms
{array of strings}, not required: This property defines search terms for the Engineering that are to optimize the search function within the Actions & Conditions Editor. This makes it possible to find the function using terms other than the function name. For example, if the strings "MyFunction" and "1234" are added to the array, the function can also be found under these terms.
The following figure shows an example of two framework control functions in the Engineering, both of which have no return value and contain an optional parameter value function.
Further Information