I'm trying to write four schedules to a meter. But I'm getting Data Block Unavailable all the time.
I suspect it has something to do with default values inserted by GDXDateTime.
Here is the my Java code. I copied this from one of your posts.
GXReplyData reply = new GXReplyData();
GXDLMSActionSchedule ac = new GXDLMSActionSchedule("0.0.15.128.3.255");
GXTime schedule[] = { new GXTime(255, 0, 0, 0), new GXTime(255, 15, 0, 0),
new GXTime(255, 30, 0, 0), new GXTime(255, 45, 0, 0) };
ac.setExecutionTime(schedule);
try {
byte[][] result = client.write(ac, 4);
readDataBlock(result, reply);
} catch (Exception e) {
e.printStackTrace();
}
There is a historical reason for this because hundredths was causing problems with some big meter manufacturers. For this reason, hundredths are skipped if it's zero.
You need to remove it by yourself. Like this:
GXTime value = new GXTime(255, 0, 0, 0);
value.getSkip().remove(DateTimeSkips.MILLISECOND);
DayOfWeek should be ignored by default when you create the time object, but it's missing from this constructor. It's added to the next version. In the meantime you can add it like this:
You can ignore week date like this:
value.getSkip().add(DateTimeSkips.DAY_OF_WEEK);
Hi,
Hi,
There is a historical reason for this because hundredths was causing problems with some big meter manufacturers. For this reason, hundredths are skipped if it's zero.
You need to remove it by yourself. Like this:
GXTime value = new GXTime(255, 0, 0, 0);
value.getSkip().remove(DateTimeSkips.MILLISECOND);
DayOfWeek should be ignored by default when you create the time object, but it's missing from this constructor. It's added to the next version. In the meantime you can add it like this:
You can ignore week date like this:
value.getSkip().add(DateTimeSkips.DAY_OF_WEEK);
BR,
Mikko
Hi Mikko,
Hi Mikko,
That did it. I needed to set the MILLISECOND to 0 again after removing the skipping value.
<WRAPPER len="83" >
<TargetAddress Value="1" />
<SourceAddress Value="1" />
<PDU>
<SetRequest>
<SetRequestNormal>
<!--Priority: HIGH ServiceClass: CONFIRMED invokeID: 1-->
<InvokeIdAndPriority Value="193" />
<AttributeDescriptor>
<!--ACTION_SCHEDULE-->
<ClassId Value="22" />
<!--0.0.15.128.3.255-->
<InstanceId Value="00000F8003FF" />
<AttributeId Value="4" />
</AttributeDescriptor>
<Value>
<Array Qty="4" >
<Structure Qty="2" >
<OctetString Value="FF000000" />
<OctetString Value="FFFFFFFFFF" />
</Structure>
<Structure Qty="2" >
<OctetString Value="FF0F0000" />
<OctetString Value="FFFFFFFFFF" />
</Structure>
<Structure Qty="2" >
<OctetString Value="FF1E0000" />
<OctetString Value="FFFFFFFFFF" />
</Structure>
<Structure Qty="2" >
<OctetString Value="FF2D0000" />
<OctetString Value="FFFFFFFFFF" />
</Structure>
</Array>
</Value>
</SetRequestNormal>
</SetRequest>
</PDU>
</WRAPPER>
Thank you! Really appreciated it.
I have another question regarding meter firmware version check. I will create another post for this.
Dayah