Steps to create a mock peripheral device using Windows service
- Last UpdatedFeb 25, 2021
- 1 minute read
-
To add a Mock peripheral entry in to the Database, run the ‘Win10SampleScript’ script in SQL Server.
-
Ensure the new mock peripheral is added in dbo.Peripherals table.
-
Install the AVEVA Mobile Operator application on the Windows 10 device, Login and perform full sync.
-
Navigate to Search/Input settings page and ensure the mock Peripheral created in step 1 and 2 is listed.
-
The Mock Peripheral will be listed but disabled/greyed out.
-
Open the TestPluginService project with Visual studio 2017/2019.
-
Add the latest newtonsoft.json dependency from Nuget package manager to the Windows service project.
-
Build the project and install the service using installutil command.
-
See the following for info on installing the service:
https://docs.microsoft.com/en-us/dotnet/framework/windows-services/how-to-install-and-uninstall-services
-
Once the service is installed, then open the property of service and switch to "Log on" tab, select the "Local System account and Allow service to interact with desktop" and run the service
-
Go back to Search/Input settings page in the AVEVA Mobile Operator application and tap on the Refresh option provided in the header.
-
On refresh, the Mock Peripheral will be enabled, and its settings can be modified if required.
-
Open a procedure with peripheral integration. The task/ task group must be integrated with the Mock Peripheral or must have an integration of the Category supported by the Mock Peripheral.
-
At the task/ task group described in step 11, tap on the green ‘peripheral icon’ to read data from the Mock peripheral. The data communicated by the plugin peripheral will be populated in the task input field.