How to: OPC UA Method
Last updated
Last updated
The guide demonstrates how to define the arguments and the body of the OPC UA method.
Please note that calling the OPC UA method will immediately put the script module into demo mode
Open Monokot Server Administrator and double-click Scripts on the Server Explorer pane. Click New Expression and set the name CalcAdd for the expression that appears. Insert the following code into the expression code editor:
Press Ctrl + Enter to apply the change in the code editor.
Go to the Method -> Input Arguments tab and click Add Argument. Enter the name (key) "a" for the input argument. In the same way, create an input argument named "b".
Go to the Method -> Output Arguments tab and click Add Argument. Enter the name (key) "result" for the output argument.
In order for the changes to take effect on the server, click the Sync button or press F5. Now you can call the method using OPC UA client and see the result of its execution.