Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Time Synchronising For Meter / All Dlms Meter

Time synchronising for meter / all Dlms meter

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By sachinar007 , 7 July, 2020
Forums
Gurux.DLMS

Hi Mikko,

I want to do time sync to and other makes meters. firs i want to read 0.0.1.0.0.255 clock and if it is different then only do sync.

I am able o read clock bu not able to write. kindly help. if possible provide code. i used tcp/ip connection

regards,
Sachin Ambre

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi,

Hi,

You need to change the authentication level to low or high if you want to update the clock. If you are connecting without authentication you can only read values from the meter.

BR,
Mikko

sachinar007

5 years 11 months ago

Hi,

Hi,

I have tried with Low authentication, below is my code sample.

Gurux.DLMS.Reader.GXDLMSReader reader = null;
try
{
IGXMedia media = null;
TraceLevel trace = TraceLevel.Error;
bool iec = false;

string IpAddress = "172.19.10.32";
int Port = 1001;

if (CommunicationType == "1")
{
media = new Gurux.Net.GXNet();
}
else if (CommunicationType == "2")
{
media = new GXSerial(comport);
}
Initialize connection settings.
if (media is GXSerial)
{
GXSerial serial = media as GXSerial;
if (iec)
{
serial.BaudRate = 300;
serial.DataBits = 7;
serial.Parity = System.IO.Ports.Parity.Even;
serial.StopBits = System.IO.Ports.StopBits.One;
}
else
{
serial.BaudRate = 9600;
serial.DataBits = 8;
serial.Parity = System.IO.Ports.Parity.None;
serial.StopBits = System.IO.Ports.StopBits.One;
}
}
else if (media is GXNet)
{
GXNet net = media as GXNet;
net.Port = Convert.ToInt32(Portno);
net.HostName = IpAddress;
net.Protocol = Gurux.Net.NetworkType.Tcp;
}
else
{

throw new Exception("Unknown media type.");
objinformixhelper.AuditLog("DLMS Realtimedata Unknown media type. MeterId= " + MeterId, IpAddress);
return false;
}

DateTime MeterDateTime = DateTime.Now;
objinformixhelper.AuditLog("DLMS Realtimedata client connection MeterId= " + MeterId, IpAddress);
GXDLMSSecureClient client = new GXDLMSSecureClient(true, 32, 1, Authentication.Low, "ABCD0001", InterfaceType.HDLC);

reader = new Gurux.DLMS.Reader.GXDLMSReader(client, media, trace, objinformixhelper, ObjCommonFunction);
media.Open();
objinformixhelper.AuditLog("DLMS Realtimedata client connection open MeterId= " + MeterId, IpAddress);
Some meters need a break here.
Thread.Sleep(1000);

GXDLMSClock Clock = new GXDLMSClock();
Clock.LogicalName = "0.0.1.0.0.255";
Clock.SetAccess(2, AccessMode.Write); 5- auth write , 2 write
object val = comm.Read(Clock, 2);

Clock.Time = DateTime.Now;
byte[][] data = dlms.Write(Clock, 2);
GXReplyData reply = new GXReplyData();
comm.ReadDLMSPacket(data, reply);
reader.Write(Clock, 2);

if (reader != null)
{
reader.Close();
}
}
catch (Exception ex)
{
if (reader != null)
{
reader.Close();
}
objinformixhelperDLMSSyn.ExceptionLog("DLMSMetersynctime ex=" + DateEx.Message + "Date =" + meterDate, "ChecktimesyncForLandTMeter", IpAddress);

}

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi Sachin ,

Hi Sachin ,

Try to connect with GXDLMSDirector. Read association view and select Clock object. Then check "Access rights" tab. Make sure that Read/Write is enabled.

It seems that you are using India standard meter. Set UseUtc2NormalTime = true;
client .UseUtc2NormalTime = true;

Also, try to first write same date-time to the meter that you have read. If it works there are few parameters in date-time that are causing problems with some meters.

BR,
Mikko

sachinar007

5 years 11 months ago

Hi,

Hi,

No I am using secure standard FX 100. I have tried but failed. Please find Scree.

regards,
Sachin

Image
Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi Sachin,

Hi Sachin,

Try to first write time what you have read back to the meter. Some meters are expecting that specific time zone is used.

BR,
Mikko

sachinar007

5 years 11 months ago

Hi Mikko,

Hi Mikko,
Thank you for reply.

In shared screen shot, I have provided read and write access and request connect. On connect I read time and again write back same date time without any change. Error is shared in above screen.

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi,

Hi,

You don't provide access right, meter does. If you read association view, is access right readWrite?

BR,

Mikko

sachinar007

5 years 11 months ago

Hi Mikko,

Hi Mikko,

When I read association view, it has read access. I change it. Please find details. reading association , read clock and write clock.
If i don't provide readwrite access , then it is disable, how to writer it ? as suggested, I tried writing same date time. but same issue.

This is for EDMI meter, with low authentication pwd as 12345.

[Trace removed]

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi,

Hi,

As I told before. You don't provide access right, the meter does. You need to try to connect using a High authentication level and read the association view again. Check if the clock access level is then ReadWrite.

BR,
Mikko

sachinar007

5 years 2 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

Now i have High level password for L&T meter, as guided by you, association view has read write access for Time OBIS code.

While using directrix i am selecting Manufacture as Indian Standard, interface =HDLC, authentication = "US". using it am able to fetch all parameters now but Still the time sync is not happening. it through error as "access Error: Device reports a hardware fault"

Also while using .net code example i am not able to see "US" as authentication options.

Kindly help for doing time sync.

Image
Profile picture for user Kurumi

Kurumi

5 years 2 months ago

In reply to Hi Mikko, by sachinar007

Hi Sachin,

Hi Sachin,

Please, create a new topic if you have a new question.

Your settings seem to be ok and the meter should reply.

US is High authentication where the client address is changed to 48 (0x30). It's added to GXDLMSDirector to help reading.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin