Hi!
I'm quite new with java and I'd like to ask what should I write after connecting server to get value from specified register. I mean the active energy with address: 1.1.1.8.0.255. I'd like to write a simple application which connect to tcp server and get value of specified register. When I try to read port with standard "read" command I'm getting something like this:
The easiest way to start is if you parse this readout and find data from there.
It's a good option if you don't need to write anything. Writing is more complex. You need to generate the seed, etc.
Reading whole readout takes about 10 minutes, but I'd like to read specified register to save time instead of waiting. I guess I should send a binary frame? There's no simple solution with few lines?
I don't know the model of your meter but there are some differences between IEC 62056-21 meters. I don't know is your meter using the checksum, etc.
This might help you. It's how to connect to the Elster meter. You are reading ABB meter and I can't remember how the password is counted in ABB. https://www.gurux.fi/node/5415
I believe that you can't read your meter with just a few lines of code. If you want to make it easy, get readout and parse the data.
Your link gave me some advice, but I have question how to add <ACK> to the message? The initiational message was read correctly but I have problem implementing <ACK> <STX> etc. like ASCII code [0x6] - ack.
This working for initiation:
OutputStream out = socket.getOutputStream();
String test = "/?!\r\n";
byte[] xd = test.getBytes("ASCII");
out.write(xd);
But when I try to send the next message meter doesn't recognize it:
String test2 = (char)0x6 + "051\r\n";
byte[] xd2 = test2.getBytes("ASCII");
out.write(xd2);
I've managed to solve it I guess but meter sends me in respond NAK flag and I don't know why. Here in the picture You can se the part of the code when request with type of message selected (051). In the output are ascii value od characters and under them are converted to string text.
050 working and it's fine because I'm receiving my data in few seconds instead of 10 minutes. But I don't know why it keeps sending me NAK flag with 051 request.
Hi,
Hi,
This is IEC 62056-21 readout. There is an OBIS code that describes data and after that is value.
https://www.gurux.fi/DLMSCOSEMFAQ
The easiest way to start is if you parse this readout and find data from there.
It's a good option if you don't need to write anything. Writing is more complex. You need to generate the seed, etc.
BR,
Mikko
Parsing whole readout takes
Reading whole readout takes about 10 minutes, but I'd like to read specified register to save time instead of waiting. I guess I should send a binary frame? There's no simple solution with few lines?
Hi,
Hi,
I don't know the model of your meter but there are some differences between IEC 62056-21 meters. I don't know is your meter using the checksum, etc.
This might help you. It's how to connect to the Elster meter. You are reading ABB meter and I can't remember how the password is counted in ABB.
https://www.gurux.fi/node/5415
I believe that you can't read your meter with just a few lines of code. If you want to make it easy, get readout and parse the data.
BR,
Mikko
Your link gave me some advice
Your link gave me some advice, but I have question how to add <ACK> to the message? The initiational message was read correctly but I have problem implementing <ACK> <STX> etc. like ASCII code [0x6] - ack.
This working for initiation:
OutputStream out = socket.getOutputStream();
String test = "/?!\r\n";
byte[] xd = test.getBytes("ASCII");
out.write(xd);
But when I try to send the next message meter doesn't recognize it:
String test2 = (char)0x6 + "051\r\n";
byte[] xd2 = test2.getBytes("ASCII");
out.write(xd2);
I've managed to solve it I
I've managed to solve it I guess but meter sends me in respond NAK flag and I don't know why. Here in the picture You can se the part of the code when request with type of message selected (051). In the output are ascii value od characters and under them are converted to string text.
And the naswer with ascii and
And the naswer with ascii and converted to string
Hi,
Hi,
Please, don't paste images. Paste plain text. It's hard to read.
If you send 050 is that working?
Try also add small delay, ( About 1 second) before sending data.
BR,
Mikko
050 working and it's fine
050 working and it's fine because I'm receiving my data in few seconds instead of 10 minutes. But I don't know why it keeps sending me NAK flag with 051 request.
Hi,
Hi,
If 051 fails your meter is using Mode A. It means that you can get only readout from the meter.
You can't write anything to the meter.
BR,
Mikko
Is it possible to change the
Is it possible to change the mode?
Hi,
Hi,
You need to ask this from the meter vendor.
BR,
Mikko