By Sandeep Shaw, 11 February, 2022 Forums Gurux DLMS for Java Using the below code to write time into the Meter val item: GXDLMSAutoAnswer = settings.client.objects.findByLN(ObjectType.AUTO_ANSWER,"0.0.1.0.0.255" ) item.listeningWindow.add( AbstractMap.SimpleEntry<GXDateTime, GXDateTime>( GXDateTime(-1, -1, -1, 6, -1, -1, -1), GXDateTime(-1, -1, -1, 8, -1, -1, -1) ) ) val mData = settings.client.write(item, 2) for(i in 0 until mData.size){ reader?.readDLMSPacket(mData.get(i), GXReplyData()) } I am unable to cast GXDLMSObject to GXDLMSAutoAnswer getting the below error even though I am connected to the meter java.lang.NullPointerException: null cannot be cast to non-null type Please help Thanks in Advance Hi, Hi, I believe that your logical name is wrong and findByLN return null. Check it first. BR, Mikko Log in or register to post comments
Hi, Hi, I believe that your logical name is wrong and findByLN return null. Check it first. BR, Mikko
Hi,
Hi,
I believe that your logical name is wrong and findByLN return null. Check it first.
BR,
Mikko