Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Mobile Operator Extensibility SDK On-Premises

Create a custom mobile integration

  1. Create a new Visual C# Class Library Project which targets the .NET Framework 4.8 with Visual Studio 2017/2019. 
    NOTE: The assembly created must include the file extension in its name for the AVEVA Mobile Operator Plug-In system to load it.
  2. Add references to SAT.Core.dll and AA.Core.Mobile.dll, located in the AVEVA Mobile Operator Client installation directory (by default, "\Program Files\AVEVA\Mobile Operator\Client") in the new project.
  3. Open AssemblyInfo.cs, located in the "Properties" section of the solution file, and add the following lines:

    [assembly: SAT.ComponentModel.Extensibility.AssemblyPlatform(SAT.ComponentModel.Extensibility.PlatformContext.Any)]    

    [assembly: SAT.ComponentModel.Services.CallingContext(SAT.ComponentModel.Services.CallingContextEnum.Default)]
     
  4. Create a new class that inherits from
    AA.Core.Mobile.ComponentModel.SDK.Procedure.MobileSdkIntregrationPlugin. 
    NOTE: The CustomIntegrationFile.txt created using this example will only provide the node name and task value. If you wish to include a timestamp, you must adjust the example below accordingly. The "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" is the interface Id of the configured server.

    namespace MyCustomMobileIntegration

    {

        [PluginInfo(typeof(MobileSdkIntegrationPlugin), "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")]

        public class MyCustomIntegration : MobileSdkIntegrationPlugin

        {

     

            public override string DisplayName

            {

                get

                {

                    return "My Custom Integration";

                }

            }

     

            public MyCustomIntegration(string propertyBag, IProcedureNode parentNode, Guid id)

                : base(propertyBag, parentNode, id)

            {

               

            }

     

            public override string Execute(AA.Core.Mobile.Procedure.IProcedureController procedureController)

            {

     

                string fileName = "CustomIntegrationFile.txt";

     

                using (StreamWriter fileStream = new StreamWriter(fileName, true))

                {

                    fileStream.Write("node {0} had a value of {1}", procedureController.CurrentNode.DisplayName, procedureController.CurrentNode.Value);

                }

     

                return string.Format("MyCustomIntegtation wrote the file to {0}", fileName);

     

     

            }

     

            public override AA.Core.Mobile.MobileProcedurePluginRunType ActionRunType

            {

                get

                {

                    return AA.Core.Mobile.MobileProcedurePluginRunType.FileIO;

                }

            }

        }

    }      

  5. Compile the DLL.
  6. To use the custom action in AVEVA Mobile Operator, copy the compiled DLL (from the output directory specified by the build process) to the AVEVA Mobile Operator installation directory (by default, "\Program Files\AVEVA\Mobile Operator\Client").

The descriptions for the overridden methods are given below:

  • public override string Execute()
    This method contains the logic to run the integration.
  • public override ActionRunType()
    This method denotes the type of functionality that the integration performs.
  • protected override string DisplayName()
    This method displays the node name to the user and is used to log errors with the integration.
TitleResults for “How to create a CRG?”Also Available in