We can change byte[] date to GXDateTime using GXDLMSClient.changeType for certain OBIS Ids like(0.0.0.1.2.255)
Ex.
GXDLMSClient.changeType((byte[]) dt, DataType.DATETIME)
But How to do reverse? If I have to change a GXDateTime Object to 12 byte size byte[].
We need this for passive relay time, 4th parameter OctetString.
Hi,
Hi,
You can write this like this:
GXArray arr = new GXArray();
GXStructure structure = new GXStructure();
arr.add(structure);
structure.add(new GXUInt32(300));
structure.add(new GXUInt32(1800));
structure.add(new GXUInt32(5));
structure.add(new GXDateTimeOS(Calendar.getInstance().getTime()));
GXDLMSData obj = new GXDLMSData(YOUR_OBIS_CODE);
obj.setValue(arr);
GXByteBuffer bb = new GXByteBuffer();
dlms.write(obj, 2);
BR,
Mikko
Thanks Mikko. This will be
Thanks Mikko. This will be very helpful.