Dear sir,
I am trying to read and write the tarriff value into the meter. when i am reading the values , there is no problem ..but when i am writing the values the error shown as below. if i am writing value the tool is not sending set command it shows only following error
17:23:42 Read object type Data index: 2
7E A0 1C 00 02 0E D3 41 98 EC 65 E6 E6 00 C0 01 C1 00 01 01 41 00 64 01 FF 02 00 08 65 7E
17:23:42 Received data
7E A0 18 41 00 02 0E D3 98 41 D7 E6 E7 00 C4 01 C1 00 1B 00 00 00 00 49 D0 7E
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at Gurux.DLMS.Internal.GXCommon.SetTime(GXByteBuffer buff, Object value)
at Gurux.DLMS.GXDLMSClient.Write(Object name, Object value, DataType type, ObjectType objectType, Int32 index)
at Gurux.DLMS.GXDLMSClient.Write(GXDLMSObject item, Int32 index)
at GXDLMSDirector.GXDLMSCommunicator.Write(GXDLMSObject obj, Object target, Int32 index, List`1 UpdatedObjects)
at GXDLMSDirector.MainForm.WriteMnu_Click(Object sender, EventArgs e)
what is the problem? The response is in the proper format..then why this error comes?
how to overcome this?
tarriff objects
Hi,
Your meter is returning time. You must create GXTime object and write it back.
d.Value = new GXTime(DateTime.Parse("Update time"));
I believe that now you are giving it as a string.
Other possibility is set objects data type like this:
GXDLMSData d = new GXDLMSData("1.65.00.100.1.255");
d.SetDataType(2, DataType.Time);
d.Value = "00:00:00";
target.Write(d, 2);
BR,
Mikko