Write Date and Time to Meter with Gurux.DLMS.CPP

2 posts / 0 new
Last post
bazrafkan.mb
Write Date and Time to Meter with Gurux.DLMS.CPP

I can read date and time but i can't write Date and Time to meter actually i get DLMS_ERROR_CODE_OK but when i read again date and time are not change.
Clint Adress 0x01
// already connected and read Association View.
int index=2;
time_t tm1 = time(NULL);
struct tm dt;
localtime_s(&dt, &tm1);
CGXDateTime aa(dt);
aa.SetSkip(DATETIME_SKIPS_NONE);
CGXDLMSVariant ValueSet(aa);
std::string str="0.0.1.0.0.255:"
CGXDLMSObject* obj = cl.GetObjects().FindByLN(DLMS_OBJECT_TYPE_ALL, str);
if ((ret = com.Write(obj, index, ValueSet)) != DLMS_ERROR_CODE_OK)
{
return_value = "--ERROR--";
}
else
{
return_value = "--OK--";
}

why i get "--OK--" but date and time it has not changed?

kurumi
kurumi's picture
Write Date and Time to Meter with Gurux.DLMS.CPP

Hi,

Can you post bytes what you send to me by email?

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org