Write a command for DLMS meter

4 posts / 0 new
Last post
GianniS
Write a command for DLMS meter

Hi,
I had download from GitHub the "Gurux.DLMS.Android".
I have a question:
- I have a meter manufacturer "Actaris GAS"
- I want to implement a command:
OBIS Code: 0:94.39.14.255
Authorization bit: 00000010
Duration in minutes: 30
How can I do ?
Please, Can you give me an example or how I must write ?

Thank for your help
Gianni

Kurumi
Kurumi's picture

Hi,

Try to read it first. After that change read-method to write-method.

read(it, pos);
to:
write(it, pos);

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

GianniS

Hi,
I try with this code:
GXDLMSObject obj = new GXDLMSObject();//ObjectType.NONE,"0.94.39.14.255",2);
obj.setObjectType(ObjectType.NONE);
obj.setDescription("0.94.39.14.255");

GXWriteItem w = new GXWriteItem();
w.setParameters(new String[] {"02","30"});
w.setDataType(DataType.OCTET_STRING);
w.setIndex(0);
w.setSelector(0);
w.setTarget(obj);
mClient.write(w,"0.94.39.14.255", DataType.OCTET_STRING, ObjectType.DATA, 2);

But, I have some problems.

Please, Can you help me ?

Gianni Santolin

Kurumi
Kurumi's picture

Hi Gianni,

You can't use GXDLMSObject. It's a base object. Use GXDLMSDirector to read 0.94.39.14.255 and check what is data type.

Then you can read or write it like this:

GXDLMSDataObject it = new GXDLMSDataObject("OBIS code");
mClient.read(it, 2);
mClient.write(it, 2);

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi