Hi,
How to add a new OBIS in Gurux DLMS Server Example Java? I plan to add several OBIS that can be read by a net client. Could you please provide a step-by-step guide?
Thank you very much.
So, I want to add a new object named DCU_ID with OBIS = 0.0.96.1.0.255 along with its index value.
I have tried to add the code:
void addDcuIdObject() {
if (getItems().findByLN(ObjectType.DATA, "0.0.96.1.0.255") == null) {
GXDLMSData dcuId = new GXDLMSData("0.0.96.1.0.255");
dcuId.setValue(0);
dcuId.setDataType(2, DataType.UINT32);
dcuId.setValue(0);
getItems().add(dcuId);
}
}
And I also placed addDcuIdObject(); inside the boolean init(final String port) throws XMLStreamException, IOException {.
However, the DCU ID doesn't appear when the server is read. What should I do to add a new object with OBIS and its index value?
Hi, I sincerely apologize as I am still a beginner in matters like this. I have tried commenting out the code, and the output is an error like this:
Gurux.DLMS.Client.Example.Net.exe -r sn -h localhost -p 4060
Standard: DLMS
Invalid count.
System.ArgumentException: Invalid count.
at Gurux.DLMS.Internal.GXCommon.GetObjectCount(GXByteBuffer data) in C:\Users\ASUS\Desktop\Project\DLMS\Gurux.DLMS.Net-master\Gurux.DLMS.Net-master\Development\Internal\GXCommon.cs:line 399
Do you have any other tips or code examples for adding objects, OBIS, and their values?
Hi, I have successfully added several data objects along with their OBIS codes, and they can be read through GxDLMSDirector. However, for some data objects, the description appears as 'Invalid' and 'Ch.0 Man. spec. abstract object.' An example code for the invalid one is as follows:
void addDataHistoricalObject() {
if (getItems().findByLN(ObjectType.DATA, "0.0.98.1.0.255") == null) {
GXDLMSData dataHistorical = new GXDLMSData("0.0.98.1.0.255");
dataHistorical.setValue(1);
dataHistorical.setDataType(2, DataType.UINT8);
getItems().add(dataHistorical);
}
}
Meanwhile, for the successful ID, the code is as follows:
Hi, Check the server example…
Hi,
Check the server example from the GitHub.
https://github.com/Gurux/gurux.dlms.java/tree/master/gurux.dlms.server…
Then read this to get started:
https://www.gurux.fi/Gurux.DLMS.Server
BR,
Mikko
Hi, So, I want to add a new…
Hi,
So, I want to add a new object named DCU_ID with OBIS = 0.0.96.1.0.255 along with its index value.
I have tried to add the code:
void addDcuIdObject() {
if (getItems().findByLN(ObjectType.DATA, "0.0.96.1.0.255") == null) {
GXDLMSData dcuId = new GXDLMSData("0.0.96.1.0.255");
dcuId.setValue(0);
dcuId.setDataType(2, DataType.UINT32);
dcuId.setValue(0);
getItems().add(dcuId);
}
}
And I also placed addDcuIdObject(); inside the boolean init(final String port) throws XMLStreamException, IOException {.
However, the DCU ID doesn't appear when the server is read. What should I do to add a new object with OBIS and its index value?
Hi, At first check that you…
Hi,
At first check that you are not reading old association from the file.
https://github.com/Gurux/gurux.dlms.java/blob/01ec9ce61fc60416f7ac5b468…
You can comment this if you don't want to save settings.
If you are using GXDLMSDirector as a client you need to read the association view again by selecting "File" and "Refresh".
BR,
Mikko
Hi, I sincerely apologize as…
Hi, I sincerely apologize as I am still a beginner in matters like this. I have tried commenting out the code, and the output is an error like this:
Gurux.DLMS.Client.Example.Net.exe -r sn -h localhost -p 4060
Standard: DLMS
Invalid count.
System.ArgumentException: Invalid count.
at Gurux.DLMS.Internal.GXCommon.GetObjectCount(GXByteBuffer data) in C:\Users\ASUS\Desktop\Project\DLMS\Gurux.DLMS.Net-master\Gurux.DLMS.Net-master\Development\Internal\GXCommon.cs:line 399
Do you have any other tips or code examples for adding objects, OBIS, and their values?
Thank you very much.
Hi, Don't worry. DLMS is a…
Hi,
Don't worry. DLMS is a complicated protocol.
Don't use Short name referencing. Only older meters are using it anymore.
Try with this:
Gurux.DLMS.Client.Example.Net.exe -h localhost -p 4060 -t Verbose
If you have problems add a hex trace so I can check from the bytes what might be the reason.
BR,
Mikko
Hi, I've attempted to…
Hi,
I've attempted to utilize the provided command, but unfortunately, I encountered an error as follows:
C:\Users\ASUS\Desktop\Project\DLMS\DLMSNET\Gurux.DLMS.Net-master\Gurux.DLMS.Net-master\Gurux.DLMS.Client.Example.Net\bin\Release>Gurux.DLMS.Client.Example.Net.exe -h localhost -p 4060 -t Verbose
Standard: DLMS
Send SNRM request.7E A0 07 03 21 93 0F 01 7E
TX: 7:40:46 PM 7E A0 07 03 21 93 0F 01 7E
RX: 7:40:46 PM 7E A0 1E 21 03 73 C3 7A 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Parsing UA reply.81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01
Parsing UA reply succeeded.
Send AARQ request
TX: 7:40:46 PM 7E A0 2B 03 21 10 FB AF E6 E6 00 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 62 1E 5D FF FF 88 55 7E
RX: 7:40:46 PM 7E A0 37 21 03 30 6C 7C E6 E7 00 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 02 BE 10 04 0E 08 00 06 5F 1F 04 00 42 02 00 04 00 FA 00 39 FB 7E
Parsing AARE reply61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 02 BE 10 04 0E 08 00 06 5F 1F 04 00 42 02 00 04 00 FA 00
Disconnecting from the meter.
TX: 7:40:46 PM 7E A0 07 03 21 53 03 C7 7E
RX: 7:40:46 PM 7E A0 1E 21 03 73 C3 7A 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Connection is permanently rejected. The application context name is not supported.
Hi, Port 4060 is for Short…
Hi,
Port 4060 is for Short name referencing. Change it for 4061 like this:
-p 4061
BR,
Mikko
Hi, I have successfully…
Hi, I have successfully added several data objects along with their OBIS codes, and they can be read through GxDLMSDirector. However, for some data objects, the description appears as 'Invalid' and 'Ch.0 Man. spec. abstract object.' An example code for the invalid one is as follows:
void addDataHistoricalObject() {
if (getItems().findByLN(ObjectType.DATA, "0.0.98.1.0.255") == null) {
GXDLMSData dataHistorical = new GXDLMSData("0.0.98.1.0.255");
dataHistorical.setValue(1);
dataHistorical.setDataType(2, DataType.UINT8);
getItems().add(dataHistorical);
}
}
Meanwhile, for the successful ID, the code is as follows:
void addDcuIdObject() {
if (getItems().findByLN(ObjectType.DATA, "0.0.96.1.0.255") == null) {
GXDLMSData dcuId = new GXDLMSData("0.0.96.1.0.255");
dcuId.setValue(0);
dcuId.setDataType(2, DataType.UINT32);
dcuId.setAccess(2, AccessMode.READ_WRITE);
dcuId.setValue(0);
getItems().add(dcuId);
}
}
Is there any code or solution to change the data object description that appears in GXDLMSDirector?
Thank you.
Hi, Your OBIS code is…
Hi,
Your OBIS code is invalid. E.g. 0.0.98.1.0.255 is reserved for the profile generic. You can't use it with a Data object.
BR,
Mikko