Creating User Functions

Parent Previous Next

Creating User Functions

Users can create functions in customized libraries which can be exported and imported to any project created in SmartView.


To create a new User Function Library Documente, right click the node in the tree view an then select the option New Document, as shown in the image below:

      You can also create a new document by selecting the node and using the shortcut "CTRL+N"





Example:


In this example we will create a customized math library to help in the execution of the application.


After creating the document, configure as the image below and save the document with the name " CustomizedMathLibrary":



To use the libraries made, the user will have to set an event as following:


LibraryName.FunctionName(pameter1, parameter2, ...);


When the user configures the call of the event, it is possible to use tag or static values.


In this example, the tag "TagFunction" will store the result from the function "Sum", that will sum two values passed in the parameter, created in the "CustomizedMathLibrary".

  


@TagFunction = CustomizedMathLibrary.Sum(10,5);

 


In this example, "TagFunction" will store the result from the function "Sum", that will sum two values passed in the parameter (in this case one tag and one static value), created in the "CustomizedMathLibrary".

  


@TagFunction = CustomizedMathLibrary.Sum(@TagParameter,5);

 


Topics:


.     Function Library Includes