|
<< Click to Display Table of Contents >>
Adding Simulation to Existing Applications |
The Elipse Random Driver can be used to simulate all data collecting of an existing application. This Driver can be injected by simply copying the Random.dll file and replacing the libraries of Drivers used by an application, without changing any configuration of existing projects.
Start by extracting the content of the Random.zip file, which contains the files Random.xml, Random.dll, ReplaceDrivers.bat, and RollbackOriginalDrivers.bat, to the application's root folder.
To replace all Drivers of an application by the Elipse Random Driver, execute the ReplaceDrivers.bat file. This script searches on sub-folders of an application for all libraries, such as Unit1\DNPMaster.dll, generates a backup copy, such as Unit1\DNPMaster.dll.original, and then copies this Driver over that library, using the command copy Random.dll Unit1\DNPMaster.dll. The result is that library names are kept, but all Drivers are now a Random type. This procedure must be executed with the application stopped and closed.
The second step is customizing the Random.xml file, which is used by all Drivers of an application. The default behavior of this Driver is search for that file on disk, starting on the folder where this Driver's library is, in this case the DNPMaster.dll file, and then moving up until it finds the Random.dll file. By placing the Random.xml file on the root folder of a Domain, this ensures that all Drivers use the same configuration file, without changing any configuration in the application.
Users can create different Profiles in the configuration file for each type of Driver, using the name of the Driver in the Dll attribute of each Profile. For example, in an application that contains the Modbus32.dll, DNPMaster.dll, and BACnet.dll Drivers, users may have a configuration file with the next code.
<RandomConfig>
<Profile Name="DNP" Dll="DNPMaster">
Configuration of a DNPMaster Driver
</Profile>
<Profile Name="Modbus" Dll="Modbus32">
Configuration of a Modbus Driver
</Profile>
<Profile Name="BACnet" Dll="BACnet">
Configuration of a BACnet Driver
</Profile>
</RandomConfig>
Execute the application so that each one of these Drivers, which are actually a renamed copy of the Random.dll file, find the Random.xml file and load the Profile corresponding to the name of the respective library.
To restore the original Drivers, execute the RollbackOriginalDrivers.bat file to replace the files with the .dll extension by their corresponding .dll.original extension.