Active2 years, 8 months ago
I have an electric meter with DLMS protocol, bus RS 485 and RS 485 converter attached with my computer. I am trying to communicate with DLMS serial.
Code
My problem is:
I run this code and it shows nothing.
The expected output is:
61968-9 Message profiles for DLMS/COSEM 14th June 2010 Final Study report. To the metering head-end when the meters are DLMS/COSEM compliant. So, it plugs into the GetRequest message (the one we created) the meter serial numbers of interest, the logical device name for each meter, the objects of interest for each. The DLMS UA is a non-profit organization founded in 1997 by leading utilities and meter manufacturers to develop and support a standard for smart meter data exchange.
- STATIC 3-PhASe WhOLe CURReNT eNeRgy MeTeR DLMS/COSeM COMPLIANT R326_DTgC3K3. It is being used for residential and commercial connections. It is a unique product that comes with DLMS/COSEM certification enabling it to be an ideal candidate for a multi-vendor environment. • each meter has a unique serial number in its memory.
- Many meters offer an optical interface at the front of the meter. One can communicate over this interface using optical probes that convert the signal to RS-232 and back again. In DLMS/COSEM the meter is called the server (when used over IP) or slave (when accessed over HDLC/serial).
- How to Activate DLMS communication with meter To enable communication between the gateway and the meter, connected meter’s serial number must be written in the gateway. The meter serial number is unique for every meter and it is labelled on the meter. This value must be written during first commissioning and the gateway keeps them in EPROM.
I need any response. I tried it with different ways, read many articles but the problem is not solved. I can use the software ComTestSerial to check either it respond or not. Yes it respond now I want that it send back any reply through my code.
Advance thanks and any response will really appreciated.
Update 1
Mong Zhu17.2k7 gold badges28 silver badges54 bronze badges
Salman MushtaqSalman Mushtaq
1 Answer
Problem
I run this code and it shows nothing.
I run this code and it shows nothing.
After this line:
BytesToRead
will be 0
. So you will never enter your while-loop to display the read data
. Remove the while-loop and just display the data:17.2k7 gold badges28 silver badges54 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged c#serial-portrs485 or ask your own question.
See An Gurux for an overview.
Join the Gurux Community or follow @Gurux for project updates.
Gurux.DLMS library is a high-performance .NET component that helps you to read you DLMS/COSEM compatible electricity, gas or water meters. We have try to make component so easy to use that you do not need understand protocol at all.
For more info check out Gurux.DLMS.
We are updating documentation on Gurux web page.
Water Meter Serial Number
Read should read DLMS/COSEM FAQ first to get started. Read Instructions for making your own meter reading application or build ownDLMS/COSEM meter/simulator/proxy.
If you have problems you can ask your questions in Gurux Forum.
You do not nesessary need to use Gurux.Serial or Gurux.Net.You can use any connection library you want to.Gurux.DLMS classes only parse the data.
Before use you must set following device parameters.Parameters are manufacturer spesific.
Each meter has own server address. Server address is divided to Logical address and Physical address.Usually you can use value 1 for meter address. You can count server address from serial number of the meter.You can use GetServerAddress method for that.
Electric Meter Serial Number
If you are using IEC handshake you must first send identify command and move to mode E.
After you have set parameters you can try to connect to the meter.First you should send SNRM request and handle UA response.After that you will send AARQ request and handle AARE response.
If parameters are right connection is made.Next you can read Association view and show all objects that meter can offer.
Now you can read wanted objects. After read you must close the connection by sendingdisconnecting request.
Using authentication
When authentication (Access security) is used server(meter) can allow different rights to the client.Example without authentication (None) only read is allowed.Gurux DLMS component supports five different authentication level:
- None
- Low
- High
- HighMD5
- HighSHA1
In default Authentication level None is used. If other level is used password must also give.Used password depends from the meter.
When authentication is High or above High Level security (HLS) is used.After connection is made client must send challenge to the server and server must accept this challenge.This is done checking is Is Authentication Required after AARE message is parsed.If authentication is required client sends challenge to the server and if everything succeededserver returns own challenge that client checks.
Writing values
Writing values to the meter is very simple. There are two ways to do this.First is using Write -method of GXDLMSClient.
Note!Data type must be correct or meter returns usually error.If you are reading byte value you can't write UIn16.
It is easy to write simple data types like this. If you want to write complex data types like arrays thereis also another way to do this. You can Update Object's propery and then write it.In this example we want to update listening window of GXDLMSAutoAnswer object.
Transport security
DLMS supports tree different transport security. When transport security is used each packet is secured using GMAC security. Security level are:
- Authentication
- Encryption
- AuthenticationEncryption
Using secured messages (glo services) is easy. Before security can be used following properties must set:
- Security
- SystemTitle
- AuthenticationKey
- BlockCipherKey
- FrameCounter
Serial Number Idm Gratis
If we want communicate with Gurux DLMS server you just need to set the following settings.