User Function Library Document

Parent Previous Next

User Function Library Document

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


In these libraries the user will be able to create functions to be used in the application. An example is to create a customized math library to help in the execution of the application.


The libraries are made using the C# programming language and it CANNOT have any tag in it. If you need tag values to be calculated, you will need to pass it as parameters of the function or return a value.


There is also a System Function Library which allows you to select a tag value or to change its value. Please check SVTags function library.




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.



Topics:


.     Function Library Includes



Example:


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);

 



Navigation:



The combobox in the top right of the user function library can be used to navigate between the functions created in that document.

When you select a function in the combobox the focus will go to the selected function.




Import/Export:



To import a library, follow the steps below:


1.   Right-Click the "User Function Library".


2.   In the menu, select the option Import.


3.   In the new window, click the "Selected File" button.


4.   Select the desired file that will be imported.


5.   In the ComboBox, select the desired classes and functions that will be imported.


6.   Check/Uncheck the ComboBox, if desired.


7.   Click the OK button to confirm the import.



To export a library, follow the steps below:


1.   Right-Click the "User Function Library".


2.   In the menu, select the option Export.


3.   In the new window, click the "ChangeFolder" button.


4.   Insert the desired name of the Exported file in the "File name" field.


5.   In the ComboBox, select the desired classes and functions that will be imported.


6.   Click the OK button to confirm the import.