Gurux.DLMS library is a high-performance component that helps you to read your DLMS/COSEM compatible electricity, gas, or water meters. We have tried to make component so easy to use that you do not need to understand protocol at all.
Read basic information from Gurux.DLMS component before you start to modify simulator for your needs.
If you have problems you can ask your questions in Gurux Forum. You can get source codes of C# example or Java example.
Purpose of Gurux.DLMS.Simulator is help you make testing environment without the huge number of real meter. You need only one meter to get started. There is also one simulator template in this project. We have read Crystal Smart meter and added it to the GitHub project. (crystal.xml). You can use it to get started.
Preparation for Java
If you want to use java version from Gurux.DMLS.Sinulator you need to build it using maven. Run this command to build java package:mvn clean backageThen you can start server running:
java -jar target/gurux.dlms.simulator.java-0.0.1-SNAPSHOT.jar
Preparation for .Net Core
If you have Visual Studio 2019 installed, you don't need to do anything. If you want to run .Net version in Linux you need to first install .NET Core 3.1 SDK to build the project. Run this to check is .NET Core installed:dotnet --infoYou should see something like:
.NET Core SDK (reflecting any global.json): Version: 3.1.101 Commit: b377529961If SDK is not installed, Install .Net Core from here. Next build the project running:
dotnet build Gurux.DLMS.Simulator.NetCore.slnAfter build you can start the simulator running:
dotnet bin/Debug/netcoreapp3.1/Gurux.DLMS.Simulator.Net.dll
Usage
First, you need to read values from the real meter. You use meter values to make a simulator template. You create a simulator template running Gurux.DLMS.Simulator. In this example, the meter is connected to serial port 8.You get a description from all the parameters if you run Gurux.DLMS.Simulator.Net.exe without parameters.
Gurux.DLMS.Simulator.Net.exe -S COM8 -o simulator_template.xml -t VerboseThis might take some time because all the values are read from the meter. After you have created the simulator file you can start the simulator.
Gurux.DLMS.Simulator.Net.exe -p 1000 -x simulator_template.xml -t Verbose -N 10
If you want to that all the meters are using the same TCP/IP port you can use -X parameter.
You need to use the serial number to read the meter if you are using the same TCP/IP port.
Gurux.DLMS.Simulator.Net.exe -p 1000 -x simulator_template.xml -N 10000 -X
Modifying values.
Because needs are so different when simulating meters, there is only a few basic values are updated. Everything else are static values. You can see them in UpdateValues function. If you need only meters to read that should be enough for you. Default functionality updates COSEM Logical Device Name and meter serial number. Serial number is a one-based number the is increased by one.
You can expand the functionality of your needs.
You can read what each method does.