Hi Team,
I am writing value to Last Token Recharge Time: 0.0.94.96.22.255 in meter with data (02/07/2024 10:30:40 AM) which is with data type OctetString, but I am getting an error as
Access Error : Device reports a inconsistent Class or object.
I am using below code for write value.
GXReplyData reply = new GXReplyData();
GXDLMSObject obj = Client.Objects.FindByLN(ObjectType.Data, "0.0.94.96.22.255");
((GXDLMSData)obj).Value = "02/07/2024 10:30:40 AM";
ReadDataBlock(Client.Write(obj, 2), reply);
Can you please guide me to set the value in a given object, here the datatype is OctetString and the value in datetime format. I also tried to set with datetime datatype, array, byte. but nothing is working and getting the same error as above.
Thanks
Hi, At first, read the value…
Hi,
At first, read the value. It will update the data type. Then try to write the value back to the meter. When it works you can update the new date time like this:
((GXDLMSData)obj).Value = new GXDateTime("02/07/2024 10:30:40 AM");
BR,
Mikko
Hi Kurumi, Thanks for your…
Hi Kurumi,
Thanks for your response and now it's working fine.
Can you please guide me one thing in c# using gurux library how can we convert datetime value to OctetString.
I want to convert this [07/02/2024 06:43:30 AM]
to
"07 E7 0C 18 FF 00 00 00 FF 01 4A FF"
Regards,
Mahaveer Prajapati
Hi, You can use GXDateTime…
Hi,
You can use GXDateTime.ToHex method for that.
BR,
Mikko
Thanks a lot Kurumi for your…
Thanks a lot Kurumi for your quick response.
I tried your given code and it's working as I was expecting.